[GH-ISSUE #8817] [Issue]: Dottore fails a review when the gateway returns an empty reply marked max_tokens #8509

Closed
opened 2026-11-07 16:43:25 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @SpicyMarinara on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8817

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Dottore Review sometimes fails with "the finder reply reached its 64000-token output cap" on small diffs. The calls never came near the cap: the gateway returned a reply with stop_reason=max_tokens and 0 output tokens a few seconds after the request.

Expected behavior

A reply that ends at max_tokens without any output is a gateway fault, not a spent output budget. Dottore should wait and resend it at the same effort, like other transient gateway errors (RETRY_DELAYS), and only fail the review if the resends fail too.

Actual behavior

claude_reply marks any max_tokens stop as capped. run_agent then resends once at the next lower effort and raises "reached its N-token output cap" when that also comes back empty, which fails the whole review ("Specimen Unexamined").

Evidence from the #8800 review of 6ea7473d (Dottore Review run, examination job log):

  • role=finder; prompt_tokens=19248; completion_tokens=0; stop_reason=max_tokens; first_chunk_s=5.1; elapsed_s=5.3 → "reached its 64000-token output cap at effort xhigh; retrying once at high"
  • role=finder; completion_tokens=0; stop_reason=max_tokens; elapsed_s=14.9 → review failed
  • The same run shows the same empty max_tokens replies on scout and verify calls (16000 and 64000 caps) that recovered on their one retry.

The same failure hit Agents #2100's full review earlier the same day.

Steps to reproduce

Intermittent; seen through the linkapi.ai gateway with DOTTORE_*_API=anthropic, model claude-sonnet-5-5-r, effort xhigh. Push to a ready PR and read the examination log for completion_tokens=0; ... stop_reason=max_tokens.

Environment

  • Marinara Engine version: staging at 260ea0b852 (Dottore tooling)
  • Install type: GitHub Actions (Dottore Review workflow)
  • OS + version: ubuntu runner
  • Browser or app shell: n/a

Logs, screenshots, or video

Quoted above from the examination job log.

Additional context

Fix in progress on fix/dottore-empty-capped-reply (SpicyMarinara, via Claude Code).

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Nov 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8817 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Dottore Review sometimes fails with "the finder reply reached its 64000-token output cap" on small diffs. The calls never came near the cap: the gateway returned a reply with `stop_reason=max_tokens` and **0** output tokens a few seconds after the request. ## Expected behavior A reply that ends at `max_tokens` without any output is a gateway fault, not a spent output budget. Dottore should wait and resend it at the same effort, like other transient gateway errors (RETRY_DELAYS), and only fail the review if the resends fail too. ## Actual behavior `claude_reply` marks any `max_tokens` stop as capped. `run_agent` then resends once at the next lower effort and raises "reached its N-token output cap" when that also comes back empty, which fails the whole review ("Specimen Unexamined"). Evidence from the #8800 review of 6ea7473d (Dottore Review run, examination job log): - `role=finder; prompt_tokens=19248; completion_tokens=0; stop_reason=max_tokens; first_chunk_s=5.1; elapsed_s=5.3` → "reached its 64000-token output cap at effort xhigh; retrying once at high" - `role=finder; completion_tokens=0; stop_reason=max_tokens; elapsed_s=14.9` → review failed - The same run shows the same empty `max_tokens` replies on scout and verify calls (16000 and 64000 caps) that recovered on their one retry. The same failure hit Agents #2100's full review earlier the same day. ## Steps to reproduce Intermittent; seen through the linkapi.ai gateway with `DOTTORE_*_API=anthropic`, model `claude-sonnet-5-5-r`, effort `xhigh`. Push to a ready PR and read the examination log for `completion_tokens=0; ... stop_reason=max_tokens`. ## Environment - Marinara Engine version: staging at 260ea0b852 (Dottore tooling) - Install type: GitHub Actions (Dottore Review workflow) - OS + version: ubuntu runner - Browser or app shell: n/a ## Logs, screenshots, or video Quoted above from the examination job log. ## Additional context Fix in progress on `fix/dottore-empty-capped-reply` (SpicyMarinara, via Claude Code). ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-11-07 16:43:25 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8509
No description provided.