feat(registry): ?source=registered|discovered query param on /api/registry/agents#3563
Merged
Merged
Conversation
…istry/agents Optional filter on /api/registry/agents that narrows the response to one trust level. Default behavior (no param) returns the merged list, exact same contract as before. Refs #3538.
Mechanical `npm run build:openapi` output for the schema change in the prior commit. Limited to the new `source` query param + 400 response on /api/registry/agents (other regen drift from earlier merges is deliberately not included).
…registered Locks in that source=X returning 0 rows still returns 200 with an empty agents array — guards against a future regression where a narrowing filter falls back to the unfiltered list. Brings coverage to 6/6.
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.
Refs #3538 Problem 3 P1.
/api/registry/agentsreturns registered (AAO-attested, opt-in) and discovered (crawled fromadagents.json, no opt-in) agents in one merged list. Consumers that want one trust level have to filter client-side. Server can do this — schema annotations from #3542 already document thesourcefield as the discriminator.Adds optional
?source=registered|discoveredquery param. Default behavior unchanged.What changed
server/src/routes/registry-api.ts:552—listAgentsrequest schema gains optionalsourceenum field with.openapi({ description }).server/src/routes/registry-api.ts:3557— handler validatessource, returns 400 on invalid value, filters response bysourcebefore enrichment if the param is present.static/openapi/registry.yaml—npm run build:openapioutput for the schema change (separate commit; minimized to the newsourceparameter + 400 response — earlier-merged drift not pulled in).server/tests/unit/registry-agents-source-filter.test.ts— 5/5 pass.Behavior change: none on default path
Omit the param → exact same merged response as today. Only consumers passing
source=see new behavior. Strictly additive.Test plan
npx vitest run server/tests/unit/registry-agents-source-filter.test.ts— 5/5 pass.npx tsc --noEmit -p server/tsconfig.json— clean.Stack ordering
Independent of #3540, #3541, #3543. Light overlap with #3542 (both touch
registry-api.tsandregistry.yaml); rebase on whichever lands first.Out of scope
/registry(Problem 3 P1 step 3) — separate PR.endorsed_by_publisher_memberfield on discovered agents (Problem 6 P1 / decision(registry): how should discovered agents surface member-publisher endorsement (#3538 Problem 6) #3547) — separate PR./api/registry/agentsinto/registeredand/discoveredendpoints (Problem 3 P2) — separate PR.