orcaterm 0.1.7 reads the tool call a model writes as text (DSML, <tool_call>, <function_calls>,
<function=, <invoke name=) on both the streamed and non-streamed paths. The answer stops where the
call begins, and the turn ends as a text_tool_call error (an error frame when streamed, a 502 when
not), so magpie can retry or try another account instead of passing the call on as prose. A call
shown in a code fence or in backticks is ordinary text, as in trae. A call carried only in the
thinking goes through the same guard: the call is read from the extractor that cut it
(answerAndCall), so prose before it no longer hides it. An `ask` envelope reaches the client as its
question with its options under it, one per line, whether it is complete JSON, hand-written with a
bare line break, cut short by the stream, or appended after prose.
Reviewed at 39b4ef653e89e2b3e8c2d1b803563089ba4e3e2b, every line changed since 7a49ed7c. Merge-tested
with origin/main 2f8e65a1 (clean, no conflicts in packages/orcaterm).
Ran, with Bun 1.4.2:
- WSL magpie-desktop (wsl-run, HOME=$(mktemp -d)): bun test packages/orcaterm 160 pass, 0 fail;
bun scripts/check.mjs exit 0. The same after merging origin/main 2f8e65a1: 160 pass, 0 fail,
check exit 0.
- Windows xiaomi-gpu (win-run, fresh HOME and USERPROFILE): bun test packages/orcaterm 160 pass,
0 fail; bun scripts/check.mjs exit 0.
- Review probes (local, not pushed): 40, all green. That covers the 21 from round 2, including the
three thinking-only calls (prose + call streamed gives the prose plus an error frame, not
streamed gives a 502, a call inside a thinking envelope gives the error frame), the loose ask, the
cut-short ask and prose + ask. It also covers 19 new ones: streamed and non-streamed give the same
result for a loose ask in 1-, 3- and 4096-character frames, prose + loose ask, prose + fenced ask,
an appended completion still dropped, a fenced or backticked call in the thinking shown, content
winning over a call in the thinking, a call split over 1-character thinking frames, a cut-short
opener in the thinking, a complete ask followed by prose kept verbatim, a backticked ask example
kept, and an appended ask whose question carries a call (502 / error frame).
Broken by hand, one at a time (cp-restored and touched each time), the whole orcaterm suite:
13 of 17 breaks go red. Red: trusting a match at the end of the text (3), the quoted check in
answerCut (6), the complete-opener hold (18), the i flag (2), the streamed thinking guard (3), the
non-streamed thinking guard (1), answerAndCall returning no call (4), answerField always
taskCompletion (2), the appended ask dropped (1), the loose reader's options strip (1), the loose ask's
options (1), the cut-short field (1), the ask unwrap (2).
Not red in the suite (each one red in the review probes): object options read for their label, a
blank question treated as none, and the fence taken off an appended ask (break it and the question
of "Two options.\n```json\n{ask}\n```" is dropped). textCallIn without quoted() has no effect any
more, because nothing calls textCallIn now apart from its export.
Correction to round 2: the "duplicate" <function_calls> in TEXT_CALL_OPEN and TEXT_CALL_MARKS is
<function_calls> and its antml:-prefixed form. Our tooling had shown both lines the same. Not a
duplicate.
Not tried: a real OrcaTerm account (none used from this PR), and an end-to-end magpie gateway run.
Edges noted, not blocking: an ask carrying both taskCompletion and question answers with
taskCompletion when it is valid JSON, and with question when it is hand-written. A hand-written
ask whose option string contains "]" still goes out raw.