diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts index 2455962d..796294ec 100644 --- a/packages/opencode/src/session/index.ts +++ b/packages/opencode/src/session/index.ts @@ -726,6 +726,18 @@ export namespace Session { synthetic: true, }) } + + const lastAssistantMsg = msgs.filter((x) => x.info.role === "assistant").at(-1)?.info as MessageV2.Assistant + if (lastAssistantMsg?.mode === "plan" && agent.name === "build") { + msgs.at(-1)?.parts.push({ + id: Identifier.ascending("part"), + messageID: userMsg.id, + sessionID: input.sessionID, + type: "text", + text: "You are now in build mode and are permitted to make edits", + synthetic: true, + }) + } let system = SystemPrompt.header(input.providerID) system.push( ...(() => {