Repository navigation
fix(core): name the failing field in invalid extension config errors - #695
Merged
Merged
Conversation
An extension config that failed its registration's schema reported only 'Invalid extension configuration: <name>'. Reuse core's schema error formatting: the message now gives the JSON pointer under /extensions/<name>/config, the failed Ajv keyword and a schema-derived reason (with did-you-mean for unknown keys), never the rejected value. explain_error gains an extension-config rule that decodes the location and points at get_extensions. Fixes #693 Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
pushed a commit
that referenced
this pull request
Sep 25, 2026
…errors (#702, #696) When a oneOf/anyOf matched no branch, schema errors reported Ajv's first branch failure, so `auth: {freshWithinSeconds: 0}` said `auth` must be `true`. Report the deepest branch failure instead, preferring a real check over a bare type/const mismatch; a oneOf that matched several branches is still reported as itself. Applies to core and extension configuration. Extension route policies that fail the policy schema now report the pointer under /routes/<route>/policies/extensions/<name>, the keyword and a schema-derived reason, never the value, like extension config (#695). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
4 tasks done
jimhoyd
added a commit
that referenced
this pull request
Sep 25, 2026
…sion RateLimit policies (#702, #696, #701) (#720) * refactor(ui): import core extension contract types instead of copying them (#709) packages/ui/src/host/extension.ts kept hand-maintained structural copies of core's extension contract, which had already drifted: its ExtensionRequest lacked core's requestId and env. Import HandlerResult, ExtensionActivation, ExtensionRequest, ExtensionInstance, ExtensionImmutableAssets, ExtensionAuthoringSurface, ExtensionAuthoringContract and RuntimeExtension from @jimhoyd/urlcode/extensions (already the package's peer) and re-export them so ./host's public types are unchanged in name. HeaderPair and TargetName are not exported by that entry point, so derive them from HandlerResult and RuntimeExtension rather than widening core's surface. loadDocument is not exported from @jimhoyd/urlcode/extensions, so the store-screens path keeps importing it from the core root; the screens / storeCollections() design is untouched pending a maintainer decision. The ui test request fixtures now supply requestId and env, which the real ExtensionRequest requires. CONTRACT.md no longer describes the types as a structural copy. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP * fix(core): throttle appends its RateLimit policy instead of replacing an extension's (#701) RateLimit and RateLimit-Policy are structured-field lists of named policies. Throttle's response phase used to drop every existing field of those names and add its own "default" member, so the auth extension's per-credential 429 reported throttle's budget instead of the exhausted "credential" one. It now folds prior field lines into one comma-joined list, drops only a member already named "default" (its own), and appends its member. Retry-After and the other headers are unchanged; throttle alone still emits one field each. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP * fix(core): name the failing field in route auth and extension policy errors (#702, #696) When a oneOf/anyOf matched no branch, schema errors reported Ajv's first branch failure, so `auth: {freshWithinSeconds: 0}` said `auth` must be `true`. Report the deepest branch failure instead, preferring a real check over a bare type/const mismatch; a oneOf that matched several branches is still reported as itself. Applies to core and extension configuration. Extension route policies that fail the policy schema now report the pointer under /routes/<route>/policies/extensions/<name>, the keyword and a schema-derived reason, never the value, like extension config (#695). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP * test(auth): expect the named quota field in route auth errors; update ui status (#702, #709) The auth handler test pinned the pre-#702 message (the union's const branch at /auth); it now asserts the pointer and location name the bearer quota field. The ui status note no longer describes the ./host contract types as structural copies. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP --------- Co-authored-by: Claude <[email protected]>
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.
Fixes #693
What changed
prepareExtensions(packages/core/src/extensions.ts) no longer discards Ajv errors. It compiles the registration schema withverbose: trueand throwsextensionConfigError(packages/core/src/config.ts). That function reuses core'sdescribeSchemaError, so the message has the same form as a core schema error:Invalid extension configuration at /extensions/mcp/config/servers/default/tools/tool/annotations (additionalProperties): unknown key "cachedHint"; allowed keys: readOnlyHint, destructiveHint, idempotentHint, openWorldHint (run urlcode extensions --json for its configuration schema)details.pointer.explain_errorhas a newextension-configrule, placed before the genericschemarule. It decodeslocationfrom the new message and suggestsget_extensionsthenvalidate, both canonical tool names.Not changed
Invalid extension policy: <name> at <route>still does not name the failing policy field. The same approach would fix it.ajv.errorsText. It was left alone because another change to that file is in progress.Evidence (local, macOS, Node 26.8.2)
npm run verifyexit 0 (root suite 799/799 plus all workspace suites)npm run test:packageexit 0🤖 Generated with Claude Code