Repository navigation
fix(core): non-finite reset guards and docstring sweep (#1447) - #1514
Merged
Merged
Conversation
…on_used divides (#1447) retry_after() and parse_retry_after() return None for inf, -inf, nan and 1e400 instead of inf or 0.0. Window.fraction_used clamps remaining into [0, limit] before dividing, so a header too large for a float no longer raises OverflowError. Part of #1447 Co-authored-by: Cursor <cursoragent@cursor.com>
- Cite ADR 0017 for the ungoverned-binding guard (ADR 0013 is superseded). - Remove the dead ToolSet._check_approvals and its vulture entry; describe() already refuses an unmatched require_approval() name. - Discovery.resolve()/live_tools()/agent_card(): nothing is cached there, but the registry's lookups are. - PublicationAssetType records agent as well as mcp; ConfigWarning names every emitter; warm() and search(governed=) say the reads are answered and the index is what is not built. Part of #1447 Co-authored-by: Cursor <cursoragent@cursor.com>
5 of 7 tasks
5 of 7 tasks
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.
Part of #1447
#1447 is split across four PRs. #1510 carries
Closes #1447and the full item table, so merge it last:chore/1447-adk-bridged-classes, not yet opened)Summary
parse_retry_after()andretry_after()returnNonefor a value that parses as a float but isn't finite (inf,-inf,nan,1e400), on bothRetry-Afterand thex-token-reset/x-ratelimit-resetfallback. Before,Retry-After: nanreached the transport's retry sleep as NaN, andtime.sleep/asyncio.sleepboth reject that withValueError.infwas capped at the 30 s ceiling. Both now fall through to the jittered backoff, as an HTTP-date value already did.Window.fraction_used(fix):remainingis clamped into[0, limit]before the division, so a header too large for a float can't overflow it. The result is unchanged for every in-range value.UngovernedMcpServer/ governance-default citations insession.py,mcp.py,discovery.py,publication.py,models.pyanddonkey.pynow cite ADR 0017, which superseded ADR 0013 (tools: decide how discover() and binding treat MCP servers the gateway does not front #1150).donkey.pykeeps one "ADR 0013, rules kept by ADR 0017" where the history matters.session.py: removed the dead_check_approvals(), sincedescribe()already refuses arequire_approval()name that matches no tool. The_bind_tooldocstring says so. Its vulture entry is gone, and the two tests that called it nowawait tools.describe().resolve(),live_tools()andagent_card()no longer say "no cache". Nothing is cached in discovery itself, but the registry's lookups are, forregistry_cache_ttl_s, andrefresh()drops them.PublicationAssetType: the docstring now covers what Exchange records formcpandagent, thata2a-agentisn't an Exchange type, and thatapimeans REST/HTTP/SOAP.ExchangeRegistry.warm()/search(governed=)wording: these reads are answered (feat(tools): donkey.tools.warm() to pre-fill the discovery cache #1324). What isn't built is the environment-wide governed-state index, anddonkey.tools.warm()pre-fills discovery instead. API Manager has no bulk policy read (§6, Verify whether applied policies can be fetched in bulk per environment #54). The_verify.blockedguard stays, because acceptance group 5 asserts it.ConfigWarning: the docstring lists every case that raises it: a misplaced config entry, an env switch that relaxes a check, a non-loopbackserve()host, and await_for_gateway_approval()over 2 minutes. It's kept to two lines socore/errors.pystays within its 1030-line budget (test_oversized_core_modules_only_shrink).Test plan
nox -s typecheck-and-lint test-3.11 new-dependencies commit-identities(passed, after rebasing one7859253)test_errors.py:inf,-inf,nanand1e400onretry-afterand onx-token-resetall giveretry_after is None, andparse_retry_after()returnsNonefor each.test_budget.py::test_fraction_used_clamps_before_it_dividestest_toolset_approval.py: the two former_check_approvals()tests run throughdescribe(). The rebase on feat(hitl)!: settle the Approvals API: per-client registry, typed errors (#1423) #1497 kept itsregistryfixture.nox(every session): not run locally; CI runs itpython scripts/verify_frameworks.py: n/a, no adapters or extras changedADR needed?
Acceptance-harness impact
None. The group 5
warm()test asserts only that it is blocked, which is unchanged, and no acceptance test matches the reworded docstrings or blocked text.Migration note
TokenBudgetExceeded.retry_after,RequestRateLimitExceeded.retry_afterandGatewayApprovalPending.retry_afterareNone, notinf/nan, when the gateway sends a non-finite reset. Code that already handlesNoneneeds no change. The privateToolSet._check_approvals()is removed;describe()does the same check.Post-deploy steps
None.