Skip to content

[Implementation] Server-owned provider recovery - #1920

Merged
JAORMX merged 47 commits into
mainfrom
impl/server-provider-recovery
Oct 6, 2026
Merged

JAORMX merged 47 commits into
mainfrom
impl/server-provider-recovery

Conversation

@JAORMX

@JAORMX JAORMX commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Stage: Implementation

Implements the server-owned recovery plan merged in #1912. This PR now targets main and includes the baseline fixes merged in #2108.

Plan merge: 39dcc11ac97569e0889a7da2416400e48bea9df6
Approved amendment: 5899658b7ec278eee9ab4e9cdbe2e9f64815db55
Updated implementation candidate: 5f4cfbddbcc965b26e1d8a8a1e8e22755e6cb588 (acceptance-record finalization atop validated code 1837c1d1c40ba63f6010d76653c923f776ba57ef)
Contract: docs/acceptance/server-provider-recovery.md

Behavior

  • Shared server/runtime-owned precommit recovery for parent and child model calls, respecting normalized Retry-After, breaker cooldown, one live half-open probe, and caller cancellation.
  • Non-sliding 30m/60-wrapper-call limits per model step. No replay after semantic visibility, duplicate completed tools, detached/restart continuation, or task-wide spend guarantee.
  • Known provider-neutral usage survives canceled buffered handoff exactly once in result/session accounting, without canceled semantic output, tool dispatch, or additional continuation reads.
  • Safe provider HTTP/in-band/transport error displays preserve original typed causes, classification/vetoes, timing metadata, and trusted Codex login remediation.
  • Current main's caller-owned review deadlines and preparation-after-approval behavior remain intact. Contextual review retains its 90s total / at-most-three-attempt policy; tighter caller deadlines win.
  • Explicit prompt-free /retry remains. TUI automatic terminal retry and its orphaned eligibility helper are removed.
  • Recovery remains independent of cache TTL. Owning documentation explains possible input/cache-write costs; no TTL cutoff, ignore-TTL flag, expiry tracker, or cache-specific warning is added. Main's current cache configuration policy is preserved.

Consolidation and cleanup

The accounting and error-display changes from closed PRs #2097/#2098 are retained here. They are not separate merge prerequisites. #2108 is already merged. No additional PR is needed for this implementation.

One private resilience-config projection serves all three protocol constructors/remints. Redundant SDK retry options, dead breaker diagnostics, and an always-empty timing method are removed. Manual retry, persisted event vocabulary, independent provider modules, and private Retry-After parsers with conformance coverage remain supported.

Verification

The main refresh resolved conflicts in review/dispatch code, deadline tests, and acceptance metadata. Authoritative main engine review/dispatch implementations were retained; feature tests preserve both absolute-deadline equality and remaining-budget observations. Shorter-caller expiry is checked as caller cancellation, distinct from reviewer-owned timeout.

Focused normal/race checks passed across engine review/cancellation paths, recovery/accounting, app composition, host defaults, TUI/manual retry, and provider error/timing boundaries. Scoped engine/app/resilience lint passed with zero issues. The finalized candidate's acceptance checker, strict recovery-plan trace (20 ACs, zero failures), and documentation lint tests passed. Two independent merge-conformance/security reviews reported no blocker, important, or advisory findings.

An initial combined app compilation command and repository-wide trace exceeded their 120s bounds; those attempts are not claimed passed. The completed narrowed commands passed. No full local suite was demanded: as directed by the operator, focused local evidence plus full CI checks govern readiness. Current-head race/lint/docs/API and other required CI checks must pass before merge.

CI on production code 1837c1d1c passed all 34 applicable checks, including full race, lint, API compatibility, performance, and production execution qualification (5 skipped). The final commit changes only the two acceptance-record documents and has its own CI run. The record proposes landed in this candidate, authoritative only on human merge; strict acceptance tracing is now enforced rather than report-only. The earlier baseline blockers were fixed and merged in #2108.

Deferred work

Provider-reported cache-write tokens on recovered-outcome diagnostics remain the non-blocking follow-up #2096. No cache/spend-policy or reviewer-retry redesign is included.

Recovery interfaces match the approved contract. Final-head CI on 5f4cfbddb is green: 34 passed, 5 skipped, including race tests, lint, performance, and production execution qualification. GitHub reports CLEAN / MERGEABLE, ready for human review and merge. This implementation PR has not been merged or deployed.

