Stage C: let the agent pause and ask the user a question#5
Closed
Anmolnoor wants to merge 1 commit into
Closed
Conversation
Adds a model-initiated clarifying-question mechanism so the agent can stop and ask instead of guessing when a request is ambiguous. - New ActionKind.QUESTION + QuestionAction model (prompt, options, allow_free_text); PlannedAction.question with validation. Question actions bypass policy like explanations. - Executor handles QUESTION via an injected question_callback: interactive runs prompt synchronously (EXECUTED with the answer); without a callback (non-interactive / dismissed) the action returns AWAITING_INPUT. - Orchestrator: AWAITING_INPUT results stop the loop with the new LoopStopReason.AWAITING_USER_INPUT; an answer is surfaced into the next iteration's observation so the planner acts on it. AWAITING maps to COMPLETED_INCONCLUSIVE (no schema change). - CLI: _prompt_for_question (numbered options + free text, pauses the live widget); wired into _build_orchestrator; _awaiting_input_notice surfaces an unanswered question. Live widget shows an "awaiting your answer" state. - Planner prompt + schema outline document the question action (use sparingly). - Events: EVENT_QUESTION_ASKED / EVENT_QUESTION_ANSWERED. Tests: answer flows into the next iteration; non-interactive stops with AWAITING_USER_INPUT; option-by-number and free-text prompt parsing; the awaiting-input notice. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 27, 2026
Owner
Author
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.
Context
First half of the "make fcli ask me" feature. Adds a model-initiated clarifying-question mechanism so the agent can pause and ask instead of guessing when a request is ambiguous.
What changed
ActionKind.QUESTION+QuestionAction(prompt,options,allow_free_text);PlannedAction.questionwith shape validation. Question actions bypass policy like explanations.question_callback: interactive runs prompt synchronously and returnsEXECUTEDwith the answer; with no callback (non-interactive / dismissed) it returns the newExecutionStatus.AWAITING_INPUT.AWAITING_INPUTstops the loop with the newLoopStopReason.AWAITING_USER_INPUT; an answer is surfaced into the next iteration's observation so the planner acts on it. (Maps toCOMPLETED_INCONCLUSIVE— no history schema change needed.)_prompt_for_question(numbered options + free text, pauses the live widget), wired into_build_orchestrator;_awaiting_input_noticesurfaces an unanswered question. Live widget shows an "awaiting your answer" state.EVENT_QUESTION_ASKED/EVENT_QUESTION_ANSWERED.Tests
6 new (393 total, ruff clean): answer flows into the next iteration; non-interactive stops with
AWAITING_USER_INPUT; option-by-number and free-text prompt parsing; the awaiting-input notice fires (and doesn't without the stop reason).Sequencing
Stage C of A→B→C→D. Stage D (out-of-scope escalation) reuses this prompt/event plumbing.
🤖 Generated with Claude Code