fix(mcp-oauth): resilient config resolution + reduce config_source spawn amplification + cache OAuth discovery (TASK-326)#322
Merged
Conversation
…awn amplification + cache OAuth discovery (TASK-326)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
TASK-326: OAuth-bridging robustness
Fixes a failure cascade seen under bulk
animus mcp callbursts:The three changes
(d) Resilient config resolution — a new non-swallowing loader
try_load_workflow_configreturns a distinct three-way outcome (Loaded/NoSource/SourceUnavailable) instead of collapsing every failure into an empty builtin base. Credential/OAuth resolvers route through it, so a transientconfig_sourceoutage surfaces as a distinct retryable "config source unavailable" error rather than silently emptyingmcp_serversand misreporting the server as "not defined". This holds even when--urlis supplied (a--urloverrides only the endpoint, not the oauth flow/block).(c) Reduce
config_sourcespawn amplification — the proxy now trusts the already-resolved--urlpassed by the daemon/CLI contract and skips re-resolving config on connect. This dropsconfig_sourcespawns from 3× → 1× permcp call. The URL is bound into the keychain key (security control retained), so a repointed server still fails closed.(a) Cache OAuth discovery metadata — discovered RFC 8414/9728
.well-knownmetadata is cached per(server, url)under the scoped state root (24h TTL, best-effort, non-secret) so repeated proxy spawns reuse it instead of re-hitting the throttled upstream discovery endpoint on every connect.Unauthenticated-priming gate
Discovery priming is now gated on a stored token existing:
connect_with_storechecks the credential store'sloadfirst and only primes/discovers when a token is present. An unauthenticated server (no stored token) skips the network discovery and takes the normal fast-fail path — restoring fast startup instead of regressing it into a needless.well-knownround-trip. Covered by a newunauthenticated_server_skips_discovery_primingintegration test.Scope
ao-cli only — no plugin/runner pin bumps, no protocol changes.
🤖 Generated with Claude Code