mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix(coding-agent): expose tool metadata at stream start (#7953)
* fix(coding-agent): expose tool metadata at stream start * fix(coding-agent): centralize message update serialization
This commit is contained in:
parent
d711bd5f0a
commit
830a0a59e9
4 changed files with 97 additions and 28 deletions
|
|
@ -945,7 +945,7 @@ The `assistantMessageEvent` field contains one of these delta types:
|
|||
| `thinking_start` | Thinking block started |
|
||||
| `thinking_delta` | Thinking content chunk |
|
||||
| `thinking_end` | Thinking block ended |
|
||||
| `toolcall_start` | Tool call started |
|
||||
| `toolcall_start` | Tool call started (includes `id` and `toolName`) |
|
||||
| `toolcall_delta` | Tool call arguments chunk |
|
||||
| `toolcall_end` | Tool call ended (includes full `toolCall` object) |
|
||||
|
||||
|
|
@ -960,11 +960,17 @@ Example streaming a text response:
|
|||
The top-level `usage` field contains the latest cumulative provider-reported usage. It may remain
|
||||
zero until completion when a provider does not report usage during streaming.
|
||||
|
||||
Example starting a tool call:
|
||||
```json
|
||||
{"type":"message_update","usage":{...},"assistantMessageEvent":{"type":"toolcall_start","contentIndex":1,"id":"call_abc123","toolName":"write"}}
|
||||
```
|
||||
|
||||
`message_update` intentionally omits the former cumulative `message` field and
|
||||
`assistantMessageEvent.partial`. Clients that need a live partial message must assemble it
|
||||
from `message_start` and subsequent events using `contentIndex`. Treat `message_end.message`
|
||||
as authoritative. For tool calls, buffer `toolcall_delta.delta`; `toolcall_end.toolCall`
|
||||
contains the completed call.
|
||||
as authoritative. For tool calls, `toolcall_start` provides the call `id` and `toolName`;
|
||||
buffer `toolcall_delta.delta` for arguments. `toolcall_end.toolCall` contains the completed
|
||||
call.
|
||||
|
||||
### bash_execution_update
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue