diff --git a/server/src/__tests__/openapi-routes.test.ts b/server/src/__tests__/openapi-routes.test.ts index 1592f802ba9..46ccf86ebe2 100644 --- a/server/src/__tests__/openapi-routes.test.ts +++ b/server/src/__tests__/openapi-routes.test.ts @@ -502,6 +502,18 @@ describe("openapi routes", () => { for (const code of ["200", "400", "401", "403", "404"]) expect(operation.responses[code]).toBeDefined(); }); + it.each([ + ["get", "/api/agents/{id}/runtime-state"], + ["post", "/api/agents/{id}/runtime-state/reset-session"], + ["get", "/api/agents/{id}/task-sessions"], + ])("documents %s %s as board-only", (method, path) => { + const spec = buildOpenApiSpec() as any; + const operation = spec.paths[path][method]; + expect(operation.security).toEqual([{ BoardSessionAuth: [] }, { BoardApiKeyAuth: [] }]); + expect(operation["x-paperclip-authorization"]).toEqual({ actor: "board" }); + expect(operation.responses["403"]).toBeDefined(); + }); + it("documents task-tree controls as board-only and names the human page", () => { const spec = buildOpenApiSpec() as any; const boardSecurity = [{ BoardSessionAuth: [] }, { BoardApiKeyAuth: [] }]; diff --git a/server/src/routes/openapi.ts b/server/src/routes/openapi.ts index fb19671e80c..be80e892eda 100644 --- a/server/src/routes/openapi.ts +++ b/server/src/routes/openapi.ts @@ -1489,6 +1489,9 @@ const BOARD_ONLY_OPERATIONS = new Set([ "POST /api/companies/{companyId}/chats/{agentRef}/onboarding", "POST /api/companies/{companyId}/chats/{agentRef}/onboarding/greeting", "PATCH /api/agents/{id}/permission-grants", + "GET /api/agents/{id}/runtime-state", + "POST /api/agents/{id}/runtime-state/reset-session", + "GET /api/agents/{id}/task-sessions", // Budget changes are board-only (assertBoard in routes/costs.ts). "POST /api/companies/{companyId}/budgets/policies", "POST /api/companies/{companyId}/budget-incidents/{incidentId}/resolve",