Skip to content

feat(service-ai): access-aware agent catalog so the UI hides agents you can't chat#2320

Merged
os-zhuang merged 1 commit into
mainfrom
feat/ai-seat-catalog-filter
Jun 25, 2026
Merged

feat(service-ai): access-aware agent catalog so the UI hides agents you can't chat#2320
os-zhuang merged 1 commit into
mainfrom
feat/ai-seat-catalog-filter

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

GET /api/v1/ai/agents (and listAgents) returned every active agent regardless of the caller's per-agent access (permissions/access). The console keys its "Build with AI" / "Ask AI" surfaces off this catalog, so a user without the required permission still saw the buttons and only hit a 403 on click (dead-end UX) — notably with the per-user AI-seat gate (ADR-0068), where build/ask carry permissions:['ai_seat'].

listAgents now takes an optional caller context and, when present, drops agents the caller can't access (the same evaluateAgentAccess the chat route enforces, ADR-0049). The list route passes req.user. No caller → unfiltered (internal default-agent resolution unchanged). Ungated agents (no permissions) stay visible to everyone → no-op until an agent is actually gated.

Net effect: the existing frontend "no build/ask in catalog → no AI surface" logic now hides AI for seat-less users with ZERO objectui code changes.

+5 unit tests; service-ai suite green (408). Part of the per-user AI-seat gate (ADR-0068).

🤖 Generated with Claude Code

…ou can't chat

GET /api/v1/ai/agents (and listAgents) returned EVERY active agent regardless of
the caller's per-agent access (`permissions`/`access`). The console keys its
"Build with AI" / "Ask AI" surfaces off this catalog, so a user without the
required permission still saw the buttons and only hit a 403 on click (dead-end
UX) — notably with the per-user AI-seat gate (ADR-0068), where build/ask carry
`permissions:['ai_seat']`.

listAgents now takes an optional caller context and, when present, drops agents
the caller can't access (same evaluateAgentAccess the chat route enforces, ADR-
0049). The list route passes req.user. No caller (internal default-agent
resolution) → unfiltered, so existing behavior is unchanged. Ungated agents (no
`permissions`) stay visible to everyone, so this is a no-op until an agent is
actually gated — e.g. the AI-seat kill-switch is off.

Net effect: the existing frontend "no build/ask in catalog → no AI surface"
logic now hides AI for seat-less users with ZERO objectui changes; the signal is
the catalog itself.

+5 unit tests (no-caller unfiltered / seat-less hidden / seated-by-permission /
seated-by-role / ungated-visible). service-ai suite green (408).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 25, 2026 7:47am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): packages/services.

5 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/guides/packages.mdx (via packages/services)
  • content/docs/guides/runtime-services/audit-service.mdx (via packages/services)
  • content/docs/guides/runtime-services/index.mdx (via packages/services)
  • content/docs/guides/runtime-services/settings-service.mdx (via packages/services)
  • content/docs/protocol/objectos/i18n-standard.mdx (via packages/services)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang merged commit 75abedc into main Jun 25, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the feat/ai-seat-catalog-filter branch June 25, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant