The sibling of qoder's #1113: a model can write OpenAI's own wire shape
as text, {"tool_calls":[{"name","arguments"}]} on a line of its own,
and trae passed it through as the answer. TextTools now reads a whole,
readable object as its calls ({"name","arguments"} entries and OpenAI's
{"type":"function","function":{…}} both), drops the line's indent with
it, and ends the turn with the cut-short failure when the stream ends
inside one, as a <tool_call> block does. While streaming, a last line
that may still grow into {"tool_calls":[{ is held until it settles.
The shape in prose, in a code fence, {"tool_calls":[]}, an entry with
no name and other JSON lines stay text.
Siblings: doubao-work 0.1.12 (4ea39f01) and orcaterm 0.1.8 (2db9b0ad).
zen-free reads no calls out of text (its upstream sends tool_calls
itself), so it has nothing to change.
Run (WSL magpie-desktop, HOME=$(mktemp -d)):
- packages/trae bun test: 265 pass, 0 fail. jsoncall.test.mjs uses
#1113's bytes, whole and in 1-, 5- and 4096-character pieces.
- On the old code jsoncall.test.mjs is 2 of 3 red; with jsonHoldAt
returning -1 by hand, the streamed cases go red again.
- bun scripts/check.mjs trae: ok.
Not tried: a real Trae account producing this reply.