mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2421] 11-PROV-RUNTIME-thinking-usage-metadata drops OpenAI Responses encrypted reasoning replay #1186
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1186
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2421
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Surface
11-PROV-RUNTIME-thinking-usage-metadata: refactor provider transport emits visible thinking and usage, but does not preserve OpenAI Responses encrypted reasoning items for replay/debug parity with legacy.Linked tracker: #2410.
Expected behavior
OpenAI Responses reasoning metadata should be requested, preserved, and replayed where applicable, while existing thinking and usage events remain available. Legacy inserted prior encrypted reasoning items into the next Responses input and requested
reasoning.encrypted_content.Actual behavior
Refactor emits
thinkingandusagestream events and stores visible thinking/token info, but targeted static trace found no OpenAI Responses encrypted reasoning replay/preservation equivalent.Steps to reproduce
Impact area
Environment
Logs, screenshots, or video
Proof:
main:packages/server/src/services/llm/providers/openai.provider.ts:1362,:1384.main:packages/server/src/services/llm/providers/openai.provider.ts:1578,:1592.src-tauri/crates/llm/src/lib.rs:2178,:2199.src-tauri/crates/llm/src/lib.rs:3639,:3663,:4105.src/engine/generation/start-generation.ts:1807,:2174,:3374,:3457.encryptedReasoningItems/reasoning.encrypted_contentpreservation.Files inspected:
src-tauri/crates/llm/src/lib.rssrc/engine/generation/start-generation.tssrc/engine/generation/provider-visible-parameters.tsmain:packages/server/src/services/llm/providers/openai.provider.tsmain:packages/server/src/services/llm/providers/google.provider.tsmain:packages/server/src/routes/generate.routes.tsRegression notes
Legacy preserved OpenAI Responses encrypted reasoning items for subsequent-turn continuity. Refactor appears to preserve visible thinking/usage only.
Additional context
Acceptance criteria:
thinkingandusageevents for OpenAI Responses, Anthropic, and Gemini keep working.Do not broaden into saved config or prompt assembly outside what is needed to replay provider metadata.
Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jun 6, 2026):
Fixed on refactor in 343142ee.\n\nWhat changed:\n- OpenAI Responses now requests reasoning.encrypted_content for regular OpenAI Responses calls and replays stored encrypted reasoning items in the Responses input before the last assistant item.\n- ChatGPT local auth Responses calls skip that encrypted reasoning include/replay path.\n- Responses completed payloads preserve encrypted reasoning items as providerMetadata; generation saves that metadata on assistant messages and replays it from assistant history without injecting it as prompt text.\n- Prompt snapshots and provider diagnostics redact encrypted_content so the opaque payload is not exposed in debug output.\n\nVerification:\n- cargo test --manifest-path src-tauri/Cargo.toml -p marinara-llm openai_responses -- --nocapture\n- cargo test --manifest-path src-tauri/Cargo.toml -p marinara-llm encrypted_reasoning -- --nocapture\n- cargo test --manifest-path src-tauri/Cargo.toml -p marinara-security redact_sensitive_json -- --nocapture\n- pnpm typecheck\n- cargo check --manifest-path src-tauri/Cargo.toml --workspace\n- pnpm check:architecture