[GH-ISSUE #8186] Anthropic-compatible retry leaves empty unsigned assistant history and omits final prompt debug logging #7601

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

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

Originally assigned to: @SpicyMarinara on GitHub.

The Anthropic-compatible Chat Completions retry can strip unsigned reasoning yet leave an empty assistant history row, so the reshaped request is still invalid for an endpoint that rejects empty assistants. The same retry also omits debug logging of the final reshaped messages.

This is upstream provider code already published to staging, discovered during the staging integration review for #8153; it is separate from that PR's lorebook changes. Open issue/PR searches found no matching active follow-up.

Actual OpenAIProvider.chatComplete reproduction over a local HTTP fixture:

  • User Begin. followed by an assistant with content: "", unsigned reasoning_content, no tools and model alias house-model.
  • The first request contains that unsigned assistant row and receives a synthetic Anthropic-style 400.
  • anthropicSafeWireMessages removes its reasoning payload but pushes the now-empty assistant row.
  • The second request is [user, { role: "assistant", content: "" }] and receives the same local fixture rejection.

The helper preserves empty rows after the tool-call conversion branch; it should omit a textless unsigned row while preserving real content, signed reasoning and correctly paired native/retold tools. The postChatCompletions Anthropic retry should also call the existing conditional logDebugOverride with its final message array, as the adjacent role-alternation retry already does. Keep API keys and non-debug prompts private.

Code owner: Engine packages/server/src/services/llm/providers/openai.provider.ts. Runnable local-HTTP probe and wire bodies, files marinara-upstream-empty-reasoning-probe.mts and .log. All raw evidence files were byte-verified. This proves the emitted wire shape and fallback outcome against a controlled local contract; it does not claim validation with a live Anthropic/proxy account.

Owner for triage: @SpicyMarinara. Implementation has not started; no extra branch or draft PR has been created.

Originally created by @SpicyMarinara on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8186 Originally assigned to: @SpicyMarinara on GitHub. The Anthropic-compatible Chat Completions retry can strip unsigned reasoning yet leave an empty assistant history row, so the reshaped request is still invalid for an endpoint that rejects empty assistants. The same retry also omits debug logging of the final reshaped messages. This is upstream provider code already published to staging, discovered during the staging integration review for #8153; it is separate from that PR's lorebook changes. Open issue/PR searches found no matching active follow-up. Actual `OpenAIProvider.chatComplete` reproduction over a local HTTP fixture: - User `Begin.` followed by an assistant with `content: ""`, unsigned `reasoning_content`, no tools and model alias `house-model`. - The first request contains that unsigned assistant row and receives a synthetic Anthropic-style 400. - `anthropicSafeWireMessages` removes its reasoning payload but pushes the now-empty assistant row. - The second request is `[user, { role: "assistant", content: "" }]` and receives the same local fixture rejection. The helper preserves empty rows after the tool-call conversion branch; it should omit a textless unsigned row while preserving real content, signed reasoning and correctly paired native/retold tools. The `postChatCompletions` Anthropic retry should also call the existing conditional `logDebugOverride` with its final message array, as the adjacent role-alternation retry already does. Keep API keys and non-debug prompts private. Code owner: Engine `packages/server/src/services/llm/providers/openai.provider.ts`. [Runnable local-HTTP probe and wire bodies](https://gist.github.com/SpicyMarinara/455e82ade9320f0257d0fdf1802353e5), files `marinara-upstream-empty-reasoning-probe.mts` and `.log`. All raw evidence files were byte-verified. This proves the emitted wire shape and fallback outcome against a controlled local contract; it does not claim validation with a live Anthropic/proxy account. Owner for triage: @SpicyMarinara. Implementation has not started; no extra branch or draft PR has been created.
bsakaguchi 2026-11-07 16:42:11 +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#7601
No description provided.