Skip to content

feat: bounded reasoning replay and explicit signature recovery - #132

Merged
HTExplicit merged 3 commits into
mainfrom
fix/reasoning-replay-recovery-v021
Sep 7, 2026
Merged

HTExplicit merged 3 commits into
mainfrom
fix/reasoning-replay-recovery-v021

Conversation

@HTExplicit

@HTExplicit HTExplicit commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Add two independently controllable, default-on policies for applicable OpenAI HTTP Responses accounts while preserving the .4 agent routing and stream contracts.

  • Cache and replay one completed, reversible Chat function-tool batch, including raw reasoning, phase, summary and original item order. Scope the cache to the downstream tenant, selected source, complete reasoning configuration and verified history/batch fingerprints; enforce hard TTL and storage/I/O bounds.
  • On a precise structured reasoning-signature rejection before semantic output, allow one explicitly lossy same-source retry. Keep a bounded, tenant/source-isolated 24-hour memory of rejected old ciphertext, retain fresh reasoning, and never strip references/compaction or enter another scheduler retry. Passthrough has this explicit recovery exception.
  • Preserve independent reasoning mode/context/extension fields and exact numeric values; reject nonrepresentable Chat-only conversions instead of silently dropping settings. Do not force pro or increase effort.
  • Finish HTTP Responses after complete authoritative terminal processing and flush, without waiting for EOF. Preserve failed/incomplete status, partial-write safety and separate attempt usage.
  • Add create/edit/bulk policy UI, strict admin validation, complete-target bulk preflight and scheduler projection so an explicit false cannot become the enabled default.

No database schema, migrations, fixed prompts, remote-skill seeds, production routing configuration or resource-profile changes. No hidden continuation, 516 retry, model escalation or identity spoofing. WS and Messages lossy recovery are not introduced.

Validation

  • Targeted service/repository/apicompat/admin reasoning tests pass, including Redis capacity/TTL/CAS, blocked-I/O budget, cross-scope isolation, same-source retry, stream terminal ordering, partial downstream writes and old/new ciphertext separation.
  • Existing .4 Agent and Chat/Responses contract selections pass.
  • Frontend: 18 targeted policy tests pass; typecheck, scoped lint and locale checks pass.
  • Test-only diagnostic control/parser cases pass offline. The broker-bound study completed at source6b4caab3 with11/16 actual POST attempts and no retries/refunds. All four tool-first responses lacked encrypted reasoning; modified ciphertext requests were accepted upstream, so real replay/recovery/negative-cache activation remains unexercised. Astra stream-first failed downstream shape validation while its upstream was completed; Astra nonstream-final failed upstream. No raw responses were persisted and no extra model requests were made.
  • A subsequent offline audit found an independently reproducible valid function-stream gap: full arguments on added/done/terminal snapshots were ignored. Preserve missing argument suffixes using prefix digests, retain real late identity, and reject contradictory snapshots without replay. Converter and actual Forward/cache round-trip regressions pass. This is not claimed to establish the exact cause of the unrecoverable Astra sample.
  • Add explicit reasoning gates to Downstream Verify and Downstream Release; new code must pass its own required CI.

Community mechanisms reviewed: Wei-Shaw#6633, QuantumNous/new-api#6392, Wei-Shaw#6690 and Wei-Shaw#6473. This implementation does not copy their unbounded/global cache or broad retry behavior. Protocol correctness is not presented as proof of universal model-quality improvement.

@HTExplicit
HTExplicit merged commit ab6b75f into main Sep 7, 2026
16 checks passed
@HTExplicit
HTExplicit deleted the fix/reasoning-replay-recovery-v021 branch September 7, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants