Skip to content

Commit 6bf3b18

Browse files
committed
fix(opencode): carry parent agent through prompt execution
Ensures parentAgent is persisted on user messages, included in Tool.Context during tool resolution, and passed through the main loop's resolveTools call.
1 parent f4d4ede commit 6bf3b18

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/opencode/src/session/prompt.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
359359
callID: options.toolCallId,
360360
extra: { model: input.model, bypassAgentCheck: input.bypassAgentCheck },
361361
agent: input.agent.name,
362+
parentAgent: input.parentAgent,
362363
messages: input.messages,
363364
metadata: (val) =>
364365
Effect.runPromise(
@@ -992,6 +993,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
992993
time: { created: Date.now() },
993994
tools: input.tools,
994995
agent: ag.name,
996+
parentAgent: input.parentAgent,
995997
model: {
996998
providerID: model.providerID,
997999
modelID: model.modelID,
@@ -1486,6 +1488,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
14861488
tools: lastUser.tools,
14871489
processor: handle,
14881490
bypassAgentCheck,
1491+
parentAgent: lastUser.parentAgent,
14891492
messages: msgs,
14901493
})
14911494

0 commit comments

Comments
 (0)