feat: auto-select model/reasoning and add persistent user config#5
Merged
feat: auto-select model/reasoning and add persistent user config#5
Conversation
…ser config Replace the hardcoded default model with dynamic auto-detection that queries the Codex app server's model list at runtime: - Models with `upgrade === null` are identified as the latest generation - Among those, `-codex` variants are preferred over plain models - Reasoning effort auto-selects to the highest level the model supports - Falls back gracefully to server default, then hardcoded fallback Add persistent user configuration via `~/.codex-collab/config.json`: - New `codex-collab config` command to get/set/unset defaults - Supports model, reasoning, sandbox, approval, and timeout - Priority: CLI flag > config file > auto-detected - Values are validated on load; invalid entries warn and are skipped This ensures the CLI stays current as new models are released without requiring code changes or manual updates.
…dings - jobs command now reads from local threads.json instead of spawning a new app-server (which has no knowledge of threads from other instances), fixing the bug where running threads were invisible - Store prompt preview in thread mapping for jobs display - Fix timeout config precedence (CLI flag > config file) - Fix hidden models excluded from auto-selection - Fix prototype property injection in config key validation - Improve error handling in loadUserConfig, saveUserConfig, resolveDefaults - Support --unset without key to clear all config
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 844807a1aa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
When multiple models have upgrade === null, sort by ID descending so higher version numbers (e.g. gpt-5.4 > gpt-5.3) are preferred. Addresses Codex GitHub review comment on PR #5.
Let the server choose defaults when auto-detection fails instead of hardcoding model/reasoning values that may become stale or invalid. Also pass includeHidden: true to model/list so hidden models (like -codex variants) are visible to auto-selection. Store the server's effective model in thread mapping instead of the requested one.
Replace version-string parsing with upgrade-chain traversal for model auto-selection: start from the server's isDefault model and follow upgrade pointers to the latest generation, then prefer a -codex variant if one exists. This avoids fragile version parsing and relies on the server's own succession metadata. Add updateThreadMeta() to refresh model/cwd/preview in threads.json on resume, so `jobs` listings stay accurate after --resume with overrides. Document `config --unset` (clear all) in README, README.zh-CN, and SKILL.md.
…lify review preview - Change "Using defaults" to "Model and reasoning will be determined by the server" since there are no client-side defaults anymore - Add not-found warning in updateThreadMeta matching updateThreadStatus - Replace nested ternary in cmdReview with switch for readability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-codexvariants when available. No version-string parsing — relies on the server's own succession metadata. Selects the highest supported reasoning effort for the chosen model.codex-collab configcommand to set/unset defaults for model, reasoning, sandbox, approval, and timeout. Stored in~/.codex-collab/config.json. Three-tier precedence:CLI flag > config file > auto-detected.codex-collab jobsnow reads from local thread mapping instead of spawning a new app-server, fixing the bug where running threads were invisible. Shows model and prompt preview in the listing. Metadata refreshed on resume to keep listings accurate.configuredset (not forwarded on resume),Object.hasOwnfor config key validation, robust error handling in config loading, andupdateThreadMeta()to keepjobsaccurate after resume.