-
Notifications
You must be signed in to change notification settings - Fork 98
subagent: pass callSite: 'subagentSpawn' when spawning isolated agents #26122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -439,7 +439,9 @@ export class SubagentManager { | |
| ].join("\n") | ||
| : objective; | ||
| const messageId = await conversation.persistUserMessage(message, []); | ||
| await conversation.runAgentLoop(message, messageId, onEvent); | ||
| await conversation.runAgentLoop(message, messageId, onEvent, { | ||
| callSite: "subagentSpawn", | ||
| }); | ||
|
|
||
| // Agent loop completed successfully. | ||
| // Copy usage stats from the conversation before sending status (which includes usage). | ||
|
|
@@ -634,7 +636,9 @@ export class SubagentManager { | |
| const conversation = managed.conversation; | ||
| const messageId = await conversation.persistUserMessage(trimmed, []); | ||
| conversation | ||
| .runAgentLoop(trimmed, messageId, onEvent) | ||
| .runAgentLoop(trimmed, messageId, onEvent, { | ||
| callSite: "subagentSpawn", | ||
| }) | ||
|
Comment on lines
636
to
+641
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 Queued subagent messages won't inherit callSite When (Refers to lines 630-641) Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| .catch((err) => { | ||
| log.error({ subagentId, err }, "Subagent message processing failed"); | ||
| }); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting
callSite: "subagentSpawn"here switches subagent turns onto the newllm.callSites/llm.defaultresolver path, but model changes still persist only toservices.inferenceinsetModel()(assistant/src/daemon/handlers/config-model.ts,setServiceField(..., "model")/"provider"). That means after a user changes model/provider, subagents can resolve an outdated model fromllm.defaultwhile still using the provider transport initialized fromservices.inferencein this manager, producing invalid-model/provider mismatches or silently using the wrong model. This regression is exactly the mismatch the main loop currently avoids (seeassistant/src/daemon/conversation-agent-loop.tsaround theturnCallSitecomment) and is now introduced for subagents.Useful? React with 👍 / 👎.