- Add readCodexModelCatalog() that reads $CODEX_HOME/config.toml,
resolves model_catalog_json path (expand ~, relative to CODEX_HOME),
and parses the JSON as the primary model list
- Extract shared parseCodexModelsJSON() to deduplicate JSON parsing
logic between readCodexCachedModels and readCodexModelCatalog
- Refactor readCodexCachedModels() to reuse resolveCodexHome(nil)
- Update AvailableModels() priority:
1. model_catalog_json (new, highest)
2. provider config
3. GET /v1/models API
4. models_cache.json
5. hardcoded fallback
- Add tests: TestAvailableModels_UsesModelCatalog, TestReadCodexModelCatalog_NoConfigFile
* feat(codex): support custom system_prompt / append_system_prompt config
Codex has no native system-prompt CLI flag, so these project options are
synthesized into a preamble and prepended to the first message of each new
session. Resumed sessions are not re-injected (preambleSent is preset for
resume IDs). Covers both the exec and app_server backends.
Adds config.example.toml documentation for the two new options.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test(codex): check cs.Close return value to satisfy errcheck
CI lints new lines with golangci-lint --new-from-rev; the freshly added
TestSend_PrependsProjectPromptOnFreshSession used an unchecked defer
cs.Close(). Wrap it in a deferred closure that explicitly ignores the
error, matching the errcheck-clean pattern.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>