Skip to content

feat(plan): clarify user-owned ambiguities before writing the plan#4129

Merged
esengine merged 1 commit into
main-v2from
fix/plan-mode-clarify
Jun 12, 2026
Merged

feat(plan): clarify user-owned ambiguities before writing the plan#4129
esengine merged 1 commit into
main-v2from
fix/plan-mode-clarify

Conversation

@esengine

Copy link
Copy Markdown
Owner

Why

In plan mode, Reasonix wrote a complete plan even when key decisions were left underspecified by the user (which tech stack, an ambiguous requirement, scope) instead of clarifying first.

Root cause is purely the prompt, not a missing capability:

  • PlanModeMarker (the per-turn plan-mode instruction) told the model to "explore the codebase first, then present a layered plan and stop", and listed only read_file, ls, grep, glob, web_fetch, task as available — ask was never mentioned.
  • The ask tool is registered (boot.go: reg.Add(agent.NewAskTool())) and ReadOnly() == true, so the plan-mode read-only gate already allowed it. Its own description is exactly right ("ask when a decision is genuinely the user's… don't use it for decisions with an obvious default"). The prompt just steered straight past it.

Change

One-line edit to PlanModeMarker:

  • Add ask to the available-tools list.
  • Insert a high-bar clarify-first step: if a decision that is genuinely the user's — tech stack, an ambiguous requirement, scope, an irreversible choice — would materially shape the plan and can't be settled from the codebase or a sensible default, use ask first; otherwise pick the obvious default and state the assumption in the plan rather than asking.

The bar is intentionally conservative to keep the prefer-sensible-defaults / cheap stance — it should clarify real forks, not interrogate the user on every minor gap.

Cache

No impact: the marker rides in the user message (not the system prompt or tools), so the cache-stable prefix is untouched — the file's own header comment already notes this. It's a fixed constant, so no per-turn variability either.

Control tests (which assert the marker is prepended, by const reference) still pass; gofmt/vet/build clean.

Plan mode produced a full plan even when key decisions were underspecified —
which tech stack, an ambiguous requirement, scope — because the PlanModeMarker
told the model to "explore, then present a layered plan and stop" and never
listed the ask tool among the available ones. The ask tool was registered and
read-only (so the plan gate already allowed it); the prompt just steered past
it.

Add ask to the plan-mode tool list and a high-bar clarify-first step: if a
decision that is genuinely the user's would materially shape the plan and can't
be settled from the codebase or a sensible default, ask first; otherwise pick
the obvious default and state the assumption in the plan rather than asking —
matching the project's prefer-defaults stance and the ask tool's own contract.

The marker rides in the user message, not the system prompt or tools, so the
cache-stable prefix is untouched and the change costs nothing in cache hits.
@esengine esengine requested a review from SivanCola as a code owner June 12, 2026 05:56
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development agent Core agent loop (internal/agent, internal/control) labels Jun 12, 2026
@esengine esengine merged commit cc7fe66 into main-v2 Jun 12, 2026
14 checks passed
@esengine esengine deleted the fix/plan-mode-clarify branch June 12, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant