[PR #8944] [MERGED] fix(dottore): resend a Claude stream that ends before message_start, and trace failures #8900

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8944
Author: @SpicyMarinara
Created: 11/7/2026
Status: ✅ Merged
Merged: 11/7/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/dottore-assertion-trace


📝 Commits (1)

  • 9b3bcc7 fix(dottore): resend a Claude stream that ends before message_start

📊 Changes

3 files changed (+90 additions, -6 deletions)

View changed files

📝 .github/dottore-review/README.md (+4 -0)
📝 .github/dottore-review/dottore_review.py (+26 -2)
📝 scripts/regressions/dottore-stream-progress.regression.mjs (+60 -4)

📄 Description

Linked issue

Closes #8918

Why this change

Dottore Review failed on #8844's full reviews with "Dottore Review could not complete: AssertionError:" and nothing else. There was no traceback and no hint of where it came from. A packet's finder received an HTTP 200 stream that ended before its first event, message_start. The pinned Anthropic SDK (anthropic==2.1.0, lib/streaming/_messages.py:101) then fails a bare assert in get_final_message. That isn't an error chat retries, so the review ended. error_text printed the empty message and nothing printed the traceback. Reproduced with the pinned SDK and a mocked empty 200 stream: exactly AssertionError: .

What changed

.github/dottore-review/dottore_review.py:

  • claude_reply records the events that arrive before message_start: their type, and their error message if any.
  • When message_start never arrives, it raises the existing stall error, which chat already resends once. The message carries what the gateway sent, for example the reply stream ended before Claude started (content-type application/json, request-id req_123, events before message_start: none).
  • Normal replies and streams cut off mid-reply behave as before.
  • error_text names where an error without a message was raised, for example AssertionError: raised at anthropic/lib/streaming/_messages.py:101 in get_final_message.
  • A failed review prints its full traceback to the run log.
  • The README documents the resend.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Run by the agents (not a substitute for the boxes above):

  • With the real SDK: an empty stream, a data-only stream, an in-band error before message_start and a JSON error body all become the descriptive stall and resend. A normal stream ending in tool_use is unchanged.
  • dottore-stream-progress.regression.mjs is extended. All Dottore regression scripts and pnpm check pass.

Still to verify by hand:

  • After this merges, run /dottore full on a large PR such as #8844's former head to confirm the review completes, or, if the gateway fails again, that the run log shows the traceback and the gateway's content type and request id. Recovery there is not verified yet.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8944 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/7/2026 **Status:** ✅ Merged **Merged:** 11/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/dottore-assertion-trace` --- ### 📝 Commits (1) - [`9b3bcc7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9b3bcc7a8a48c5ed999081991a43ee8941f15100) fix(dottore): resend a Claude stream that ends before message_start ### 📊 Changes **3 files changed** (+90 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `.github/dottore-review/README.md` (+4 -0) 📝 `.github/dottore-review/dottore_review.py` (+26 -2) 📝 `scripts/regressions/dottore-stream-progress.regression.mjs` (+60 -4) </details> ### 📄 Description ## Linked issue Closes #8918 ## Why this change Dottore Review failed on #8844's full reviews with "Dottore Review could not complete: AssertionError:" and nothing else. There was no traceback and no hint of where it came from. A packet's finder received an HTTP 200 stream that ended before its first event, `message_start`. The pinned Anthropic SDK (`anthropic==2.1.0`, `lib/streaming/_messages.py:101`) then fails a bare `assert` in `get_final_message`. That isn't an error `chat` retries, so the review ended. `error_text` printed the empty message and nothing printed the traceback. Reproduced with the pinned SDK and a mocked empty 200 stream: exactly `AssertionError: `. ## What changed `.github/dottore-review/dottore_review.py`: - `claude_reply` records the events that arrive before `message_start`: their type, and their error message if any. - When `message_start` never arrives, it raises the existing stall error, which `chat` already resends once. The message carries what the gateway sent, for example `the reply stream ended before Claude started (content-type application/json, request-id req_123, events before message_start: none)`. - Normal replies and streams cut off mid-reply behave as before. - `error_text` names where an error without a message was raised, for example `AssertionError: raised at anthropic/lib/streaming/_messages.py:101 in get_final_message`. - A failed review prints its full traceback to the run log. - The README documents the resend. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Run by the agents (not a substitute for the boxes above): - With the real SDK: an empty stream, a data-only stream, an in-band error before `message_start` and a JSON error body all become the descriptive stall and resend. A normal stream ending in `tool_use` is unchanged. - `dottore-stream-progress.regression.mjs` is extended. All Dottore regression scripts and `pnpm check` pass. Still to verify by hand: - After this merges, run `/dottore full` on a large PR such as #8844's former head to confirm the review completes, or, if the gateway fails again, that the run log shows the traceback and the gateway's content type and request id. Recovery there is not verified yet. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README) as needed 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi changed title from [PR #8944] fix(dottore): resend a Claude stream that ends before message_start, and trace failures to [PR #8944] [MERGED] fix(dottore): resend a Claude stream that ends before message_start, and trace failures 2026-11-07 21:50:03 +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#8900
No description provided.