Skip to content

Plan Mode

pawaca edited this page Aug 30, 2026 · 2 revisions

Plan Mode

Edge adaptation status of the upstream plan mode collaboration feature.

Upstream reference: Plan Mode

What Upstream Provides

Plan Mode (ctx.planMode) is an optional per-agent collaboration state that injects soft guidance into model requests while active. It provides:

  • Logged stateplan/mode events record activation/deactivation. These are logged but never enter the model transcript. State recovers through foldPlanMode() on session load.
  • Policy prompt section — when active, a plan:policy section is injected into the system prompt with deployment-configured guidance text.
  • Exit tool + command — registers exit_plan_mode tool and /plan slash command for user control.
  • Pending selection — user selections are queued and appended at the next pre-step boundary, ensuring consistent ordering with other session events.

Plan Mode is independent of the agent loop — it's a pure state toggle with a prompt-injection side effect.

Current Edge Status

Not Implemented The dsh-plan-mode package is not in Edge's dependencies and no plan mode plugin is installed. The /plan command and exit_plan_mode tool are not available.

Integration feasibility

Plan Mode has minimal dependencies — it's a standalone cordis plugin that injects ['agents', 'systemPrompt'], both of which Edge already provides. There are no platform blockers (no Node.js APIs, no filesystem access). Installation would be a single ctx.plugin(PlanMode, { section: '...' }) call with a configured guidance text.

The /plan command requires the command system. Edge currently has a commands/list stub in handleEdgeRemote but no command execution infrastructure. Plan Mode's command registration would work if the upstream command system is installed.

Plan requirements

All plans — Plan Mode uses only session events and system prompt sections. No additional Cloudflare products required.

Architecture Summary

Component Status Blocker
PlanMode plugin Missing Not added to dependencies
plan:policy section Missing Requires plugin
/plan command Missing Requires command system
exit_plan_mode tool Missing Requires plugin

TODO

(#108) Evaluate Plan Mode installation. The plugin has no platform dependencies and minimal inject requirements. Main question: what guidance text should the plan:policy section contain for Edge's Cloudflare runtime? The /plan command also depends on the command execution system, which is not yet fully wired.

English

中文

Clone this wiki locally