gateway: a turn's thinking goes back to Qoder's plugin; qoder min 0.2.42

uk.jent on Discord: Qoder dropped the model's earlier thinking. Qoder.app's
own client sends reasoning_content on every earlier assistant turn, and the
Qoder plugin left it out from its first version on; 0.2.42 sends it.
An Anthropic- or Responses-speaking agent's thinking reached the plugin
only when chatReplaysReasoning held, so qoder and qoder-cn are added
beside Command Code's plugin; a tool turn with no thinking gets the same
" " DeepSeek gets, which 0.2.42 reads as none. The qoder mover min is
0.2.42 (npm view --prefer-online: 0.2.42).

Run (mote): go build ./..., go vet -tags nogui on gateway and provider,
go test -tags nogui -timeout 45m ./internal/gateway/ (ok, 535s) and
./internal/provider/, which crashes in TestUnreadLoginsWriteErrorsKeepCredentials
on "close of synctest channel from outside bubble", #3632, open and not
this change. TestPluginStreamsPastTheBudgetWait, run alone, was red 2 of
3 with this change and 3 of 4 on clean dc1af8231 (connection reset by
peer, #3946). Real account, plugin side: DeepSeek-V4-Pro on Qoder recalls
a codeword its thinking before a tool call named with 0.2.42, not 0.2.41.

Broken by hand: TestCommandCodePluginReasoning with qoder and qoder-cn
added is red on the old chatReplaysReasoning (no reasoning_content).

Not tried: a Claude Code session through magpie onto Qoder end to end;
Qoder CN.
This commit is contained in:
yetone
2026-10-28 04:32:30 +08:00
parent 7f32f0ec93
commit c752082e47
3 changed files with 8 additions and 6 deletions
+4 -3
View File
@@ -312,11 +312,12 @@ var failedAsText = map[string]bool{"devin": true, "qoder": true, "qoder-cn": tru
// chatReplaysReasoning is whether a Chat upstream wants a turn's reasoning
// back in reasoning_content: DeepSeek's models wherever they are served
// (#388), the model named as the provider names it (OpenCode Go's
// deepseek-v4.1-flash, whose host doesn't say so), and Command Code's
// deepseek-v4.1-flash, whose host doesn't say so), Command Code's
// plugin, which replays it for a Go key as the built-in did to
// /alpha/generate.
// /alpha/generate, and Qoder's, which sends it on as Qoder's own client
// does (uk.jent on Discord; plugin 0.2.42).
func chatReplaysReasoning(host, model string) bool {
return strings.Contains(host, "deepseek") || strings.Contains(strings.ToLower(model), "deepseek") || host == provider.CommandCodePlanID
return strings.Contains(host, "deepseek") || strings.Contains(strings.ToLower(model), "deepseek") || host == provider.CommandCodePlanID || host == "qoder" || host == "qoder-cn"
}
func buildChat(r *Request, model, host string, rejectTemp bool) []byte {
+3 -2
View File
@@ -116,12 +116,13 @@ func TestCursorPluginFast(t *testing.T) {
// A Command Code Go conversation moved onto its plugin keeps its
// reasoning, as the built-in replayed it to /alpha/generate: its plugin
// reads reasoning_content. DeepSeek still gets it, others don't.
// reads reasoning_content. DeepSeek and Qoder's plugin, which sends it on
// as Qoder's client does, get it too; others don't.
func TestCommandCodePluginReasoning(t *testing.T) {
reasoning := func(host string) any {
return chatBody(t, host)["messages"].([]any)[1].(map[string]any)["reasoning_content"]
}
for _, host := range []string{provider.CommandCodePlanID, "api.deepseek.com"} {
for _, host := range []string{provider.CommandCodePlanID, "api.deepseek.com", "qoder", "qoder-cn"} {
if got := reasoning(host); got != "pondered" {
t.Errorf("%s got reasoning %v", host, got)
}
File diff suppressed because one or more lines are too long