feat(features,web): an agent reads as its own page by its id, on a plan or with none

Merged
DA
4d ago
+436-30

Step 7 of the automations plan (docs/proposals/automations-scope.md). It is stacked on #2688 (account Inbox carries planless items).

What changes

  • GET /api/agents/{id} reads one agent as its own page.
    • It answers { agent: CodingAgentPage } for any agent the account reaches through its workspace, an agent an automation started with no plan as much as one on a plan.
    • The page is the summary the tabs draw, plus planId (null for a planless agent), automationId, workspaceId, and repository.
    • This is what the desktop agent page (step 8) will read.
    • The path already rewrote to agents/agent (the PATCH), so GET joins it and the rewrite table doesn't change.
  • Planless agents get a page schema, not a nullable planId on the existing summary. The proposal said "optional planId". About 28 places in the desktop read a summary's planId and rely on it, and every existing route, list, and old build expects a plan there. So codingAgentSummarySchema stays exactly as it is, and codingAgentPageSchema carries the nullable plan for the one read that can answer a planless agent. Planless agents stay out of every summary-answering route (reachedAgent refuses them, as #2663 made it), and a new reachedAnyAgent admits them for the page.
  • status.ts builds the summary and the page from one set of fields, so the two can't drift. The summary's key order is unchanged.
  • Wire goldens. codingAgentPageSchema and codingAgentPageAnswerSchema are new, recorded with LUKE_UPDATE_FIXTURES=1. No existing golden changes.

The proposal also listed a planless list for an automation's runs. An automation's run already names its agent (codingAgentId on GET /api/automations/{id}/runs), and the page reads that agent by id, so no second list is needed; step 11's runs panel uses the two together.

Tests

  • coding-agents-app.test.ts: an agent reads as its page by id, first on its plan (plan, workspace, and repository named) and then, once left planless as an automation's run leaves one, with planId and automationId null, its workspace, and its status. An account outside the workspace reads 404. This fails without the change (GET was method-not-allowed).

pnpm check:affected passes. This change is server and wire only; CI cannot verify the Mac UI, and ./scripts/verify.sh was not run (LUKE-159 stands in before the first release).

šŸ¤– Generated with Claude Code


Open workspace in Conductor


Devin Review


Summary by cubic

Adds GET /api/agents/{id} so an agent reads as its own page, whether it works on a plan or has none.

  • GET joins PATCH on the existing agent rewrite and answers { agent: CodingAgentPage }: the summary fields plus planId (nullable), automationId, workspaceId, and repository.
  • Planless agents stay out of every summary-answering route; a new reachedAnyAgent admits them to the page route, while reachedAgent keeps refusing them.
  • status.ts builds the summary and the page from one shared set of fields so they can't drift.
  • Adds codingAgentPageSchema and codingAgentPageAnswerSchema wire schemas and goldens, with no existing golden changes.