fix(coding-agent): forward images through steer/followUp during streaming

prompt() computed currentImages but never passed them to _queueSteer()
or _queueFollowUp() in the streaming branch. Both methods only accepted
text and built content as [{ type: 'text', text }], dropping images.

- _queueSteer/_queueFollowUp now accept optional ImageContent[]
- streaming branch in prompt() passes currentImages through
- public steer()/followUp() accept and forward optional images
- RPC types, handler, and client updated for steer/follow_up images
- rpc.md: document images on steer/follow_up, fix ImageContent examples
This commit is contained in:
Aliou Diallo 2026-02-05 02:33:05 +01:00
parent 634899aba0
commit b315abf998
5 changed files with 44 additions and 20 deletions

View file

@ -38,7 +38,7 @@ Send a user prompt to the agent. Returns immediately; events stream asynchronous
With images:
```json
{"type": "prompt", "message": "What's in this image?", "images": [{"type": "image", "source": {"type": "base64", "mediaType": "image/png", "data": "..."}}]}
{"type": "prompt", "message": "What's in this image?", "images": [{"type": "image", "data": "base64-encoded-data", "mimeType": "image/png"}]}
```
**During streaming**: If the agent is already streaming, you must specify `streamingBehavior` to queue the message:
@ -61,7 +61,7 @@ Response:
{"id": "req-1", "type": "response", "command": "prompt", "success": true}
```
The `images` field is optional. Each image uses `ImageContent` format with base64 or URL source.
The `images` field is optional. Each image uses `ImageContent` format: `{"type": "image", "data": "base64-encoded-data", "mimeType": "image/png"}`.
#### steer
@ -71,6 +71,13 @@ Queue a steering message to interrupt the agent mid-run. Delivered after current
{"type": "steer", "message": "Stop and do this instead"}
```
With images:
```json
{"type": "steer", "message": "Look at this instead", "images": [{"type": "image", "data": "base64-encoded-data", "mimeType": "image/png"}]}
```
The `images` field is optional. Each image uses `ImageContent` format (same as `prompt`).
Response:
```json
{"type": "response", "command": "steer", "success": true}
@ -86,6 +93,13 @@ Queue a follow-up message to be processed after the agent finishes. Delivered on
{"type": "follow_up", "message": "After you're done, also do this"}
```
With images:
```json
{"type": "follow_up", "message": "Also check this image", "images": [{"type": "image", "data": "base64-encoded-data", "mimeType": "image/png"}]}
```
The `images` field is optional. Each image uses `ImageContent` format (same as `prompt`).
Response:
```json
{"type": "response", "command": "follow_up", "success": true}