Org agents: no read for an org's agent assignments #1089

Closed
opened 2026-10-27 13:38:58 +00:00 by sam · 0 comments
Owner

Goal

The Org > Agents tab shows which org each agent serves. There is no read endpoint for agent assignments: the State Store org API (internal/domain/org/store.go API interface) deliberately omits ListOrgAgents, and the HTTP surface only has PUT /api/orgs/{id}/agents/{identity}. The dashboard guesses it from the org's member list (a bot/service account with an org-wide membership), which is empty for an agent assigned after boot until EnsureAgentOrgMembership next runs.

Context

  • PUT /api/orgs/{id}/agents/{identity} exists (internal/webui/api_orgs.go handleOrgAgentAssign).
  • ListOrgAgents exists on the Repository but not on API (internal/domain/org/store.go).
  • UI workaround: ui/src/org/OrgAgentsPage.vue derives the badge from GET /api/orgs/{id}/members.

Stop when

[ ] GET /api/orgs/{id}/agents returns the org's assignments, and the Agents tab reads the true assignment instead of inferring it.

Out of scope

Instance-admin widening. Renaming the org.

Close reason

Already implemented in the tree: proto state/v1/org.proto carries ListOrgAgents, staterpc both serves (orgs.go:230) and calls it (orgs_client.go:89), GET /api/orgs/{id}/agents is routed (server.go:391) to handleOrgAgentsList, and OrgAgentsPage reads api.orgAgents() rather than inferring from members. Added the compile-time assertion org.AgentAssignments = (*staterpc.Client)(nil) so the page can no longer degrade to 503 unnoticed.


Imported from beads archie-core-5q04 · GitHub #1495 · type feature · priority P2 · created 2026-10-05 · closed 2026-10-26

## Goal The Org > Agents tab shows which org each agent serves. There is no read endpoint for agent assignments: the State Store org API (internal/domain/org/store.go API interface) deliberately omits ListOrgAgents, and the HTTP surface only has PUT /api/orgs/{id}/agents/{identity}. The dashboard guesses it from the org's member list (a bot/service account with an org-wide membership), which is empty for an agent assigned after boot until EnsureAgentOrgMembership next runs. ## Context - PUT /api/orgs/{id}/agents/{identity} exists (internal/webui/api_orgs.go handleOrgAgentAssign). - ListOrgAgents exists on the Repository but not on API (internal/domain/org/store.go). - UI workaround: ui/src/org/OrgAgentsPage.vue derives the badge from GET /api/orgs/{id}/members. ## Stop when [ ] GET /api/orgs/{id}/agents returns the org's assignments, and the Agents tab reads the true assignment instead of inferring it. ## Out of scope Instance-admin widening. Renaming the org. ### Close reason Already implemented in the tree: proto state/v1/org.proto carries ListOrgAgents, staterpc both serves (orgs.go:230) and calls it (orgs_client.go:89), GET /api/orgs/{id}/agents is routed (server.go:391) to handleOrgAgentsList, and OrgAgentsPage reads api.orgAgents() rather than inferring from members. Added the compile-time assertion org.AgentAssignments = (*staterpc.Client)(nil) so the page can no longer degrade to 503 unnoticed. --- _Imported from beads `archie-core-5q04` · GitHub #1495 · type feature · priority P2 · created 2026-10-05 · closed 2026-10-26_
sam added the mediumfeature labels 2026-10-27 13:38:58 +00:00
sam self-assigned this 2026-10-27 13:38:58 +00:00
sam closed this issue 2026-10-27 13:38:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1089