This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-31 17:15:34 -04:00
1 parent 490502a1e0
commit 4aafe5a0e4
17 files changed
+193 -16

No files matched your search

+2 -2
View File
@@ -17,7 +17,7 @@ from cptr.utils.agents.events import (
AgentTextDelta,
AgentToolUpdate,
)
from cptr.utils.agents.prompts import latest_user_text
from cptr.utils.agents.prompts import session_turn_prompt_text
_claude_clients: dict[str, tuple[Any, tuple[Any, ...]]] = {}
@@ -125,7 +125,6 @@ async def run_claude_code_agent(
yield AgentError("Claude Code support requires the claude-agent-sdk Python package")
return
prompt = latest_user_text(messages)
env = os.environ.copy()
home = os.path.expanduser(str(profile["home"])) if profile.get("home") else None
if home:
@@ -143,6 +142,7 @@ async def run_claude_code_agent(
if resume_state:
value = resume_state.get("session_id")
session_id = value if isinstance(value, str) and value else None
prompt = session_turn_prompt_text(messages, resumed=bool(session_id))
options_kwargs: dict[str, Any] = {
"system_prompt": system_prompt or None,