Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions assistant/src/subagent/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
});
Comment on lines +442 to +444

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Defer subagent callSite routing until model config is synced

Setting callSite: "subagentSpawn" here switches subagent turns onto the new llm.callSites/llm.default resolver path, but model changes still persist only to services.inference in setModel() (assistant/src/daemon/handlers/config-model.ts, setServiceField(..., "model") / "provider"). That means after a user changes model/provider, subagents can resolve an outdated model from llm.default while still using the provider transport initialized from services.inference in this manager, producing invalid-model/provider mismatches or silently using the wrong model. This regression is exactly the mismatch the main loop currently avoids (see assistant/src/daemon/conversation-agent-loop.ts around the turnCallSite comment) and is now introduced for subagents.

Useful? React with 👍 / 👎.


// Agent loop completed successfully.
// Copy usage stats from the conversation before sending status (which includes usage).
Expand Down Expand Up @@ -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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Queued subagent messages won't inherit callSite

When sendMessage enqueues a message (line 630-631) because the conversation is busy, the subsequent drain via drainQueueImpl (assistant/src/daemon/conversation-process.ts:842-858) does not propagate callSite in its drainLoopOptions. This means queued subagent messages will use the legacy model resolution path (no callSite) while direct messages get callSite: "subagentSpawn". This is a pre-existing limitation of the queue drain mechanism that affects all callSite users equally — processMessage at conversation-process.ts:1658 also only sets callSite on the initial message, not on drained follow-ups. The practical impact is minimal since the legacy path resolves to a reasonable default model, but it creates a subtle config inconsistency for queued vs non-queued messages.

(Refers to lines 630-641)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

.catch((err) => {
log.error({ subagentId, err }, "Subagent message processing failed");
});
Expand Down
Loading