Skip to content

✨ Add Planning Mode support with /plan and /code commands#615

Open
ixchio wants to merge 11 commits into
OpenHands:mainfrom
ixchio:feat/planning-mode
Open

✨ Add Planning Mode support with /plan and /code commands#615
ixchio wants to merge 11 commits into
OpenHands:mainfrom
ixchio:feat/planning-mode

Conversation

@ixchio

@ixchio ixchio commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Hey! 👋

This adds Planning Mode to the CLI - now you can have the agent focus on planning before jumping into code.

The gist

Type /plan → agent plans instead of coding
Type /code → back to normal

In planning mode, the agent will ask questions, understand your requirements, and create a PLAN.md file - no code execution until you're ready.

Visual cues

When you're in planning mode:

  • 📋 Blue "Planning Mode" badge in the status line
  • 🔵 Input border turns blue (like the GUI)

Testing

All 1270 tests pass ✅


Closes #613

openhands-agent and others added 2 commits March 25, 2026 17:00
Implements Planning Mode feature that allows users to switch between
planning-only mode and normal code execution mode via slash commands.

Changes:
- Add agent_mode reactive property to ConversationContainer ('plan' or 'code')
- Add /plan and /code slash commands to switch modes
- Add SetAgentMode message and handler in ConversationManager
- Add PLANNING_MODE_INSTRUCTIONS to guide agent behavior in plan mode
- Add blue mode indicator in WorkingStatusLine when in planning mode
- Add blue border color for InputField when in planning mode
- Update tests for new commands and add planning mode tests

In Planning Mode:
- Agent focuses on understanding requirements and asking questions
- Agent generates PLAN.md instead of executing code
- UI shows blue indicator and border to match GUI behavior

Closes OpenHands#613

Co-authored-by: openhands <openhands@all-hands.dev>
@DoubleDensity

Copy link
Copy Markdown

I am able to enter /plan mode as described and it starts out well with the input bar turning blue, but while it was working on the plan it actually made some file edits! It seems to be able to escape the plan mode cage and eventually proceeded to implement its changes just like it normally does in code mode. Also, if it made plan steps, they did not show up in the 'plan' pane on the right, it stayed empty. Please let me know if there is anyway I could help debug this as I think the feature will be awesome

@DoubleDensity

Copy link
Copy Markdown

I can confirm it did create the PLAN.md in the root of the repo, but that seems to not be the location where OpenHands CLI stores the plans it uses to for the 'Agent Plan' pane on the right? not sure if/how these two things are connected, but it feels like they should be

@enyst enyst requested a review from malhotra5 March 28, 2026 17:31
@jpelletier1

jpelletier1 commented Apr 9, 2026

Copy link
Copy Markdown

Hmm, I think the 'Agent Plan' pane that appears in CLI might be misnamed. For example, this is actually the Task List that the agent uses, similar to what you see in the GUI (screenshot from GUI below)

image

ixchio added 4 commits April 9, 2026 21:47
…pt, fix state reset

- Switch to AlwaysConfirm policy when entering /plan mode so every
  agent action requires explicit user approval (hard safety net)
- Restore user's original confirmation policy on /code
- Reset agent_mode to 'code' in reset_conversation_state() so /new
  doesn't leave user stuck in planning mode
- Harden PLANNING_MODE_INSTRUCTIONS with explicit forbidden action
  names (CmdRunAction, FileWriteAction, FileEditAction, etc.)
- Apply planning instructions to refinement messages too (closes
  bypass through system-generated follow-ups)
- Expand tests from 8 to 15: state reset, policy save/restore
  lifecycle, forbidden action assertions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support Planning Mode in CLI

4 participants