Repository navigation
Conversation
…more, and says so A reasoning model on a tier with max_output_tokens 4096 could spend the whole cap thinking: the stream ended finish_reason "length" with no text and no tool call. The turn failed as empty_completion with advice to start a new session (the context was a tenth full), nothing asked again, and the window also showed an "unrecognised error" toast for the code. Daemon: - stream_reply withdraws a reply that thought to the cap (assistant_retract reason output_cap_thinking) and asks once more, on its own counter, with max_tokens = min(4x cap, max(32768, cap), room left in the window), only when that is at least twice the cap. provider_retry.max_retries 0 turns it off. Later attempts of the call keep the raised cap. - A refusal of the raised request before any output (402 balance reservation, 400, overflow) keeps the first result so the real cause is reported; a refusal of a later stall or guard retry is its own error. - A turn that still has no answer fails as output_cap_thinking and names the config entry whose max_output_tokens applied (a backup's fallbacks[n] or the computer-use worker's preset included). A non-cap empty reply stays empty_completion with accurate copy. The new-chat advice appears only at the compaction budget. Stop as an empty reply lands is a stop. - StreamResult carries the max_tokens it sent, so a cut at the raised cap names that figure; the empty-reply log names model, cap, finish reason, prompt estimate and code. UI: copy for both codes (banner, cleared once a later turn answers; toast), Activity title and preview for the new retract reason, a reason-aware Working line, and the OS notification uses the copy's title. Class B (DECISIONS.md): new error code and retract reason, the raised-cap retry and its refusal rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUthoCrBcxKu4GVj429dwD
A reasoning model with a 128-token cap was withdrawn and answered on the 512 retry; with 512 it failed after the 2,048 retry with the line naming the setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUthoCrBcxKu4GVj429dwD
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.
What
A reasoning model on a tier with
max_output_tokens: 4096could spend the whole cap thinking. The stream endedfinish_reason: lengthwith no text and no tool call, and the turn failed asempty_completion. The chat told the user to start a new session even though the context was about a tenth full. Nothing retried, so the next turns failed the same way. The window had no copy for the code, so a toast also called it an unrecognised error.Daemon:
stream_replywithdraws a reply that thought to the cap (assistant_retract, reasonoutput_cap_thinking) and asks once more on its own counter. The newmax_tokensis min(4× cap, max(32768, cap), room left in the window), sent only when that is at least twice the cap.provider_retry.max_retries: 0turns this off. Later attempts of the same call keep the raised cap.output_cap_thinking. The chat line names the config entry whosemax_output_tokensapplied, aspresets.<preset>.<tier>, a backup'sfallbacks[n], or the computer-use worker's preset.empty_completion, with accurate copy.UI:
output_cap_thinking, cleared once a later turn answers, live or replayed; a toast forempty_completion.Class B entry in DECISIONS.md. The protocol change is additive: one new error code and one new retract reason.
Tests
core/tests/test_thinking_cap_retry.py, 45 tests. With the retry switched off, 10 of them fail. Each fix that came out of review has its own test, and each of those fails without its fix.notifications.test.ts,chat-retract.test.ts,os-notify.test.ts, and the newchat-pane-retry.test.ts, which mounts the real ChatPane. The new behaviour tests fail on the old code.test_worktree_daemon::test_a_failed_checkout_moves_the_session_back_to_its_folder. It passes alone three times out of three; it's a timing flake under load. The baseline run onfe2810c3had a different flake,test_workflow::test_stop_reaches_a_childs_shell, which also passes alone.mypy --strictare clean.vite buildsucceeds, Playwright walk 26 passed, and the protocol fixtures are unchanged.deepseek/deepseek-v4.1-flash-1017), with this branch's daemon in a throwaway data dir and a tinymax_output_tokens. Three runs:output_cap_thinking. The retry at 2,048 spent that too, and the turn failed withoutput_cap_thinkingand the new text namingpresets.<preset>.brain.Not in this PR
These hit the same failure and are listed as follow-ups in the story: the delegate child, which still says "Worker finished with no summary.", the progress check, the validator review, distill, the Settings model probe, OpenRouter
reasoningparams, usagereasoning_tokens, and machine-aware copy for bridged sessions.🤖 Generated with Claude Code
https://claude.ai/code/session_01HUthoCrBcxKu4GVj429dwD