Files
magpie/docs
yetone 18c3976234 gateway: DSML calls Alma relays from a group's DeepSeek are guarded on the Responses route
wishSeikouudoku on X (tweet 2117056042001719807, 11-02 08:47 +0800): Alma,
through a magpie group to DeepSeek, got <||DSML|| calls>, invoke
name="…" and parameter as its reply's text, and no tool ran.

Cause, already fixed on main: Alma's magpie provider is of type openai,
which the AI SDK sends to /v1/responses (the owner's usage log: 4365
Alma rows with ep /v1/responses). DeepSeek's preset speaks Responses
too, so the reply was relayed as it came, and before 20f27f514 (#4743,
first in v0.1.2652, published 11-01 22:36Z, about 2h before the tweet)
a relayed Responses reply's text was never read for calls. The DSML
parser itself already read these exact bytes (observedPipes, #2623).
No code change here: this commit adds the reporter's route to the tests
and fixes the subsystem doc, which still said a relayed Responses reply
"is not read for calls yet".

- textcalls_alma_test.go: TestDSMLAlmaResponsesThroughGroup sends
  Alma's AI-SDK-shaped request (streamed and whole) to a group of two
  Responses members, the first answering or refusing with a 500. The
  reply is DeepSeek-shaped: a reasoning item, then a message whose text
  is "我先搜一下。\n\n" + observedPipes, one character to a delta.
  TestDSMLAlmaResponsesPlugin does the same to a plugin's model, alone
  and as a group's only member (the plugin is asked Chat, so the
  translation reads it).
- gateway-routing.md: the text-calls paragraph names responsesTextCalls
  and this report.

Run (mote; the full package at 4d55a0a02 + this change, then the DSML,
TestTextWritten and Responses passthrough tests again at ca1fc43fc +
this change, which touched no gateway file: ok):
- go test -timeout 45m ./internal/gateway/ ./ : root ok; gateway red on
  TestCodexPoolSaysTheClientsVersion only, a file this change doesn't
  touch, which is #4807 (red in a full package run on mote, passes
  alone); alone with TestDSMLAlma it is ok. A full ./... run wasn't
  made: this change is a test file and a doc.
- -run 'TestDSMLAlma|TestDSMLThroughGroup|TestInvokeReportedResponsesPassthrough': ok

Broken by hand:
- the responsesTextCalls branch in passthrough turned off (as before
  v0.1.2652): TestDSMLAlmaResponsesThroughGroup red, the DSML in
  output_text and in response.completed's output, no function_call.
- textCallSee turned off in both translated paths (gateway.go written,
  continuation.go): TestDSMLAlmaResponsesPlugin red. With only
  gateway.go's off it stayed green: the plugin's reply goes through
  continuation.go's.

Real request: an Alma-shaped streamed /v1/responses request through a
sandboxed magpie (sandbox HOME on mote, port 3591) to a group of
deepseek/deepseek-flash, opencode-go/deepseek-v4.1-flash and
volcengine-2/deepseek-v4-1-flash-260910. DeepSeek's own API answered
Insufficient Balance and OpenCode Go's key has expired, so Volcengine's
DeepSeek V4.1 Flash served it: a native web_search function_call, no
DSML. The model didn't write its call as text on that try.

Not tried: DeepSeek's own Responses stream (no balance), so the
reasoning-then-message shape in the fixture is modelled on OpenAI's
events, not DeepSeek's bytes; the reporter's magpie version is not
known.
2026-11-02 09:12:14 +08:00
..