Files
plugins/packages/agent-console/daemon/src
yetone 7e70a23ca3 agent-console 1.3.2: Codex's picker lists model_catalog_json's models (#758)
With a custom Codex provider, listModels read only config.toml's `model`
and `[model_providers.<p>].models`, so a config whose models live in
`model_catalog_json` (as magpie writes it) showed one "Default" row
(wwenc6621, #758).

parseCodexConfig now reads `model_catalog_json` (a profile's first), and
the picker lists that file's models: slug as the id, display_name as the
label, supported_reasoning_levels/default_reasoning_level as the levels.
Entries whose visibility isn't "list" are left out, as Codex's own picker
does. The path is resolved as Codex's AbsolutePathBuf does it (checked in
openai/codex codex-rs/utils/absolute-path): "~" and "~/..." are home, a
relative path is taken from config.toml's folder. Codex doesn't expand
environment variables; a leading $HOME / ${HOME}, as in the reporter's
config, is expanded here too. The configured model stays the default;
`models = [...]` entries missing from the catalog are kept after it. A
missing or unparsable catalog logs a warning and keeps the old list.

Run (mote, macOS):
- vitest: 62 files, 466 passed / 17 skipped; `npm run check` OK.
- `npm run build`, then `verify:build`: committed dist identical.
- root `bun test packages/agent-console` 6/6; `bun scripts/check.mjs` OK.
- A real magpie-written catalog (33 entries, 31 listed): 31 rows with
  display names and levels.
Broken by hand: the new test file against main's provider.ts: 4 of 5
tests red (the reporter's config gives only the one model); the fifth,
missing/broken catalog, passes on both by design.
Not tried: the console UI itself with a live Codex, and Windows/Linux.
2026-11-05 17:20:20 +08:00
..