Repository navigation
Conversation
The hosted package adapter accepts both the current legacy access shape and the frozen member shape. Reject mixed or malformed member lists before MCP dispatch with a generic internal error, and preserve explicit inactive status. The current producer omits revoked children, so those selectors keep B1’s unknown-grant response. Restore package guidance for field navigation, document versus canonical-record reads, bounded previews, query metadata, source handles, search modes, paging, and aggregate truncation. Re-enable the real hosted package flows and verify a complete current-producer client replay. Assisted-by: AI Signed-off-by: Tim Nunamaker <tnunamak@gmail.com>
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.
With a package token (one token covering several child grants), a model has to name a child with
grant_idon every data tool, but nothing lets it learn the valid values or notice that a child has ended. This adds both, as the MCP profile (§3) requires.For package tokens only, the server now offers a no-argument tool,
list_package_children. For each child it returns thegrant_id, public source metadata, purpose, streams with the client's own instance handles, access mode andactive. Inactive children are listed withactive: false. It returns no records, counts, tokens, private bindings or internal subject. When a call names a child that belongs to the package but has ended, the tool result isisError: truewithstructuredContent.error = {code: "package_child_inactive", grant_id}and the text "Access to grant has ended. Do not retry this call. Ask the owner if this access is needed again." It is never an HTTP 401 or 403 and never switches to another child. An unknowngrant_idkeeps the earlier selector error, and a package whose last child ended is a token-level401 invalid_token. A downstream403 grant_invalid(for example a lost instance mapping) affects only that child.The hosted adapter reads the package members from
getGrantPackageAccess. Today that function returns members with noactivefield and drops ended children; the identity work will change it to return every member with a booleanactive. The adapter accepts both shapes and rejects anything ambiguous before dispatch: a mix of the two, conflicting access modes, anactivethat is not a boolean, a missing or duplicategrant_id. Those cases return a generic 500 and neither return nor log member data.Landing order: merge this with, or before, the
grant_idPR (#382). That PR makesgrant_idrequired for package tokens, and a client then needs this tool to find a valid value. What an existing session sees after this merge: a session on an ordinary client token sees no change. A package-token session sees the extralist_package_childrentool andgrant_idon each data tool intools/list, and calls the discovery tool first. Production sessions run on the current member shape, so the five real-flow hosted package tests run against that producer, not a stub.Tests: the discovery output whitelist, the inactive-child result over HTTP 200, the 401 when no child is active, sibling isolation, the malformed-member rejections (each fails when the validation is made permissive), and a full replay on a real minted package:
tools/list,list_package_children, schema, search, fetch,query_records. Hosted OAuth passes 134 with none skipped; the packagetools/listis 23,712 of 24,576 bytes, with 864 left; the client list is unchanged. An independent review by a different model ran three rounds; it caught that the first version returned401to every current package session, which is fixed. Not verified: a few descriptions are shorter than the base to fit the size limit (schema-first hints, raw per-field schemas, metadata handles in fetch); the vendortool-footprinttest still fails on a missing operator document. This PR is stacked on #385.Assisted-by: AI