Files
magpie/internal/codexcat
yetone 8acb0d3a7d codexcat: a DeepSeek model's Codex entry says what DeepSeek's own Codex setup says
Rollkey8 on X found DeepSeek in Codex through magpie duller than
DeepSeek's DSH. A real Codex 0.165.0 -> magpie -> api.deepseek.com
recording lost nothing in translation; what differed was the catalog
entry magpie writes for the model. DeepSeek's own Codex setup
(cdn.deepseek.com/api-docs/codex-deepseek-setup-en.sh) writes a
models.json for deepseek-flash and deepseek-v4-pro, and a DeepSeek
model's entry now takes its non-prompt fields from it:

- shell_type "shell_command" (Codex 0.165 reads it as unified_exec, its
  only shell tool, per openai_models.rs's serde alias; a Codex before
  that had a one-shot shell_command tool, which is what DeepSeek picks)
- support_verbosity true, default_verbosity "low" (text.verbosity low
  is sent)
- default_reasoning_summary "none": reasoning.summary "auto" is no
  longer sent; DeepSeek streams its reasoning as text
- multi_agent_version "v2" where magpie had none
- supports_image_detail_original on a model whose entry takes images

A DeepSeek model is deepseek-v4*/-flash/-pro/-chat/-reasoner after any
provider or relay prefix (codexcat.deepSeek); a routing group or an
R1-distill isn't one. Every other vendor's entry is unchanged.
default_reasoning_summary is tagged keep:"unset", so a value the user
put by hand in another model's entry stays through Keep, as it did
before magpie wrote the key anywhere.

Not taken, and why:
- base_instructions / model_messages: magpie never rewrites a model's
  Codex prompt (owner's rule).
- auto_compact_token_limit null: magpie's 272K Long conversations
  default came from a DeepSeek-flash latency report (e950eb080, ~550K
  turns waited 70-90s for a first token); Full window, or the model's
  Compact at, gives the whole 1M, and a model_auto_compact_token_limit
  the user set still comes first.
- supports_search_tool false on v4-pro: kept true for #258.
- reasoning levels: the provider's, as for every model.
- comp_hash, max_context_window (same as the window), web_search
  (config.toml, not the catalog).
- v4-pro's images: DeepSeek's pricing page, its live /models and
  models.dev all say text only, and magpie's own entry (/v1/models)
  says text. Codex's catalog lists it with image only when Settings ›
  Vision describes images for text-only models (codexListed's
  described()), by design.

Also adds the agent-wiring.md row "Codex: DeepSeek models".

What was run, at this tree (as daf576653, the same tree before the
gofmt commit was split out under it):
- TestCodexCatalogDeepSeekAsDeepSeekSays and
  TestCodexCatalogKeepsUsersSummary: red on the old codexcat.go (both
  FAIL with it stashed), green on the new.
- go test ./internal/codexcat ./internal/provider -run 'Codex|DeepSeek'
  on mote: ok.
- gofmt -l: clean. On mote: go vet ./..., GOOS=linux go vet -tags
  nogui ./..., GOOS=windows go vet ./..., go build, GOOS=linux go
  build -tags nogui, GOOS=windows go build: all ok.
- Full suite on mote, go test -count=1 -timeout 45m ./..., alone on
  the box: 79 packages ok; internal/gui red only in its 10 real-window
  AppKit tests, each killed at its deadline, which is #4125 (mote's
  AppKit hang; recorded there).
- Real use: Codex 0.165.0 in a sandbox HOME against a magpie built
  from this tree with the owner's DeepSeek provider copied in (deleted
  after). The written catalog has shell_command for both models. A
  multi-step task on deepseek-v4-pro (write a module and unittest file,
  run the tests, fix, report) ran to the end, tests pass. Through a
  recording proxy the requests carry text.verbosity "low", reasoning
  {effort: high} with no summary, and the same tools as before
  (exec_command, write_stdin, apply_patch, ...).

Not tried: a Codex older than 0.165, where shell_command is a tool of
its own; deepseek-flash in a real run (only v4-pro); a blind side by
side against DSH on answer quality.
2026-10-30 18:44:23 +08:00
..
test: every package's tests pass on Windows, and none writes outside its sandbox (the user: 把 Windows 上那几个失败的测试修掉) — on a Windows box the suite failed in most packages, and the root package hung for 25 minutes. Tests set HOME, which os.UserHomeDir ignores on Windows (it reads USERPROFILE), so they read and wrote the runner's own home; each now sets USERPROFILE beside HOME, and Devin's, Goose's, Crush's and Claude Desktop's tests set APPDATA/LOCALAPPDATA, where those keep their files there. said() read the command's output only once it returned, and a pipe holds a few KB on Windows, so magpie model --help blocked forever; it reads while the command writes. Unix permission bits (the gateway key store's 0600 too), exec bits and symlinks Windows lacks are checked only off Windows; TOML strings hold Windows paths as literal strings, JSON as marshalled ones; a URL's path is compared as one. The provider and usage packages run in a home of their own (TestMain, as the gateway's already does), since a CLI's identity kept by a refresh still going when its test ended landed in the runner's ~/.config/magpie — and on a Mac in the user's own. Two product fixes came out of it: imagemcp took a file:///C:/… root or image for the path /C:/…, which doesn't exist on Windows, and now makes a Windows path of it (a host for a UNC share); and session discovery could keep a new Cowork session hidden on Linux, where a folder's mtime is a kernel tick and its size doesn't change, so an entry added within the tick of the last listing left both as they were — a listing made within 2s of its folder's last change is read again, as git does for racy files. TestFilePath and TestRacyDirectoryListedAgain fail without the change. On Windows 11 every package passes (32 of 32) and a run of each package in a fresh home leaves nothing in home, APPDATA or LOCALAPPDATA; on Linux (WSL) and macOS go test -tags nogui ./... passes. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build pass.
2026-10-01 23:15:07 +08:00