Files
plugins/packages/orcaterm/package.json
T
1sh1ro 9fb09a0f41 orcaterm 0.1.7: a tool call the model writes as text is not sent on as the answer (#969)
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.
2026-11-11 16:07:38 +08:00

21 lines
1.4 KiB
JSON

{
"name": "@magpie-community/opencode-orcaterm-auth",
"version": "0.1.7",
"description": "OrcaTerm (Tencent Cloud 遨驰终端) AI quota as an OpenAI-compatible provider for magpie and OpenCode",
"type": "module",
"main": "./opencode.mjs",
"exports": { ".": "./opencode2.mjs" },
"files": ["index.mjs", "opencode.mjs", "opencode2.mjs", "wechat.mjs", "README.md", "LICENSE"],
"keywords": ["opencode", "opencode-plugin", "magpie", "orcaterm", "tencent"],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/orcaterm"
},
"magpie": {
"maxConcurrency": 1,
"icon": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' y1='1' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%231C74C7'/%3E%3Cstop offset='.55' stop-color='%238870FF'/%3E%3Cstop offset='1' stop-color='%23FEAECB'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23a)' d='M56 54c-7-12.5-26.2-13.2-35.5-22.5C14.4 25.2 14 16.4 16.7 11 19.5 5.3 25.9 1 33.1 1c2.7 0 8 1 11 3 14.1 9.4 18 22.7 19.6 28.5 1.6 5.8 1.5 14.5-7.7 21.5z'/%3E%3Cpath fill='url(%23a)' opacity='.85' d='M86.2 58C78.2 75.5 48.2 70.5 33.2 64 20.6 66.3 15.2 72 15.2 81c0 9.5 6.2 17.4 15.5 18.5 9.3 1.1 22.6-5.5 33-14 9-7.4 19.8-17.6 22.5-27.5z'/%3E%3C/svg%3E"
}
}