Skip to content

orcaterm 0.1.9: refuse a tool action envelope written as the reply - #1368

Open
Beyfish wants to merge 1 commit into
magpie-community:mainfrom
Beyfish:orcaterm-tool-envelope
Open

Beyfish wants to merge 1 commit into
magpie-community:mainfrom
Beyfish:orcaterm-tool-envelope

Conversation

@Beyfish

@Beyfish Beyfish commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Measured 2026-11-19 on auto/glm-5.3 through magpie: the model answered a whole agent turn as the OrcaTerm terminal's own tool action envelope —

{"action":"review","ph_1":"--","tool":{"type":"mcp","mcpServer":"mcp-server-orcaterm-oauth","name":"execute_command","args":{"command":"ls …"}}}

— and it reached the agent as the answer text with a 200, which nothing could fail over on (three turns in one session; the agent read the protocol object as prose and carried on as if the tool had run).

Nothing can honour it: toUpstreamBody sends tools: [], so the tool it asks for cannot be run, and the object is that client's protocol, not an answer an OpenAI client can use.

This PR holds the envelope — it never streams before it is whole — and ends the turn as the error frame magpie fails over on (text_tool_call), the same treatment as TEXT_CALL, trae (#38) and qoder (#132):

  • the envelope as the whole reply, or after prose, fenced or bare
  • a model with more than one thing to ask for writes the envelopes one after another, back to back (measured the same evening, on another provider with no guard of its own); the whole run is held and refused, including when the stream ends inside a later member of it
  • what is not tool traffic is untouched: a review carrying a taskCompletion stays an answer, an envelope quoted as an example with text after it stays prose, and a truncated envelope on its own stays text

toolenvelope.test.mjs covers all of it (14 tests, bytes of the measured reply). The one failing test in the suite (/cb rebinding) fails on this machine on main as well, without this branch.

…elayed

Measured 2026-11-19 on auto/glm-5.3 through magpie: the model answered a
whole agent turn as the terminal's own tool action envelope — a review
with a tool payload — and it reached the agent as the answer text with a
200, which nothing could fail over on. The request went up with tools: [],
so the tool it asks for cannot be run, and the object is that client's
protocol, not an answer an OpenAI client can use.

The envelope never streams before it is whole, and the turn ends as the
error frame magpie fails over on (text_tool_call), the same treatment as
TEXT_CALL, trae (plugins#38) and qoder (plugins#132). A model with more
than one thing to ask for writes the envelopes one after another (measured
the same evening); the whole run is held and refused, including when the
stream ends inside a later member of it.
Copilot AI balanced review requested due to automatic review settings November 19, 2026 15:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants