Skip to content

Add Ask mode (read-only Q&A) alongside Build/Plan #25

Description

@aakashrajput

Enhancement

Add a third mode, Ask, alongside the existing Build/Plan tabs — read-only Q&A about the codebase, with no expectation of producing a plan or making edits.

Current state

src/screens/repl.ts:247:

const tabs = new TabBar(["Build", "Plan"]);

Cycled with Tab/Shift+Tab (repl.ts:4367, 4382). Each tab has a distinct system prompt in src/agent/system-prompt.ts:136-141 (MODE_PROMPTS), plus tool-restriction logic in repl.ts around line 2992-2993 (planMode gates read-only tools + exit_plan_mode) and a D4 routing hint (task: planMode ? "plan" : undefined, repl.ts:3027-3028).

Plan mode is read-only but purpose-built to end in a plan: the model is instructed to call exit_plan_mode with a concrete plan, which on approval auto-switches the tab back to Build (repl.ts:1369-1375, 3306-3314). That's the wrong shape for someone who just wants to ask "what does this function do" or "why is X implemented this way" — they don't want a plan-approval handoff, they want a direct read-only answer and to stay put.

Why not just use Plan for this

Using Plan mode for a plain question forces the model toward producing a plan and calling exit_plan_mode (per its system prompt), and the D4 task: "plan" routing hint sends it through the plan-tuned cascade — mismatched for simple explanation/lookup questions. Right now users have to fall back to Build mode (with full edit tools available) just to ask something, which also risks the model making unrequested edits.

Suggested implementation

  1. TabBar(["Build", "Plan", "Ask"]) (or reorder as preferred).
  2. New MODE_PROMPTS["Ask"] in system-prompt.ts: read-only tools, answer directly, no plan/exit_plan_mode requirement — e.g. "Read-only Q&A. Explore with read-only tools and answer the question directly — no plan needed, no edits. If the question implies the user actually wants a change made, say so and suggest switching to Build (or Plan for anything nontrivial)."
  3. Extend the tool-restriction branch at repl.ts:2992-2993 so Ask gets the same read-only tool set as Plan minus exit_plan_mode (it never needs to hand off).
  4. D4 task hint (repl.ts:3027-3028): Ask should probably send task: "search" (closest existing D4 shape) rather than undefined, to get the same server-side routing benefit Plan already gets.
  5. Skip the Plan-specific auto-switch-to-Build logic (repl.ts:3306-3314) for Ask — it just answers and stays on the Ask tab.

Non-goals

Not proposing changes to Plan's or Build's existing behavior — purely additive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions