Codex compacting on any Open Design model got 400 "[code=upstream_error]
Provider returned error" from amr-link, while other providers compacted.
Codex's compaction is its one request with "tools": [], and the summary
ask adds tool_choice and parallel_tool_calls beside them (#292). Since
plugins 0.1.13 / 48f976402 the Responses body is relayed to amr-link as
written, and an OpenAI-style validator refuses empty tools and a lone
tool_choice.
- passthrough: a Responses request to Open Design (its plugin, or a
provider at amr-link.open-design.ai) goes without an empty tools list
and the tool_choice/parallel_tool_calls beside it (withoutEmptyTools).
A body that declares a tool is unchanged; every other upstream is sent
Codex's shape as before.
- codexCompact: amr-link's "[code=upstream_error]" counts as
upstreamFailed, so a summary still refused is asked as sent, then as
text, then made locally, never handed to Codex as the 400.
upstreamFailed is only used by the compaction ladder.
Run (mote; the suite at 54117164c, then rebased on 1bfa8d5a1 and
-run 'OpenDesign|Compact' ./internal/gateway run again there: ok):
- TestOpenDesignCompactionSendsNoEmptyTools and
TestOpenDesignCompactionRefusedAsksAsText, built from Codex Desktop
26.1007's real compaction (testdata/codex-26.1007-compaction.json)
through the fake plugin as opendesign: both red on the old
gateway.go/codex_backend.go with the reporter's 400, green with them.
- go test -run 'OpenDesign|Compact|LoneToolChoice|ToolsOff' ./internal/gateway ok.
- go test -timeout 45m ./...: every package ok.
- go vet (darwin), GOOS=linux -tags nogui and GOOS=windows vet of
internal/gateway ok; gofmt -l clean.
Not tried: a real Open Design account (none here). Which of the empty
tools, the lone choices or the history's calls amr-link refuses is not
confirmed; the second change covers whichever it is.