Repository navigation
provider limits: visible parks, delegate-child fail-fast, cap ends the run - #4
Merged
IEatCodeDaily merged 2 commits intoNov 15, 2026
Conversation
Raisal limit-handling policy (extends the probe-park backstop): visible exactly-once park/resume notices; cap expiry fails the run; delegate children (delegation marker or gateway-stamped t3_delegated) fail fast with a structured provider/model/kind/reset_at error; T3 detection via the relay's thread-bound MCP credential and the frozen launch config; structured 9router limit fields pass through error_context.
…red fields in the test expectation
IEatCodeDaily
merged commit Nov 15, 2026
5275184
into
fix/provider-reset-probe-park
1 of 3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends #2 (provider-reset probe-park) with Raisal's explicit limit-handling policy. Base is the #2 branch — this diff shows only the new work; GitHub retargets when #2 merges.
Policy (2026-11-12, via Terminus chief of staff)
1. Top-level parks are visible. First park of an episode emits exactly one warning:
Stuck on provider limit: <provider>/<model>, resets ~HH:MM WIB; auto-retrying every 5 min. Recovery emits exactly oneResumed at HH:MM after N min parked(hooked on the turn loop's success path). Episode state lives onTurnRetryState.provider_limit_episode— probe parks within an episode never re-announce. ~300s + jitter probe and the 6h total cap unchanged.2. Cap expiry fails the run. Was: fall through to ordinary retries (looping). Now: terminal verdict
provider_limit_wait_capwith provider/model/next-reset in the error.3. Delegate children never park. In-process delegate_task children (delegation marker) and T3 ACP sessions stamped
t3_delegatedfail immediately with one structured line:provider_limit: provider=… model=… kind=… reset_at=… [scope=… limit_code=…]so delegate_task surfaces it to the parent thread and the parent agent decides (retry later / switch model / take over).4. T3 child detection. The ACP relay reads its own thread through the thread-bound MCP credential (
acp-mcp-call t3_thread_read) and passest3_delegatedonsession.createwhenrelationshipToParent == 'subagent'. The mark rides the frozen launch config (sameconfig_jsonmarks pattern asdesktop_local) and is re-stamped on cached agents every turn. Detection failure fails open to the visible top-level park. NewCanonicalCreateParams.t3_delegatedcontract field.5. Structured limit info. 9router's upcoming
code+reset_at+scopebody fields pass througherror_context(_structured_limit_context);reset_atalready flows the existing_RESET_FIELDSbody scan. The current text grammar already parsesreset after Xh Ym; a response with no reset info remains an ordinary error (no park, no special casing).Tests
Focused regressions extended in
tests/agent/test_provider_reset_wait.py: cap expiry terminal verdict, both child fail-fast paths (delegation marker + gateway-stamped attr, structured error contents, zero sleeps), exactly-once park + resume notices, structured passthrough. Gate: branch-only workflowprovider-limit-park-policy.yml(same focused set as the #2 lane). Local verification: py_compile all touched files + a plain-python logic smoke (grammar, passthrough, notice-once, resume-once, child predicate).