Per-Turn Mode Switching: Ask / Plan / Edit (ref #32)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 146
- Forks
- 20
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
Per-turn mode switching: Ask / Plan / Edit
Related: #32
Problem
A conversation is locked to one mode (Chat or Agent) at creation time and cannot change. Common workflow: start with Chat to ask questions → want AI to write to canvas → can't → new conversation → lose context.
Root cause: mode is a conversation-level attribute. It should be per-message.
Proposal
Same conversation and shared history, with the system prompt and tool allowlist selected per turn.
| Mode | Intent | Canvas |
|---|---|---|
| Ask | Question, analyze, compare | Read-only |
| Plan | Design what to change | Non-persistent preview |
| Edit | Execute changes | Read-write, via Review Card |
"Agent" as a mode name is avoided — it already refers to the execution entity (built-in / ACP external). Two orthogonal dimensions:
agent_id: "builtin" | "claude-code" | "acp-external"
mode: "ask" | "plan" | "edit"
Mode should be a server-enforced capability boundary, not only a behavioral instruction in the system prompt.
Reference: Claude Code's Shift+Tab (docs) — shared context, per-message mode.
Minimum implementation
- Mode selector next to input (Ask / Plan / Edit)
- Each mode maps to a server-side tool allowlist (not just prompt)
- Keyboard shortcut for quick cycle
modefield stored per turn in.history/JSONL
Open question: Should Plan mode produce a structured operations artifact for canvas preview before execution?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing conversation-level mode through the input flow, server-side tool authorization, and .history/ JSONL persistence; the issue names no specific files or tests. Done means Ask, Plan, and Edit can be selected per turn, the server enforces each mode's tool boundary, a keyboard shortcut cycles them, and each turn records its mode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100