[PR #8188] [MERGED] fix(provider): repair empty Anthropic retry history and debug logs #8147

Closed
opened 2026-10-24 04:10:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8188
Author: @SpicyMarinara
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/anthropic-safe-retry-8186


📝 Commits (3)

  • 1775943 test(provider): reproduce empty Anthropic-compatible retry history
  • 0eab484 fix(llm): omit empty unsigned Anthropic history and log retries
  • d891fc9 Merge branch 'staging' into fix/anthropic-safe-retry-8186

📊 Changes

2 files changed (+189 additions, -1 deletions)

View changed files

📝 packages/server/src/services/llm/providers/openai.provider.ts (+8 -1)
➕ scripts/regressions/anthropic-safe-retry.regression.ts (+181 -0)

📄 Description

Linked issue

Closes #8186. Owner: @SpicyMarinara (Codex).

Why this change

An Anthropic-compatible Chat Completions retry can remove unsigned thinking but retain an empty assistant row, so the reshaped request is rejected again. Its final reshaped prompt also misses the existing opt-in debug log.

What changed

Omit empty unsigned assistant rows while preserving real text, signed thinking and native or retold paired tool rounds. Log the final reshaped retry with the existing debug controls. Accepted non-Anthropic requests and unrelated errors retain their current behavior.

Add a canonical regression using the real provider against a strict local HTTP fixture. No connection/provider option, user-facing copy, dependency, release version, docs or changelog change.

Coordination: open PRs and local branches were checked; #8153 reports this upstream follow-up and does not implement it. The issue and draft are claimed and assigned. The project-board API is unavailable to the current token (missing read:project); issue/branch/PR coordination was checked instead.

Validation

Locally validated repair source: 0eab484a4d4fcd4c03a6fb54d800df0fdc58aed3. The full baseline, local review and compiled-startup evidence below apply to that source.

Current PR head: d891fc92e880538f4c1f1da7bc1e680e7a60b26f, after GitHub's native update-branch merged reviewed staging ea8d4c3a74a12ab2e9a90610aabbb2cd5856c520. Both owned provider/regression files are byte-identical to 0eab. Three fresh canonical programs pass at d891: actual-HTTP Anthropic retry (all ten wire controls), provider compatibility, and past-reasoning history. No repair source/test changed; no fresh full build or compiled-browser result is claimed for this base-only integration.

  • Full pnpm check passes, with one inherited Professor hook warning.
  • Ten actual local-HTTP wire controls pass. Four intended controls fail before repair. Restoring only the empty-row defect fails three controls; restoring only the missing debug log fails one, against final source/test hashes.
  • Existing provider compatibility and past-reasoning-history regression programs both pass.
  • All three compiled startup/reload browser projects pass.
  • Local CodeRabbit completed substantive review of both changed files with zero findings.

Before/after, independent defect controls, exact patch, full baseline and review evidence: all 17 raw files byte/hash-verified, including the new base-integration parity record and three fresh canonical logs. Dependency installation initially stopped on disk capacity; final checks used an exact-lock installed registry through owned workspace link forests, with pnpm automatic installation disabled. No global setting or dependency metadata change is included.

The earlier Dottore finding examined the stale 177 test-only specimen and is correctly replied/resolved; it is not approval of the repair. Fresh actual examination 39987915022 is running and must establish a viable verdict on the fetched d891 specimen before merge.

The provider fixture uses fake data and a local endpoint. It does not establish paid/live Anthropic-compatible proxy behavior. Hosted required checks and the actual current-head Dottore verdict remain merge gates.

  • 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

Manually verify a compatible proxy that rejects unsigned reasoning with debug off/on. No physical-device, paid-provider or local-container proof is claimed. The changed behavior is server-side request shaping; the existing UI presentation is unchanged.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

🔄 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/8188 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/anthropic-safe-retry-8186` --- ### 📝 Commits (3) - [`1775943`](https://github.com/Pasta-Devs/Marinara-Engine/commit/17759431f9e4b1ab7655c9c9ff398f3bd05adea8) test(provider): reproduce empty Anthropic-compatible retry history - [`0eab484`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0eab484a4d4fcd4c03a6fb54d800df0fdc58aed3) fix(llm): omit empty unsigned Anthropic history and log retries - [`d891fc9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d891fc92e880538f4c1f1da7bc1e680e7a60b26f) Merge branch 'staging' into fix/anthropic-safe-retry-8186 ### 📊 Changes **2 files changed** (+189 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/llm/providers/openai.provider.ts` (+8 -1) ➕ `scripts/regressions/anthropic-safe-retry.regression.ts` (+181 -0) </details> ### 📄 Description ## Linked issue Closes #8186. Owner: @SpicyMarinara (Codex). ## Why this change An Anthropic-compatible Chat Completions retry can remove unsigned thinking but retain an empty assistant row, so the reshaped request is rejected again. Its final reshaped prompt also misses the existing opt-in debug log. ## What changed Omit empty unsigned assistant rows while preserving real text, signed thinking and native or retold paired tool rounds. Log the final reshaped retry with the existing debug controls. Accepted non-Anthropic requests and unrelated errors retain their current behavior. Add a canonical regression using the real provider against a strict local HTTP fixture. No connection/provider option, user-facing copy, dependency, release version, docs or changelog change. Coordination: open PRs and local branches were checked; #8153 reports this upstream follow-up and does not implement it. The issue and draft are claimed and assigned. The project-board API is unavailable to the current token (missing read:project); issue/branch/PR coordination was checked instead. ## Validation Locally validated repair source: `0eab484a4d4fcd4c03a6fb54d800df0fdc58aed3`. The full baseline, local review and compiled-startup evidence below apply to that source. Current PR head: `d891fc92e880538f4c1f1da7bc1e680e7a60b26f`, after GitHub's native update-branch merged reviewed staging `ea8d4c3a74a12ab2e9a90610aabbb2cd5856c520`. Both owned provider/regression files are byte-identical to `0eab`. Three fresh canonical programs pass at `d891`: actual-HTTP Anthropic retry (all ten wire controls), provider compatibility, and past-reasoning history. No repair source/test changed; no fresh full build or compiled-browser result is claimed for this base-only integration. - Full `pnpm check` passes, with one inherited Professor hook warning. - Ten actual local-HTTP wire controls pass. Four intended controls fail before repair. Restoring only the empty-row defect fails three controls; restoring only the missing debug log fails one, against final source/test hashes. - Existing provider compatibility and past-reasoning-history regression programs both pass. - All three compiled startup/reload browser projects pass. - Local CodeRabbit completed substantive review of both changed files with zero findings. [Before/after, independent defect controls, exact patch, full baseline and review evidence](https://gist.github.com/SpicyMarinara/9579e42bc4266c15808a63bdba6b15f3): all 17 raw files byte/hash-verified, including the new base-integration parity record and three fresh canonical logs. Dependency installation initially stopped on disk capacity; final checks used an exact-lock installed registry through owned workspace link forests, with pnpm automatic installation disabled. No global setting or dependency metadata change is included. The earlier Dottore finding examined the stale `177` test-only specimen and is correctly replied/resolved; it is not approval of the repair. Fresh actual examination [39987915022](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39987915022) is running and must establish a viable verdict on the fetched `d891` specimen before merge. The provider fixture uses fake data and a local endpoint. It does not establish paid/live Anthropic-compatible proxy behavior. Hosted required checks and the actual current-head Dottore verdict remain merge gates. - [ ] `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 Manually verify a compatible proxy that rejects unsigned reasoning with debug off/on. No physical-device, paid-provider or local-container proof is claimed. The changed behavior is server-side request shaping; the existing UI presentation is unchanged. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi changed title from [PR #8188] fix(provider): repair empty Anthropic retry history and debug logs to [PR #8188] [MERGED] fix(provider): repair empty Anthropic retry history and debug logs 2026-10-25 04:04: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#8147
No description provided.