|
|
@@ -17,7 +17,6 @@ import { ProviderTransform } from "../provider/transform"
|
|
|
import { SystemPrompt } from "./system"
|
|
|
import { InstructionPrompt } from "./instruction"
|
|
|
import { Plugin } from "../plugin"
|
|
|
-import PROMPT_PLAN from "../session/prompt/plan.txt"
|
|
|
import BUILD_SWITCH from "../session/prompt/build-switch.txt"
|
|
|
import MAX_STEPS from "../session/prompt/max-steps.txt"
|
|
|
import { defer } from "../util/defer"
|
|
|
@@ -1232,33 +1231,6 @@ export namespace SessionPrompt {
|
|
|
const userMessage = input.messages.findLast((msg) => msg.info.role === "user")
|
|
|
if (!userMessage) return input.messages
|
|
|
|
|
|
- // Original logic when experimental plan mode is disabled
|
|
|
- if (!Flag.OPENCODE_EXPERIMENTAL_PLAN_MODE) {
|
|
|
- if (input.agent.name === "plan") {
|
|
|
- userMessage.parts.push({
|
|
|
- id: Identifier.ascending("part"),
|
|
|
- messageID: userMessage.info.id,
|
|
|
- sessionID: userMessage.info.sessionID,
|
|
|
- type: "text",
|
|
|
- text: PROMPT_PLAN,
|
|
|
- synthetic: true,
|
|
|
- })
|
|
|
- }
|
|
|
- const wasPlan = input.messages.some((msg) => msg.info.role === "assistant" && msg.info.agent === "plan")
|
|
|
- if (wasPlan && input.agent.name === "build") {
|
|
|
- userMessage.parts.push({
|
|
|
- id: Identifier.ascending("part"),
|
|
|
- messageID: userMessage.info.id,
|
|
|
- sessionID: userMessage.info.sessionID,
|
|
|
- type: "text",
|
|
|
- text: BUILD_SWITCH,
|
|
|
- synthetic: true,
|
|
|
- })
|
|
|
- }
|
|
|
- return input.messages
|
|
|
- }
|
|
|
-
|
|
|
- // New plan mode logic when flag is enabled
|
|
|
const assistantMessage = input.messages.findLast((msg) => msg.info.role === "assistant")
|
|
|
|
|
|
// Switching from plan mode to build mode
|