feat(sessions): pass relaygate group labels through to the dashboard

Merged
KH
5d ago
+70-0

What

relaygate's new groupLabels policy (AgentWorkforce/relaygate#39) adds relaygate: {"gid": 22, "label": "pit"} to each readable session a labeled group owns, on the session list and on one session's metadata/catalog.

  • GET .../sessions (list): sessionItem already spreads upstream items, so the field reaches the dashboard unchanged. Now covered by a test.
  • GET .../sessions/:id/catalog: the route rebuilds its body and dropped the field. It now passes relaygate through, keeping only gid (non-negative safe integer) and label (relaygate's charset, <=24 chars); anything else, or a malformed value, is dropped.
  • openapi: RelaygateGroupLabel schema on DashboardSessionCatalog. CHANGELOG entry.

No behaviour change when the read API is not relaygate or no label is configured.

Tests

npm run typecheck; node --import tsx --test test/sessions.test.ts (45 pass, incl. new "relaygate group labels reach the dashboard..."); openapi doc tests.

Consumer: relay-web badge PR (follows).

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Passes relaygate's owning-group labels through to the dashboard so the session catalog now shows them alongside the session list.

  • The catalog route previously rebuilt its response body and dropped the relaygate field; it now passes it through, keeping only gid (non-negative safe integer) and label (relaygate's charset, up to 24 chars). Malformed values are dropped.
  • Adds the RelaygateGroupLabel schema to the OpenAPI spec, a CHANGELOG entry, and test coverage for both routes.
  • No behavior change when the read API is not relaygate or no label is configured.