3 Commits

Author SHA1 Message Date
Han
8e3203a7b7 feat(codex): prefer Codex model_catalog_json as highest-priority model source (#1074)
- 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
2026-06-23 06:58:40 +08:00
Haiyi
c1466312e5 feat(codex): support custom system_prompt / append_system_prompt config (#1345)
* 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>
2026-06-20 12:15:19 +08:00
q107580018
7a34ca4e00 feat(codex): fallback /model list to local models cache (#65)
Co-authored-by: mac <mac@Mac-mini.local>
2026-03-11 11:41:53 +08:00