tweak: wrap build-switch w/ system-reminder (#2525)

This commit is contained in:
Aiden Cline
2025-09-09 23:57:13 -05:00
committed by GitHub
parent c8ca036834
commit bdc0f7c86d
2 changed files with 7 additions and 3 deletions

View File

@@ -766,8 +766,8 @@ export namespace Session {
})
}
const lastAssistantMsg = msgs.filter((x) => x.info.role === "assistant").at(-1)?.info as MessageV2.Assistant
if (lastAssistantMsg?.mode === "plan" && agent.name === "build") {
const wasPlan = msgs.some((msg) => msg.info.role === "assistant" && msg.info.mode === "plan")
if (wasPlan && agent.name === "build") {
msgs.at(-1)?.parts.push({
id: Identifier.ascending("part"),
messageID: userMsg.id,

View File

@@ -1 +1,5 @@
Your operational mode has changed from plan to build. You are no longer in read-only mode. You are permitted to make file changes as necessary and utilize your arsenal of tools as needed.
<system-reminder>
Your operational mode has changed from plan to build.
You are no longer in read-only mode.
You are permitted to make file changes, run shell commands, and utilize your arsenal of tools as needed.
</system-reminder>