Repository navigation
Labels
Description
Summary
AskUserQuestion is currently plan-mode only. The agent needs it in every interactive mode (standard, auto, auto-with-judge) so it can ask a multiple-choice clarifying question mid-task instead of guessing or stalling on a prose question.
Current behaviour
The tool is enabled by tools.ask_user_question.enabled, but internal/agent/llm_tool_service.go hard-codes it as plan-only:
planOnlyToolslistsRequestPlanApprovalandAskUserQuestion, soListToolsForModestrips it from every non-plan mode andExecuteToolrejects it withonly available in plan mode.planModeAllowedToolskeeps it executable in plan mode (no change needed there).- The tool itself (
internal/agent/tools/ask_user_question.go) has no mode dependency: it reads the broker from context and degrades to a plain-text prompt when no broker is present (headless / no TTY). The broker is injected ininternal/agent/agent.gowhenever a chat handler exists, regardless of mode. - The TUI form (
approvalcoord,chat_handler,question_form_view) is wired off theUserQuestionRequestedevent and is not mode-aware either.
So the restriction is the two maps plus the prompt/reminder text that tells the model the tool is plan-only.
Proposed change
- Remove
AskUserQuestionfromplanOnlyToolsininternal/agent/llm_tool_service.go(keepRequestPlanApprovalthere). Keep it inplanModeAllowedTools. - Update the prompt copy so the model is not told it is plan-only:
config/prompts.go: drop(plan mode only)from theAskUserQuestiondescription and reword the "call it BEFORE RequestPlanApproval" sentence to apply in plan mode only.config/reminders.go: theauto,auto-with-judge, andstandardmode reminders say "plan-only tools (RequestPlanApproval, AskUserQuestion) are disabled" - change toRequestPlanApprovalonly.
- Fix the stale comment on
AskUserQuestionToolConfiginconfig/config.go("plan-mode only") and the README tool table row ("plan mode"). - Tests: update
TestListToolsForMode_AskUserQuestionPlanOnlyand theauto rejects AskUserQuestioncase inTestExecuteTool_ModeGuardininternal/agent/llm_tool_service_test.goto assert the tool is advertised and executable in standard and auto modes, and still excluded in read-only mode.
Out of scope: read-only mode (subagent tool set) stays as is; headless behaviour is already handled by the nil-broker degradation path.
Acceptance Criteria
-
AskUserQuestionappears in the tool list for standard, auto, and auto-with-judge modes whentools.ask_user_question.enabledis true - Calling it in those modes opens the interactive form in the chat TUI and returns the answers to the agent
-
RequestPlanApprovalremains plan-only and plan mode behaviour is unchanged - Headless runs still get the "no interactive form" degradation result instead of an error
- Tool description, mode-change reminders,
config.gocomment, and README no longer describe the tool as plan-mode only - Unit tests in
internal/agent/llm_tool_service_test.gocover the new mode matrix
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Sep 12, 2026
@infer can you work on this? use /ponytail:ponytail /go
inference-gateway-maintainer commentedon Sep 12, 2026
Model:
ollama_cloud/glm-5.3-flash· View JobTodos
Pull Request
#1185
✅ Infer Result: Success
Done. PR #1185 is open and ready for review: #1185
Summary
AskUserQuestionis now available in standard, auto, and auto-with-judge modes instead of plan mode only. The restriction was just the two mode maps plus prompt/reminder copy, so the fix is a one-line deletion at the root:AskUserQuestionremoved fromplanOnlyToolsininternal/agent/llm_tool_service.go(it stays inplanModeAllowedTools, so plan mode is unchanged andRequestPlanApprovalremains plan-only). The TUI form and the headless nil-broker degradation path were already mode-agnostic, so no behavior code was needed.Changes
internal/agent/llm_tool_service.go: droppedAskUserQuestionfromplanOnlyTools, so it is advertised byListToolsForModeand accepted byExecuteTooloutside plan modeconfig/prompts.go: tool description no longer says "(plan mode only)"; the "call BEFORE RequestPlanApproval" sentence is now scoped to plan modeconfig/reminders.go: auto, auto-with-judge, and standard mode-change guidance list onlyRequestPlanApprovalas the disabled plan-only toolconfig/config.go: fixed the stale "plan-mode only" comment onAskUserQuestionToolConfigREADME.md: tool table row no longer marks the tool as plan modeTestListToolsForMode_AskUserQuestionModesasserts advertisement in plan/standard/auto/auto-with-judge and exclusion from read-only;TestExecuteTool_ModeGuardgained "standard/auto allow AskUserQuestion" cases (the auto-rejects case replaced) while theRequestPlanApprovalrejection stays; refreshed three stale comments that claimed plan-only (ask_user_question.go, autocomplete and directexec TUI tests)Verification
go vet,go fmt, andtask lint(imports, golangci-lint, markdownlint) all pass; the pre-commit gate (tidy, mocks, fmt, lint) ran on the commit. The only failing package,tui/app, fails on a pre-existing robotgo X11 header build issue present on the base commit too (verified viagit stash).[DOCS]ticket filed as [DOCS] AskUserQuestion is no longer plan-mode only docs#671 for the docs repo'scli.md/cli-judge-mode.mdpages.Model:
ollama_cloud/glm-5.3-flash· Exit Code:0· Duration: 10m 51sTokens: 3,790,092 in · 25,412 out · 3,815,504 total (44 requests)
Tool calls: 75 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
inference-gateway-releaser commentedon Sep 12, 2026
🎉 This issue has been resolved in version 0.190.2 🎉
The release is available on:
Your semantic-release bot 📦🚀
fix(tools): allow WebFetch and WebSearch in plan mode (#1884)