feat(coding-agent): report prompt disposition in RPC responses

Successful RPC prompt, steer, and follow_up responses include
data.disposition ("handled", "queued", or "started" for prompt), so clients
know whether to wait for agent_settled.

fixes #9098
This commit is contained in:
David Brailovsky 2026-09-25 14:51:52 +02:00
parent b3487650f6
commit e473b5cd8b
11 changed files with 335 additions and 188 deletions

View file

@ -61,9 +61,11 @@ A successful `prompt` response means the prompt was accepted, queued, or handled
```json
{"id":"req-2","type":"prompt","message":"Review this repository"}
{"id":"req-2","type":"response","command":"prompt","success":true}
{"id":"req-2","type":"response","command":"prompt","success":true,"data":{"disposition":"started"}}
```
`data.disposition` reports what happened to the prompt. If it is `"handled"`, no run started for this prompt, so don't wait for `agent_settled`. See [RPC Commands](rpc-commands.md#prompt) for all values.
Continue consuming [events](json.md) after that response. `agent_end` marks the end of one low-level agent run, but retries, overflow recovery, compaction, steering, or follow-up work can still follow. Wait for `agent_settled` when the client needs to know Pi will not continue automatically.
Subscribe before sending a prompt to avoid missing a fast completion. `RpcClient.promptAndWait()` does this internally. If using separate `RpcClient` calls, install the event listener before `prompt()` and call `waitForIdle()` only while a run is active.