feat: make plan mode the default, remove experimental flag
- Remove OPENCODE_EXPERIMENTAL_PLAN_MODE flag from flag.ts - Update prompt.ts to always use plan mode logic - Update registry.ts to always include plan tools in CLI - Remove flag documentation from cli.mdx
This commit is contained in:
parent
06d63ca54c
commit
afec40e8da
4 changed files with 3 additions and 30 deletions
|
|
@ -44,7 +44,7 @@ export namespace Flag {
|
||||||
export const OPENCODE_EXPERIMENTAL_LSP_TY = truthy("OPENCODE_EXPERIMENTAL_LSP_TY")
|
export const OPENCODE_EXPERIMENTAL_LSP_TY = truthy("OPENCODE_EXPERIMENTAL_LSP_TY")
|
||||||
export const OPENCODE_EXPERIMENTAL_LSP_TOOL = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_LSP_TOOL")
|
export const OPENCODE_EXPERIMENTAL_LSP_TOOL = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_LSP_TOOL")
|
||||||
export const OPENCODE_DISABLE_FILETIME_CHECK = truthy("OPENCODE_DISABLE_FILETIME_CHECK")
|
export const OPENCODE_DISABLE_FILETIME_CHECK = truthy("OPENCODE_DISABLE_FILETIME_CHECK")
|
||||||
export const OPENCODE_EXPERIMENTAL_PLAN_MODE = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_PLAN_MODE")
|
|
||||||
export const OPENCODE_EXPERIMENTAL_MARKDOWN = truthy("OPENCODE_EXPERIMENTAL_MARKDOWN")
|
export const OPENCODE_EXPERIMENTAL_MARKDOWN = truthy("OPENCODE_EXPERIMENTAL_MARKDOWN")
|
||||||
export const OPENCODE_MODELS_URL = process.env["OPENCODE_MODELS_URL"]
|
export const OPENCODE_MODELS_URL = process.env["OPENCODE_MODELS_URL"]
|
||||||
export const OPENCODE_MODELS_PATH = process.env["OPENCODE_MODELS_PATH"]
|
export const OPENCODE_MODELS_PATH = process.env["OPENCODE_MODELS_PATH"]
|
||||||
|
|
|
||||||
|
|
@ -1232,33 +1232,7 @@ export namespace SessionPrompt {
|
||||||
const userMessage = input.messages.findLast((msg) => msg.info.role === "user")
|
const userMessage = input.messages.findLast((msg) => msg.info.role === "user")
|
||||||
if (!userMessage) return input.messages
|
if (!userMessage) return input.messages
|
||||||
|
|
||||||
// Original logic when experimental plan mode is disabled
|
// Plan mode logic
|
||||||
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")
|
const assistantMessage = input.messages.findLast((msg) => msg.info.role === "assistant")
|
||||||
|
|
||||||
// Switching from plan mode to build mode
|
// Switching from plan mode to build mode
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ export namespace ToolRegistry {
|
||||||
ApplyPatchTool,
|
ApplyPatchTool,
|
||||||
...(Flag.OPENCODE_EXPERIMENTAL_LSP_TOOL ? [LspTool] : []),
|
...(Flag.OPENCODE_EXPERIMENTAL_LSP_TOOL ? [LspTool] : []),
|
||||||
...(config.experimental?.batch_tool === true ? [BatchTool] : []),
|
...(config.experimental?.batch_tool === true ? [BatchTool] : []),
|
||||||
...(Flag.OPENCODE_EXPERIMENTAL_PLAN_MODE && Flag.OPENCODE_CLIENT === "cli" ? [PlanExitTool, PlanEnterTool] : []),
|
...(Flag.OPENCODE_CLIENT === "cli" ? [PlanExitTool, PlanEnterTool] : []),
|
||||||
...custom,
|
...custom,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -594,4 +594,3 @@ These environment variables enable experimental features that may change or be r
|
||||||
| `OPENCODE_EXPERIMENTAL_EXA` | boolean | Enable experimental Exa features |
|
| `OPENCODE_EXPERIMENTAL_EXA` | boolean | Enable experimental Exa features |
|
||||||
| `OPENCODE_EXPERIMENTAL_LSP_TY` | boolean | Enable experimental LSP type checking |
|
| `OPENCODE_EXPERIMENTAL_LSP_TY` | boolean | Enable experimental LSP type checking |
|
||||||
| `OPENCODE_EXPERIMENTAL_MARKDOWN` | boolean | Enable experimental markdown features |
|
| `OPENCODE_EXPERIMENTAL_MARKDOWN` | boolean | Enable experimental markdown features |
|
||||||
| `OPENCODE_EXPERIMENTAL_PLAN_MODE` | boolean | Enable plan mode |
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue