Skip to content

judge: ASK hands a question back to the user; server stream errors retry once - #415

Merged
rromenskyi merged 3 commits into
mainfrom
judge-ask
Nov 23, 2026
Merged

rromenskyi merged 3 commits into
mainfrom
judge-ask

Conversation

@rromenskyi

@rromenskyi rromenskyi commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor
  • The goal judge has a third verdict, ASK (ask_user() or "ASK: "):
    the agent stopped on a question only the user can answer. The run ends
    without a re-feed, the goal stands ("your answer: …"), and the TUI says it
    waits for the reply. The judge decides, not the agent, so a weak model can't
    use asking to dodge work; a question it could settle itself is MORE. MORE
    outranks ASK, ASK outranks DONE; ASK is never read from a draft and needs a
    colon and a question. Replaces the v0.71.0 rule that every unaccepted prose
    reply handed control back, and covers a question asked after tool use.
  • An error the server reports inside the stream is retried once, not with the
    full retry budget: the server is up and says the generation failed, and an
    over-long prompt fails the same way each time. Dropped connections and stalls
    keep the full budget.

Review rounds (codex, muse, devin):

  • The user's answer carries the goal on: the goal keeps the question it stopped
    on (goalState.Asked), the next run gets it (SetPendingQuestion), is judged like
    the goal itself even when the model only acknowledges in prose, and the judge
    is told the question was asked and this is the answer.
  • The give-up paths (stuck, steps out, failed turn) keep an ASK: Transcript.Asked,
    the "waiting for your answer" event and note, no re-feed, no "/goal go".
  • ASK counts only when the agent's last words hold a question; otherwise it is
    no verdict. "ASK: x — MORE: y" on one line is MORE. Formatting alone
    ("ASK:") is not a question. ask_user() with no question no longer hides a
    DONE. The judge is told an already-answered question is MORE.
  • A re-fed run that never used a tool is not pushed to "do it with tools": its
    prose goes to the judge.
  • Server stream errors: counted apart from dropped connections, and errors that
    say the server is busy, overloaded or loading keep the full retry budget.
  • /goal go while a question stands is a resume, not the user's reply: the judge
    sees the ordinary gap ("your answer: …"), not "this is their answer".
  • A mid-stream error whose type is only "server_error", or whose message names
    the request (context, too long, exceed, invalid), keeps the one-retry cap;
    only specific busy/loading/overload/rate-limit conditions get the full budget.

Each change has a test that fails with the change reverted. go test ./..., -race on internal/agent, internal/llm, cmd/agent, and the windows build pass.

🤖 Generated with Claude Code

…try once

- The goal judge has a third verdict, ASK (ask_user() or "ASK: <question>"):
  the agent stopped on a question only the user can answer. The run ends
  without a re-feed, the goal stands ("your answer: …"), and the TUI says it
  waits for the reply. The judge decides, not the agent, so a weak model can't
  use asking to dodge work; a question it could settle itself is MORE. MORE
  outranks ASK, ASK outranks DONE; ASK is never read from a draft and needs a
  colon and a question. Replaces the v0.71.0 rule that every unaccepted prose
  reply handed control back, and covers a question asked after tool use.
- An error the server reports inside the stream is retried once, not with the
  full retry budget: the server is up and says the generation failed, and an
  over-long prompt fails the same way each time. Dropped connections and stalls
  keep the full budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

rromenskyi and others added 2 commits November 22, 2026 21:26
- The user's answer carries the goal on: the goal keeps the question it stopped
  on (goalState.Asked), the next run gets it (SetPendingQuestion), is judged like
  the goal itself even when the model only acknowledges in prose, and the judge
  is told the question was asked and this is the answer.
- The give-up paths (stuck, steps out, failed turn) keep an ASK: Transcript.Asked,
  the "waiting for your answer" event and note, no re-feed, no "/goal go".
- ASK counts only when the agent's last words hold a question; otherwise it is
  no verdict. "ASK: x — MORE: y" on one line is MORE. Formatting alone
  ("**ASK:**") is not a question. ask_user() with no question no longer hides a
  DONE. The judge is told an already-answered question is MORE.
- A re-fed run that never used a tool is not pushed to "do it with tools": its
  prose goes to the judge.
- Server stream errors: counted apart from dropped connections, and errors that
  say the server is busy, overloaded or loading keep the full retry budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- /goal go while a question stands is a resume, not the user's reply: the judge
  sees the ordinary gap ("your answer: …"), not "this is their answer".
- A mid-stream error whose type is only "server_error", or whose message names
  the request (context, too long, exceed, invalid), keeps the one-retry cap;
  only specific busy/loading/overload/rate-limit conditions get the full budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rromenskyi
rromenskyi merged commit ea574ad into main Nov 23, 2026
2 checks passed
@rromenskyi
rromenskyi deleted the judge-ask branch November 23, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant