Skip to content

feat(registry): ?source=registered|discovered query param on /api/registry/agents#3563

Merged
bokelley merged 4 commits into
mainfrom
EmmaLouise2018/registry-source-query-param
May 1, 2026
Merged

feat(registry): ?source=registered|discovered query param on /api/registry/agents#3563
bokelley merged 4 commits into
mainfrom
EmmaLouise2018/registry-source-query-param

Conversation

@EmmaLouise2018

Copy link
Copy Markdown
Contributor

Refs #3538 Problem 3 P1.

/api/registry/agents returns registered (AAO-attested, opt-in) and discovered (crawled from adagents.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 the source field as the discriminator.

Adds optional ?source=registered|discovered query param. Default behavior unchanged.

What changed

  • server/src/routes/registry-api.ts:552listAgents request schema gains optional source enum field with .openapi({ description }).
  • server/src/routes/registry-api.ts:3557 — handler validates source, returns 400 on invalid value, filters response by source before enrichment if the param is present.
  • static/openapi/registry.yamlnpm run build:openapi output for the schema change (separate commit; minimized to the new source parameter + 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.
  • Pre-commit hooks green on both commits.

Stack ordering

Independent of #3540, #3541, #3543. Light overlap with #3542 (both touch registry-api.ts and registry.yaml); rebase on whichever lands first.

Out of scope

…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.

@bokelley bokelley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed as part of registry-stack triage session (refs #3538). Scope is tight, tests cover behavior, changesets present, openapi regen is mechanical. Approving.

@bokelley bokelley merged commit 2fb6e34 into main May 1, 2026
13 checks passed
@bokelley bokelley deleted the EmmaLouise2018/registry-source-query-param branch May 1, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants