diff --git a/packages/opencode/index.ts b/packages/opencode/index.ts index 3f0a30c..70d4504 100644 --- a/packages/opencode/index.ts +++ b/packages/opencode/index.ts @@ -88,7 +88,8 @@ async function executeSessionCommand( query: { directory: context.directory }, body: { ...(sessionCommand.agent ? { agent: sessionCommand.agent } : {}), - parts: [{ type: "text", text: sessionCommand.prompt }], + // Queue the delegated turn without surfacing the prompt as a normal user message. + parts: [{ type: "text", text: sessionCommand.prompt, synthetic: true }], }, }); diff --git a/packages/opencode/test/tool-registration.test.ts b/packages/opencode/test/tool-registration.test.ts index 629b6b5..930bb45 100644 --- a/packages/opencode/test/tool-registration.test.ts +++ b/packages/opencode/test/tool-registration.test.ts @@ -294,7 +294,7 @@ describe("createOpenCodeTools", () => { query: { directory: process.cwd() }, body: { agent: "reviewer", - parts: [{ type: "text", text: result.prompt }], + parts: [{ type: "text", text: result.prompt, synthetic: true }], }, }); assert.equal(client.sessionPrompts.length, 0);