feat(plan): clarify user-owned ambiguities before writing the plan#4129
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onlyread_file, ls, grep, glob, web_fetch, taskas available —askwas never mentioned.asktool is registered (boot.go:reg.Add(agent.NewAskTool())) andReadOnly() == 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:askto the available-tools list.askfirst; 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.