ac4af582301a4e8a29245dbba767eba31334ddf9
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
be689b8833 |
gateway: a made reasoning item says its text once, and an item with no summary key doesn't panic (#2855)
magpieMadeReasoning joined an item's summaries and its reasoning_text into the made summary. #2855's later rollout (lyufeng000, 10-31) has DeepSeek items whose content repeats their summary, so the made item would carry the words twice, and DeepSeek be handed them back twice (withReasoningText reads the summary). It now takes the text, else the summaries. It also ranged over item["summary"].([]any), a single-value assertion that panics on an item with no summary key; both reads now use the checked form. TestMadeReasoningSaysItsTextOnce. Reviewed and landed as one batch of 12 commits (gua's #4593, #3269, #3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path sibling, and four review follow-ups). Run for the batch, whose last commit's tree is 5d58a75f3: - Full suite before the rebase (base |
||
|
|
5032d3ade7 |
gateway: a reasoning item magpie hands Codex with its text in it becomes one of its own, a summary and nothing sealed (#2855)
What changed A Responses reasoning item that carries the model's reasoning as content parts (reasoning_text) — another vendor's shape; OpenAI's own items carry summaries — no longer reaches a client of magpie's as the upstream wrote it. It is made over into the item magpie makes of any other upstream's reasoning: its text (and its summaries) as one summary, an rs_ id, no content and no seal — in a reply translated for the client (magpieMadeReasoningRaw at the encoder's sealed item and the whole reply's renderer) and in one relayed as it came (reasoningTidy, a passthrough filter on Responses streams and whole replies, the item in output_item.added/done and in response.completed's output). The subsystems doc's rule is amended to say so. Why A Codex conversation that used OpenAI, went through magpie to DeepSeek, then had magpie disconnected again, was stuck: every later turn, the remote compact too, answered 400 "Invalid 'input[43].content': array too long. Expected an array with maximum length 0, but got an array with length 1 instead." The reporter's rollout forensics narrow it: the DeepSeek phase had left 25 reasoning items, each with its text in content parts and a 38-character encrypted_content of the vendor's own (not the gAAAA the thread's own GPT-phase items carry, which have no content), which Codex stores and replays to OpenAI. OpenAI takes a reasoning item sent back only with its content empty (#1411) and cannot open another vendor's seal, so such an item poisons the thread for OpenAI wherever it was planted — and once Codex holds it, no retry of magpie's can strip it: client keeps, and #2855 came with magpie out of the path entirely. A Chat-API upstream's turn has always translated to an item of magpie's own (an rs_ id and a summary, TestTranslatedChatReasoningCarriesNoContent pins it); the items the reporter held are a Responses wire's own, which both the translated and the relayed reply handed over as they came. What magpie hands a client must be re-sendable to a strict Responses upstream: the text is kept in the summary, so an upstream that wants its reasoning back still gets it (withReasoningText), and magpie's own OpenAI destinations keep the item out as they did (#1008, #1044, #1411). Run - TestForeignSealedReasoningGivenCodexCarriesNoContent (translated) and TestForeignSealedReasoningRelayedCarriesNoContent (relayed) fail on upstream/main with the issue's item handed over whole — content, empty summary and the vendor's seal in both output_item.done and response.completed — and pass with the change; TestTranslatedChatReasoningCarriesNoContent (a Chat upstream's reasoning, translated) is green without and with the change. - Restoring the three product files alone to upstream/main (tests kept) fails the two again; restoring them back passes. - Attaching content to the made item fails both again ("carries its text"), and dropping the made summary fails both ("carries no summary"). - go test -tags nogui -count=1 ./internal/gateway: ok 312.4s; -run 'TestTranslated|TestReasoning|TestSealed': ok 7.9s; go test -race -tags nogui -count=1 -run 'TestTranslated|TestReasoning': ok 9.4s. gofmt -l internal/gateway empty. go vet -tags nogui and go build -tags nogui -o /dev/null . on darwin, GOOS=linux and GOOS=windows: pass (a pre-existing cgo -Wenum-conversion warning in internal/gui/trayimage_darwin.go on darwin, untouched). Not tried against real OpenAI or DeepSeek accounts; the reporter's rollout reading is taken from the issue, not re-derived from a live thread. Reviewed and landed as one batch of 12 commits (gua's #4593, #3269, sibling, and four review follow-ups). Run for the batch, whose last commit's tree is 5d58a75f3: - Full suite before the rebase (base |