@JAORMX
JAORMX force-pushed the plan/server-provider-recovery branch from 13a055f to d13bd65 Compare September 25, 2026 10:37
@JAORMX
JAORMX force-pushed the impl/server-provider-recovery branch from e64bf07 to 0382693 Compare September 25, 2026 10:37
@JAORMX
JAORMX force-pushed the plan/server-provider-recovery branch from d13bd65 to 1715638 Compare September 25, 2026 11:13
@JAORMX
JAORMX force-pushed the impl/server-provider-recovery branch from 0382693 to 490dca2 Compare September 25, 2026 11:13
JAORMX and others added 14 commits October 5, 2026 11:00
Honor provider not-before timing and a non-sliding recovery budget without replaying visible output. Coordinate exclusive generation-checked breaker probes and cancellable notified waiters; stop and join recovery timers before commit and release abandoned iterators.

Keep actual-call observations canonical and recovery-only decisions diagnostic. Update existing admission diagnostics and neutral probe-release expectations to the approved contract. Add all assigned acceptance proofs and cancellation, usage, overflow, and lifecycle regressions.

Co-Authored-By: OpenAI <[email protected]>
Exercise enormous and zero-padded Retry-After values, immutable SDK metadata, inference remints, standalone retry defaults, and bounded semantic repair with its retry veto.

Co-Authored-By: mecatl <[email protected]>
Replace helper-only acceptance claims with root/child, scheduler, guardrail, transport, restart, and real command-host recovery proofs. Remove obsolete TUI automatic-retry bookkeeping.

Co-Authored-By: OpenAI <[email protected]>
Record human-approved recovery policy and stacked implementation authorization.

Co-Authored-By: OpenAI <[email protected]>
Use one virtual timeline for clocks, timers, and deadlines; coordinate admission explicitly instead of relying on scheduling delays.

Co-Authored-By: OpenAI <[email protected]>
Retain the upstream reviewer deadline and checker-down policy after rebasing onto the contextual guardrails integration.

Co-Authored-By: OpenAI <[email protected]>
Use the extracted JSONL adapter and usage-aware reviewer signature in recovery proofs. Update the public TUI guide to retain server-owned recovery semantics after the contributor guide migration.

Co-authored-by: Mecatl <[email protected]>
JAORMX and others added 8 commits October 5, 2026 12:19
Render closed category/status text while retaining private classification inputs, SDK causes, and sanitized HTTP target/correlation details. Cover HTTP, in-band, transport, and exhausted terminal projections with synthetic canaries.

Co-authored-by: Mecatl <[email protected]>
Restore bounded local Codex StatusError guidance at host composition without exposing upstream error strings or adding public API. Exercise the real HTTP/SSE relay and post-event body read failures, retain raw-field classification, and remove obsolete in-band formatting helpers. Update the owning provider documentation.

Co-authored-by: Mecatl <[email protected]>
@JAORMX
JAORMX marked this pull request as draft October 5, 2026 11:11
JAORMX and others added 12 commits October 5, 2026 14:19
Preserve accounting-first delivery, cancellation checks, and cleanup ownership while reducing wrap complexity below the lint limit.

Co-authored-by: Mecatl <[email protected]>
Preserve generation-fenced lease ownership and accounting-first cancellation semantics. Extract remaining-stream cleanup to keep wrapAttempt below the complexity limit and use a tagged switch in recovery diagnostics coverage.

Co-authored-by: Mecatl <[email protected]>
JAORMX added a commit that referenced this pull request Oct 5, 2026
Define the bounded server-owned provider recovery contract, including caller-owned deadlines, received-usage accounting, cache-cost disclosure, and integration prerequisites.

Plan/interface only; implementation remains in #1920.

Co-authored-by: Mecatl <[email protected]>
Base automatically changed from plan/server-provider-recovery to main October 5, 2026 15:00
Preserve main's post-approval contextual review preparation, shared deadlines, ordered read-batch publication, fixture isolation, and Anthropic cache defaults. Combine deadline fixture observations and distinguish caller expiry from checker timeout in the recovery proof. Keep acceptance status in progress pending CI and review.

Co-authored-by: Mecatl <[email protected]>
@JAORMX
JAORMX marked this pull request as ready for review October 5, 2026 15:21
JAORMX and others added 2 commits October 5, 2026 18:57
Assert retry admission timing, in-flight timer joining, and checker-down execution counts. Exercise production-owned SDK retry suppression in error-display tests.

Co-authored-by: Mecatl <[email protected]>
@JAORMX
JAORMX merged commit 12c5fbe into main Oct 6, 2026
39 checks passed
@JAORMX
JAORMX deleted the impl/server-provider-recovery branch October 6, 2026 07:47
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Oct 7, 2026
2 tasks
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.

1 participant