fix(chat): reset model override with default

This commit is contained in:
Peter Steinberger
2026-05-07 22:36:02 +01:00
parent 139122f655
commit 830a72d2ee
3 changed files with 25 additions and 0 deletions

View File

@@ -154,6 +154,7 @@ Docs: https://docs.openclaw.ai
### Fixes
- Chat commands: make `/model default` reset the session model override instead of treating it as a literal model name. Fixes #78182.
- Cron: make rejected `payload.model` errors show the configured `agents.defaults.models` allowlist instead of echoing the rejected model twice. Fixes #79058.
- Agents/subagents: retry parent wake announces when the announce-summary model run fails with fallback cooldown exhaustion instead of dropping the wake on the first transient provider overload. Refs #78581.
- Providers/network: honor IPv4 CIDR and octet-wildcard `NO_PROXY` entries such as `100.64.0.0/10` and `100.64.*` before enabling trusted env-proxy mode for model-provider requests. Fixes #79030.

View File

@@ -66,6 +66,15 @@ export function resolveModelSelectionFromDirective(params: {
}
const raw = params.directives.rawModelDirective.trim();
if (/^default$/i.test(raw)) {
return {
modelSelection: {
provider: params.defaultProvider,
model: params.defaultModel,
isDefault: true,
},
};
}
const storedNumericProfile =
params.directives.rawModelProfile === undefined
? resolveStoredNumericProfileModelDirective({

View File

@@ -643,6 +643,21 @@ describe("/model chat UX", () => {
});
});
it("treats /model default as a session model reset", () => {
const resolved = resolveModelSelectionForCommand({
command: "/model default",
allowedModelKeys: new Set(["anthropic/claude-opus-4-6", "openai/gpt-4o"]),
allowedModelCatalog: [],
});
expect(resolved.errorText).toBeUndefined();
expect(resolved.modelSelection).toEqual({
provider: "anthropic",
model: "claude-opus-4-6",
isDefault: true,
});
});
it("keeps openrouter provider/model split for exact selections", () => {
const resolved = resolveModelSelectionForCommand({
command: "/model openrouter/anthropic/claude-opus-4-6",