Problem
In docs/API.md:858-864, the documentation provides a curl example for executing an AI run via POST /api/runs:
curl -X POST http://localhost:5555/api/runs \
-H "Content-Type: application/json" \
-d '{
"prompt": "List all files in the current directory",
"workspacePath": "/path/to/workspace"
}'
However, server/lib/aiToolkit/routes/runs.js:34-36 enforces:
if (!providerId) {
throw new ServerError('providerId is required', { status: 400 });
}
Because providerId is omitted in the documentation snippet, the request is rejected immediately.
Trigger
A developer or API consumer copying the example request directly from docs/API.md and pasting it into a terminal against a running PortOS instance.
Impact
The server responds with HTTP 400 ({"error": "providerId is required", ...}). A developer following the documentation cannot successfully execute an AI run via curl without reading server route source code to diagnose the missing parameter.
Fix
- Update
docs/API.md lines 858-864 to include "providerId": "claude" (or <provider-id>) in the JSON payload.
- Ensure the curl snippet documents the standard minimal fields (
providerId, prompt, workspacePath).
- Verify that
server/lib/aiToolkit/routes/runs.test.js covers route validation for this shape.
Alternative rejected: Making providerId optional with a fallback default in routes/runs.js — rejected because provider selection must remain explicit across multi-provider environments to avoid unintended token/quota expenditure.
Acceptance Criteria
Problem
In
docs/API.md:858-864, the documentation provides a curl example for executing an AI run viaPOST /api/runs:However,
server/lib/aiToolkit/routes/runs.js:34-36enforces:Because
providerIdis omitted in the documentation snippet, the request is rejected immediately.Trigger
A developer or API consumer copying the example request directly from
docs/API.mdand pasting it into a terminal against a running PortOS instance.Impact
The server responds with HTTP 400 (
{"error": "providerId is required", ...}). A developer following the documentation cannot successfully execute an AI run via curl without reading server route source code to diagnose the missing parameter.Fix
docs/API.mdlines 858-864 to include"providerId": "claude"(or<provider-id>) in the JSON payload.providerId,prompt,workspacePath).server/lib/aiToolkit/routes/runs.test.jscovers route validation for this shape.Alternative rejected: Making
providerIdoptional with a fallback default inroutes/runs.js— rejected because provider selection must remain explicit across multi-provider environments to avoid unintended token/quota expenditure.Acceptance Criteria
docs/API.mdexample forPOST /api/runsincludesproviderIdin its request body.server/lib/aiToolkit/routes/runs.test.jspasses.