Repository navigation
[Plan / Interface] Server-owned provider recovery - #1912
Conversation
d13bd65 to
1715638
Compare
| ## Human decisions | ||
|
|
||
| - [x] Runtime ownership and decision-record route — Decision: the directing human approved shared server/runtime-owned recovery, not a TUI timer, and explicitly requested no ADR. Frozen ADR 0239 remains unchanged. | ||
| - [x] Command defaults and exposure — Decision: 30m recovery budget and 60 actual wrapper calls (initial included) per model step for `mecated`, `mecak8s`, embedded `mecatui`, and `mecatequi`; expose `--llm-recovery-budget` and `--llm-max-attempts` on all four (mecatui flags configure only its embedded server), reject negative budget and explicitly nonpositive attempts, add no settings-YAML key, keep zero-valued `app.Config` inert, and give `mecatequi` the existing host parity defaults 300s/180s/5/30s for per-attempt/idle/threshold/cooldown. The approved extra-cost limitation is that this is not a task-wide spend budget: distinct model steps may each recover, and engine token ceilings are checked at turn boundaries rather than between wrapper retries. Existing shorter auxiliary-check deadlines (30s) and guardrail-down policy remain effective without bypass; scheduled fires retain their dominant 30m wall timeout and `StopTimeout` record. |
There was a problem hiding this comment.
One more on the defaults. For providers where we know the TTL, Anthropic being the clear one, I think we should warn at startup when recovery is enabled and the cache TTL is 5m. That's the default, i.e. --anthropic-cache-ttl unset or 5m.
With the TTL cap suggested on AC4.1, 5m leaves very little room. Breaker cooldown, backoff, and a typical 429 Retry-After can eat most of that before the first retry, so I'd expect most meaningful recoveries to end up failing. Without the cap, they'd succeed but on a cold cache. Either way, the operator should hear about it. Something like: "LLM recovery is enabled but the Anthropic cache TTL is 5m, so most recoveries will stop at the TTL; set --anthropic-cache-ttl 1h for longer recovery." The choose-models troubleshooting page this PR already updates seems like the right place to document the pairing too.
There was a problem hiding this comment.
Agreed that choose-models is the right place to explain the pairing. The amendment makes that an explicit documentation requirement, including the cost trade-off: Anthropic's 1h cache has a higher write price than 5m, so it shouldn't be presented as a free upgrade.
For this increment we're leaving out a cache-specific startup warning. A 5m TTL with a longer recovery budget is an intentional availability/cost choice, and without a TTL cap the run won't stop just because those five minutes passed. We also don't have measurements supporting a claim that most recoveries would fail under that cap.
The docs will explain that recovery can outlast retention, later requests may incur cache-write/input charges, and operators can choose a longer cache TTL or lower recovery limits according to their priorities. No automatic TTL changes or new flags. The plan edit is still local, pending publication.
There was a problem hiding this comment.
Agree on dropping the cap-based warning; my "most recoveries will fail" claim depended on the cap. Fine with the choose-models docs covering the pairing. One small, non-blocking ask for #1920 or a follow-up: since the cost lands on users who may not know about caching, could the recovered-outcome log from AC7.1 include the cache-write tokens the provider reports on the recovered call? That makes the cost visible from real usage without predicting expiry. Happy to leave it to a follow-up if it's out of scope here.
There was a problem hiding this comment.
Tracked separately in #2096. Agreed that provider-reported usage is the right signal; no expiry prediction needed.
The follow-up calls out the timing detail: recovery can be reported before terminal usage arrives, so we need to distinguish unavailable usage from a reported zero and attribute the value to the recovered attempt rather than the accumulated discarded attempts. Keeping it non-blocking for this recovery change.
Record human-approved recovery policy and stacked implementation authorization. Co-Authored-By: OpenAI <[email protected]>
1715638 to
86bc3c3
Compare
Co-authored-by: Mecatl <[email protected]>
Co-authored-by: Mecatl <[email protected]>
Co-authored-by: Mecatl <[email protected]>
Stage: Plan / Interface
Defines server/runtime-owned live-run recovery for transient precommit provider failures: provider Retry-After, circuit-breaker cooldown and exclusive half-open admission, non-sliding budgets, parent/direct-write-child safety, four-host configuration, and removal of the TUI's duplicate automatic terminal retry.
Contract:
docs/acceptance/server-provider-recovery.mdApproved amendment:
5899658b7ec278eee9ab4e9cdbe2e9f64815db55Current plan after the main refresh:
2b19354ad779982ac87decc8c06feaf019b7a0a9Pre-amendment plan:
86bc3c350a34b98be5c7ff586c62a40b844df58eOriginal approved plan:
13a055fef4b4fbd57b239f488c9659a866bbddb6Human-approved scope
The directing human approved this narrow amendment and explicitly authorized its commit/push on 2026-10-05. Implementation #1920 was previously authorized to stack before plan merge. Neither PR will be merged by the agent.
Integration prerequisites and implementation handoff
#1920 must integrate and revalidate against this amendment before claiming conformance. The following inherited defects require separately scoped prerequisite fixes:
Opening follow-up issues alone does not satisfy these requirements. Feature-local obsolete retry helpers, redundant configuration, and stale documentation remain cleanup work in #1920. Partial raw-provider usage recovery, cache-aware cost controls, and contextual-review retry ownership are outside this amendment.
Verification of this amendment
task docs: passed.git diff --check: passed.The inherited fixes are separately reviewable in #2097 (accounting) and #2098 (provider error display), and their code is integrated into #1920. The implementation must still pass final aggregate verification; the plan's documentation checks are not runtime acceptance evidence.
Alejandro accepted the cache-policy decision and submitted an approval. The remaining non-blocking cache-write usage logging request is tracked separately in #2096.