Repository navigation
fix(chat): ask once for the answer when a reply has only next moves or nothing, as GPT and Gemini do - #2040
Merged
Conversation
…r nothing, as GPT and Gemini do Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk
previously approved these changes
Nov 3, 2026
This was referenced Nov 3, 2026
# Conflicts: # web/src/lib/chat/engine.ts
gkhngyk
pushed a commit
that referenced
this pull request
Nov 4, 2026
…y its cause (#2113) * fix(chat): recover an empty answer once a run, the kind picked by its cause A provider error retry (#2064) and the ask for the answer (#2040) each had their own once-a-run flag, so one empty answer could take 3 model calls (4 with the language rewrite). One flag, progress.recovered, now holds the run's single recovery: a writing step the provider ended in an error runs again as it was; the model's own empty or next-moves-only reply is asked for the answer with ANSWER_NOTE and no next moves tool. A reading step with nothing in it no longer spends the retry: it moves on to writing anyway. A recovery step that is empty too ends the run as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(chat): hold the run's one recovery across a card and a change-only job's reading Main now has two paths the single recovery meets: a run that waits on a card and goes on as the same run (an agent's run_agent too, #2052), and a change-only job that stops on "No change" once its reading ends (#2015). The recovery a run spent before its card stays spent after it, and a reading step the provider ended with nothing in it is taken as read enough: the job still stops on "No change" with no retry and no writing step. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9 --------- Co-authored-by: Cihan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Summary
With some non-Claude models, a Chat reply can end with no answer: the run finishes and the person sees nothing. GPT-6 Luna and Gemini 3.8 Flash often answer a short message like "hi" with a
suggest_next_movescall alone and no text. The engine took a reply with only next moves as a finished answer (CHAT-07 §C item 6), so the run endeddonewith an empty message.Where we saw it:
Fix, in
modelLoop(web/src/lib/chat/engine.ts):ANSWER_NOTEinrules.ts), telling the model its reply had no text and to write the answer, in the person's language, without suggesting the moves again;progress.answerAsked). A second empty reply ends the run as before.Checked with real calls on top of the W4-35 test set, one greeting each:
Related issue
None. Found by the Chat Wave 4 model test set (W4-35).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd web && yarn vitest run src/lib/chat/engine.test.ts -t "next moves". Two new tests:No migration. No new environment variables. No Help change: the visible behavior is the answer that should have been there.
Checklist
yarn lintpassesyarn typecheckpassesyarn format:checkpasseshelp/(or no user-visible change)CI passed on this branch (c669f73), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41534312655): schema is up to date; web
format:check, lint, typecheck, all tests andyarn buildpass; server lint,format:checkand all tests pass.🤖 Generated with Claude Code