Skip to content

feat: add default-model command and per-tool model configuration (#88)#89

Open
poe-code-agent[bot] wants to merge 5 commits intomainfrom
agent/issue-88
Open

feat: add default-model command and per-tool model configuration (#88)#89
poe-code-agent[bot] wants to merge 5 commits intomainfrom
agent/issue-88

Conversation

@poe-code-agent
Copy link
Contributor

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-model CLI command, with graceful fallback behavior when no default is configured.

Changes

  • New default-model CLI command (src/cli/commands/default-model.ts): Adds set and show subcommands for configuring and viewing default models globally or per tool (e.g. --tool codex).
  • SDK support (src/sdk/default-model.ts): Introduces default model resolution logic consumed by spawn and other SDK entry points.
  • Config service updates (src/services/config.ts): Adds saveDefaultModel and loadDefaultModels helpers to persist and retrieve default model mappings from the user config file.
  • Program registration (src/cli/program.ts): Registers the new default-model command in the CLI.
  • Public exports (src/index.ts): Exposes default model utilities from the package index.
  • Dry-run support: Writes are skipped when --dry-run is passed; a descriptive message is shown instead.
  • Tests: Full test coverage for the new command and config helpers.
  • Script cleanup (scripts/workflows/discover-models.mjs): Removes unused suppressErrors option and isProjectV2NotFoundErrors helper; simplifies execModelsRaw inline 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 show if nothing is configured.

Closes #88

Poe Code Agent 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.
@YushengAuggie
Copy link
Contributor

Could you update the README with the new parameter? make it concise. Find a good place to add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support configuring default models per tool/endpoint via Poe-code (e.g., Sonnet 4.6 for Codex /v1/responses)

1 participant