From ec6fb20ebca9910472c84032e1b16493fb542283 Mon Sep 17 00:00:00 2001 From: Rolando Santamaria Maso <4096860+jkyberneees@users.noreply.github.com> Date: Mon, 14 Sep 2026 13:58:28 +0200 Subject: [PATCH 1/2] deps: bump go-llm-sdk to v0.3.3 and drop the local workspace overlay v0.3.3 carries the DeepSeek thinking-mode fix: an empty reasoning_content is echoed on requests that carry tools, so a turn whose reasoning the provider elided no longer serializes without the key and no longer kills the rest of the tool loop with a 400. Bumping to the released module lets the local go.work overlay go away entirely, so every build resolves the same code: local dev, CI and release. The overlay existed only to develop the fix in place; now that it is released it is pure drift risk, because it made local binaries run unreleased code while CI and releases ran the pinned tag. Verified with no workspace present (GOWORK unset): go list -m github.com/BackendStack21/go-llm-sdk -> v0.3.3 go build ./... ok go test ./internal/llmclient/... ./internal/loop/... ./internal/session/... ok go test -race ./internal/llmclient/... ok go.mod: one line. go.sum: two. No other dependency movement. --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 44408e7c..09ec74aa 100644 --- a/go.mod +++ b/go.mod @@ -11,4 +11,4 @@ require ( require golang.org/x/sys v0.47.0 -require github.com/BackendStack21/go-llm-sdk v0.3.2 +require github.com/BackendStack21/go-llm-sdk v0.3.3 diff --git a/go.sum b/go.sum index cb0c96c3..f9c2e33e 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/BackendStack21/go-llm-sdk v0.3.2 h1:aUXa450t+eOtLmuNX6gOMSD4zZsGCKtaIaG1YDHmNxY= github.com/BackendStack21/go-llm-sdk v0.3.2/go.mod h1:Nhro6plQaVIIFajPhzp2dzz4rv4DFU/yXNEudChllyE= +github.com/BackendStack21/go-llm-sdk v0.3.3 h1:JlMQL8K7W+BVe7zjhP7MMYK5VNqmK38QlDrFjA7Pp2c= +github.com/BackendStack21/go-llm-sdk v0.3.3/go.mod h1:Nhro6plQaVIIFajPhzp2dzz4rv4DFU/yXNEudChllyE= github.com/BackendStack21/go-mcp v1.3.0 h1:55iJgiAgcptv+mQwWEHNaFqPJksPR6zn4beYjHk/Ea4= github.com/BackendStack21/go-mcp v1.3.0/go.mod h1:RKFw6nrl6ySQqqrR8KtG7HYZ/heyyjT8SjiEtlbTMY8= github.com/BackendStack21/go-vector v1.4.0 h1:Ssu5RDEt4Cr9A17/ogdfjeuaLFFNHASJBIEGpqKzAV0= From 7f236fe1ecb58a2caaf87e5003363f959948720b Mon Sep 17 00:00:00 2001 From: Rolando Santamaria Maso <4096860+jkyberneees@users.noreply.github.com> Date: Mon, 14 Sep 2026 14:01:50 +0200 Subject: [PATCH 2/2] docs: document the DeepSeek reasoning-replay requirement and the v0.3.3 floor The dependency bump alone leaves the contract undocumented: PROVIDERS.md described the GPT-5.6 tools+reasoning route but said nothing about DeepSeek's reasoning_content replay rule, which is what breaks long tool loops on the older SDK. MIGRATION.md pinned "go-llm-sdk v0.3.2+" as the recommended floor. - PROVIDERS.md: a DeepSeek paragraph next to the GPT-5.6 one, stating that reasoning_content is required on every assistant turn of a tool-carrying request (including turns where the provider returned no reasoning), that v0.3.3+ echoes the key, and that v0.3.2 and older die mid-loop with the reported 400. - MIGRATION.md: the recommended pin moves to v0.3.3+ with the DeepSeek reason added alongside the existing GPT-5.6 and cache reasons. Docs only, no behaviour change. --- docs/MIGRATION.md | 2 +- docs/PROVIDERS.md | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index 1761a320..02c64b82 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -149,4 +149,4 @@ agent, err := odek.New(odek.Config{ ## Cache / cost budgets -Cache usage fields come from the SDK (`Usage.Cache*`). Pin **go-llm-sdk v0.3.2+** so GPT-5.6 tools+reasoning stays on (`POST /v1/responses`) and cache-token parsing remains honest. +Cache usage fields come from the SDK (`Usage.Cache*`). Pin **go-llm-sdk v0.3.3+** so GPT-5.6 tools+reasoning stays on (`POST /v1/responses`), cache-token parsing remains honest, and DeepSeek thinking-mode tool loops replay `reasoning_content` instead of dropping it (v0.3.2 and older lose the key on turns where the provider elided reasoning, and the loop 400s from then on). diff --git a/docs/PROVIDERS.md b/docs/PROVIDERS.md index eb0b6d0d..0c8f4344 100644 --- a/docs/PROVIDERS.md +++ b/docs/PROVIDERS.md @@ -47,6 +47,15 @@ actually reasons, and a reasoning summary is streamed back. `thinking=disabled` stays on Chat Completions with `reasoning_effort: none`. The same Responses route is used for GPT-5.4/5.5 when an explicit thinking level is set. +**DeepSeek (`deepseek`, the default id):** thinking mode requires +`reasoning_content` to be replayed on every assistant turn of a request that +carries tools, including turns where the provider returned no reasoning of +its own, which happens on some turns. With go-llm-sdk v0.3.3+ odek echoes the +key on tool-carrying requests, so such a turn no longer serializes without it. +On v0.3.2 and older the key is dropped when empty and a long tool loop dies +mid-run with `400 ... The reasoning_content in the thinking mode must be +passed back to the API`, then fails on every later request in that loop. + ## odek knobs (not in the SDK) | Knob | Where |