docs: fix Task 12 Round 1 accuracy findings
- Fix POST /api/run param: change 'prompt' to 'initialPrompt' (Finding 1)
- Fix POST /api/run response shape: show actual fields from publicRun() (Finding 2)
- Delete stale 'Running and releasing lanes' section with old POST /api/lanes/:id/start (Finding 3)
- Delete stale POST /api/lanes/:id/message section — endpoint now returns 400 EUNSUPPORTED (Finding 4)
All changes verified against actual code:
- server/routes/run.js:285 uses body.initialPrompt
- server/lib/pty-run.js:144-156 publicRun() returns {id, laneId, status, cwd, model, ...}
- server/routes/lanes.js:1134 message action returns 400 error
This commit is contained in:
+2
-30
@@ -375,24 +375,6 @@ three times, and the lane list is polled and re-broadcast on every hook-driven
|
||||
tool call an agent makes. The browser fetches it per card instead, on mount and
|
||||
every 30 seconds, and a failed fetch is silent.
|
||||
|
||||
### Running and releasing lanes
|
||||
|
||||
The Workspace page starts runs through `POST /api/lanes/:id/start`, which accepts the same `mode` and `effort` parameters as `POST /api/run`:
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:4820/api/lanes/5/start \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"mode": "conversation", "effort": "medium"}'
|
||||
```
|
||||
|
||||
**A finished run releases its lane.** When a spawned Claude Code process exits (normally, non-zero, killed, or never spawned), the lane's `run_id` is cleared, its `status` returns to `idle`, and the change is broadcast as a `lane_update` WebSocket message. This prevents lanes from sitting at `running` with a dead child.
|
||||
|
||||
Runs started through a lane are recorded with the lane's id and are history-queryable:
|
||||
|
||||
```bash
|
||||
curl http://localhost:4820/api/run/history?laneId=5
|
||||
```
|
||||
|
||||
## Viewing lanes
|
||||
|
||||
List all lanes with their current status:
|
||||
@@ -940,23 +922,13 @@ Start a tmux-backed run attached to the lane. The Workspace page's "Start Run" b
|
||||
```bash
|
||||
curl -X POST http://localhost:4820/api/run \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"laneId": 5, "prompt": "continue the work"}'
|
||||
-d '{"laneId": 5, "initialPrompt": "continue the work"}'
|
||||
```
|
||||
|
||||
The `prompt` field is optional — if omitted, the tmux session is created/attached with no initial input, and you type into the terminal directly. Returns `{ runId, tmuxSessionName, cwd, ... }`. The same tmux session persists across attach/detach cycles, so you can switch between the browser Workspace and `ccam lanes shell` seamlessly.
|
||||
The `initialPrompt` field is optional — if omitted, the tmux session is created/attached with no initial input, and you type into the terminal directly. Returns `{ id, laneId, status, cwd, model, permissionMode, effort, resumeSessionId, sessionId, startedAt, promptPreview }` where `id` is the tmux session name. The same tmux session persists across attach/detach cycles, so you can switch between the browser Workspace and `ccam lanes shell` seamlessly.
|
||||
|
||||
**A killed run releases the lane.** When the tmux session is terminated (from the terminal, browser stop button, or external `kill`), the lane's `run_id` is cleared, its status returns to `idle`, and the change is broadcast as `lane_update`. Runs are recorded with the lane's id and are listable via `GET /api/run/history?laneId=<n>`.
|
||||
|
||||
### message
|
||||
|
||||
Send input to a running session. The lane must have a live `run_id` (active session). The `needs_action` flag clears automatically when the message is delivered.
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:4820/api/lanes/5/message \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"text": "approved, proceed"}'
|
||||
```
|
||||
|
||||
### stop
|
||||
|
||||
Terminate the running session. If the lane has no live run, this is a no-op (no error).
|
||||
|
||||
Reference in New Issue
Block a user