feat: add default-model command and per-tool model configuration (#88)#89
Open
poe-code-agent[bot] wants to merge 5 commits intomainfrom
Open
feat: add default-model command and per-tool model configuration (#88)#89poe-code-agent[bot] wants to merge 5 commits intomainfrom
poe-code-agent[bot] wants to merge 5 commits intomainfrom
Conversation
added 4 commits
February 27, 2026 20:35
…back Store default_models in ~/.poe-code/config.json keyed by tool name, endpoint path, or "global". Expose saveDefaultModel, loadDefaultModels, and resolveDefaultModel with a key-specific → global → null fallback chain.
Add `poe-code default-model set` to configure a default model for a specific tool (--tool) or globally, and `poe-code default-model show` to inspect the current configuration. Supports --model flag, --yes, and --dry-run.
Expose default model configuration via the poe-code SDK so callers can programmatically set and query configured default models without going through the CLI.
Before routing a spawn call, resolve the configured default model for the service (key-specific first, then global). If found, use it as the model for the spawn invocation, giving a graceful fallback without requiring the caller to pass --model explicitly.
Contributor
|
Could you update the README with the new parameter? make it concise. Find a good place to add it. |
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
Implements configurable default models per tool and globally, addressing issue #88. Users can now declare a default model for all tools or on a per-tool basis via the new
default-modelCLI command, with graceful fallback behavior when no default is configured.Changes
default-modelCLI command (src/cli/commands/default-model.ts): Addssetandshowsubcommands for configuring and viewing default models globally or per tool (e.g.--tool codex).src/sdk/default-model.ts): Introduces default model resolution logic consumed by spawn and other SDK entry points.src/services/config.ts): AddssaveDefaultModelandloadDefaultModelshelpers to persist and retrieve default model mappings from the user config file.src/cli/program.ts): Registers the newdefault-modelcommand in the CLI.src/index.ts): Exposes default model utilities from the package index.--dry-runis passed; a descriptive message is shown instead.scripts/workflows/discover-models.mjs): Removes unusedsuppressErrorsoption andisProjectV2NotFoundErrorshelper; simplifiesexecModelsRawinline calls.Fallback Behavior
When no default model is configured for a given tool, the system falls back to the global default. If no global default is set, the existing behavior applies (no model override). Users are informed via
poe-code default-model showif nothing is configured.Closes #88