feat(commands): add dynamic /<alias> model switching#393
Closed
azade-c wants to merge 2 commits intoopenclaw:mainfrom
Closed
feat(commands): add dynamic /<alias> model switching#393azade-c wants to merge 2 commits intoopenclaw:mainfrom
azade-c wants to merge 2 commits intoopenclaw:mainfrom
Conversation
b2373ea to
ed26022
Compare
Contributor
|
Azade, love this feature! Thanks! |
Contributor
|
Landed on main via ff merge.\n\nCommits:\n- bebe3dc2 feat(commands): add dynamic / model switching\n- 9e51c2c2 fix: filter reserved commands from model aliases + add tests\n- 2f8ade96 fix(onboarding): widen WhatsApp config helpers (build type fix)\n- 64f0aeee fix(commands): harden model alias parsing + docs/changelog/test for trimmed reserved aliases\n\nGate: pnpm lint && pnpm build && pnpm test |
dgarson
added a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 9, 2026
Add a new "Debug & Logging" section in the Admin/Power User settings that provides a full UI for tuning openclaw.json logging and debugging configuration. Gated behind Power User Mode. Covers: - Log level / console level / console style selectors - Redact sensitive toggle - Enhanced logging feature toggles (tool errors, perf outliers, etc.) - Performance threshold sliders (tool call, agent turn, gateway, db op) - Token warning threshold sliders - Tool journal config (enable, file path, retention, redaction) - Suppress subsystem debug logs tag list - Channel debug overrides (add/remove with verbose/debug/trace/suppress) - Feature debug overrides (add/remove with verbose/debug/trace/suppress) - Sticky save/reset bar with dirty state tracking https://claude.ai/code/session_011WdpEacHmK1fMQMFiD3Szu Co-authored-by: Claude <[email protected]>
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
Add support for
/<alias>as a shorthand for/model <alias>.Many users naturally type
/gpt,/sonnet,/haikuetc. to switch models. Today only/model <name>is recognized, so those commands are silently ignored.How it works
Aliases are read dynamically from
cfg.agent.models[*].aliasat runtime — nothing is hard-coded.Example config:
{ "agent": { "models": { "anthropic/claude-opus-4-5": { "alias": "opus" }, "anthropic/claude-sonnet-4-5": { "alias": "sonnet" }, "openai-codex/gpt-5.2": { "alias": "gpt" } } } }With this config,
/opus,/sonnet, and/gptall work as model switches.Command collision handling
If an alias collides with an existing command (e.g.
/status,/help,/reset), the existing command takes priority. The alias is filtered out and won't be recognized as a model switch.This prevents accidental shadowing of built-in commands.
Changes
src/auto-reply/model.ts—extractModelDirective()now accepts an optionalaliasesarray and matches/<alias>patternssrc/auto-reply/reply/directive-handling.ts— passes aliases to the directive parsersrc/auto-reply/reply.ts— collects aliases from config, filters out reserved commands, and passes them throughsrc/auto-reply/model.test.ts— new: 17 tests covering alias matching, edge cases, and priorityNotes
/model <name>still works exactly as before/foowon't be treated as a model switch)