fix: deprecate models add command (#71175) · openclaw/openclaw@59e2825
Takhoffman
·
2026-04-25
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -32,6 +32,7 @@ Docs: https://docs.openclaw.ai
|
32 | 32 | - Models/CLI: speed up `openclaw models list --all --provider <id>` for bundled providers with safe static catalogs while keeping live and third-party providers on registry discovery. (#70632) Thanks @shakkernerd. |
33 | 33 | - Models/CLI: avoid broad registry enumeration for default `openclaw models list`, reducing default listing latency while preserving configured-row output. (#70883) Thanks @shakkernerd. |
34 | 34 | - Models/CLI: split `openclaw models list` row-source orchestration and registry loading into narrower helpers without changing list output behavior. (#70867) Thanks @shakkernerd. |
| 35 | +- Models/commands: deprecate `/models add` so chat attempts now return a deprecation message instead of writing model configuration, and remove the add action from `/models` provider menus. |
35 | 36 | - Codex harness/context-engine: run context-engine bootstrap, assembly, post-turn maintenance, and engine-owned compaction in Codex app-server sessions while keeping native Codex thread state and compaction auditable. (#70809) Thanks @jalehman. |
36 | 37 | - Plugins/Google Meet: add a bundled participant plugin with personal Google auth, explicit meeting URL joins, Chrome and Twilio transports, and realtime voice support. (#70765) Thanks @steipete. |
37 | 38 | - Plugins/Google Meet: default Chrome realtime sessions to OpenAI plus SoX `rec`/`play` audio bridge commands, so the usual setup only needs the plugin enabled and `OPENAI_API_KEY`. |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -de02a4b0ec521fda7d951d2dc0c742fc2fa310647ffd56a666346e5ddc6b5a59 config-baseline.json |
2 | | -bf00f7910d8f0d8e12592e8a1c6bd0397f8e62fef2c11eb0cbd3b3a3e2a78ffe config-baseline.core.json |
| 1 | +2894c80bc234b33f14a0ddb09e6f42368da4ca23e0e7faceb13aba52239c1a76 config-baseline.json |
| 2 | +c8ff25fcdd2389d5fd88f8ba188d77c21f58b56765b555eecf3b37437f743d50 config-baseline.core.json |
3 | 3 | 22d7cd6d8279146b2d79c9531a55b80b52a2c99c81338c508104729154fdd02d config-baseline.channel.json |
4 | | -b79dc28c1b6002dc59bd77bde47c1855a9ece72b9fdf94c0baf0c5320b2be12c config-baseline.plugin.json |
| 4 | +5ce9062d0ab7f9447f149fc0770571068b4c4c89e0fb80ae6ef7b3f2a146c8b3 config-baseline.plugin.json |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -305,7 +305,7 @@ By default, components are single use. Set `components.reusable=true` to allow b
|
305 | 305 | |
306 | 306 | To restrict who can click a button, set `allowedUsers` on that button (Discord user IDs, tags, or `*`). When configured, unmatched users receive an ephemeral denial. |
307 | 307 | |
308 | | -The `/model` and `/models` slash commands open an interactive model picker with provider and model dropdowns plus a Submit step. Unless `commands.modelsWrite=false`, `/models add` also supports adding a new provider/model entry from chat, and newly added models show up without restarting the gateway. The picker reply is ephemeral and only the invoking user can use it. |
| 308 | +The `/model` and `/models` slash commands open an interactive model picker with provider and model dropdowns plus a Submit step. `/models add` is deprecated and now returns a deprecation message instead of registering models from chat. The picker reply is ephemeral and only the invoking user can use it. |
309 | 309 | |
310 | 310 | File attachments: |
311 | 311 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -301,8 +301,8 @@ Surface different features that extend the above defaults.
|
301 | 301 | }, |
302 | 302 | { |
303 | 303 | "command": "/models", |
304 | | -"description": "List providers/models or add a model", |
305 | | -"usage_hint": "[provider] [page] [limit=<n>|size=<n>|all] | add <provider> <modelId>" |
| 304 | +"description": "List providers/models", |
| 305 | +"usage_hint": "[provider] [page] [limit=<n>|size=<n>|all]" |
306 | 306 | }, |
307 | 307 | { |
308 | 308 | "command": "/help", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -130,9 +130,7 @@ Notes:
|
130 | 130 | |
131 | 131 | - `/model` (and `/model list`) is a compact, numbered picker (model family + available providers). |
132 | 132 | - On Discord, `/model` and `/models` open an interactive picker with provider and model dropdowns plus a Submit step. |
133 | | -- `/models add` is available by default and can be disabled with `commands.modelsWrite=false`. |
134 | | -- When enabled, `/models add <provider> <modelId>` is the fastest path; bare `/models add` starts a provider-first guided flow where supported. |
135 | | -- After `/models add`, the new model becomes available in `/models` and `/model` without restarting the gateway. |
| 133 | +- `/models add` is deprecated and now returns a deprecation message instead of registering models from chat. |
136 | 134 | - `/model <#>` selects from that picker. |
137 | 135 | - `/model` persists the new session selection immediately. |
138 | 136 | - If the agent is idle, the next run uses the new model right away. |
@@ -151,14 +149,6 @@ Notes:
|
151 | 149 | |
152 | 150 | Full command behavior/config: [Slash commands](/tools/slash-commands). |
153 | 151 | |
154 | | -Examples: |
155 | | - |
156 | | -```text |
157 | | -/models add |
158 | | -/models add ollama glm-5.1:cloud |
159 | | -/models add lmstudio qwen/qwen3.5-9b |
160 | | -``` |
161 | | - |
162 | 152 | ## CLI commands |
163 | 153 | |
164 | 154 | ```bash |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3138,8 +3138,8 @@ describe("createTelegramBot", () => {
|
3138 | 3138 | } |
3139 | 3139 | )?.reply_markup?.inline_keyboard?.[0]?.[0], |
3140 | 3140 | ).toEqual({ |
3141 | | -text: "Add model", |
3142 | | -callback_data: "/models add", |
| 3141 | +text: "openai (1)", |
| 3142 | +callback_data: "mdl_list_openai_1", |
3143 | 3143 | }); |
3144 | 3144 | }); |
3145 | 3145 | |
@@ -3527,8 +3527,8 @@ describe("createTelegramBot", () => {
|
3527 | 3527 | } |
3528 | 3528 | )?.reply_markup?.inline_keyboard?.[0]?.[0], |
3529 | 3529 | ).toEqual({ |
3530 | | -text: "Add model", |
3531 | | -callback_data: "/models add", |
| 3530 | +text: "openai (1)", |
| 3531 | +callback_data: "mdl_list_openai_1", |
3532 | 3532 | }); |
3533 | 3533 | }); |
3534 | 3534 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,10 +10,7 @@ import {
|
10 | 10 | export { buildCommandsPaginationKeyboard }; |
11 | 11 | |
12 | 12 | export function buildTelegramModelsMenuButtons(params: { providers: ProviderInfo[] }) { |
13 | | -return [ |
14 | | -[{ text: "Add model", callback_data: "/models add" }], |
15 | | - ...buildProviderKeyboard(params.providers), |
16 | | -]; |
| 13 | +return buildProviderKeyboard(params.providers); |
17 | 14 | } |
18 | 15 | |
19 | 16 | export function buildTelegramModelsMenuChannelData(params: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -39,7 +39,6 @@ describe("createTelegramPluginBase config duplicate token guard", () => {
|
39 | 39 | expect(channelData).toEqual({ |
40 | 40 | telegram: { |
41 | 41 | buttons: [ |
42 | | -[{ text: "Add model", callback_data: "/models add" }], |
43 | 42 | [ |
44 | 43 | { text: "anthropic (2)", callback_data: "mdl_list_anthropic_1" }, |
45 | 44 | { text: "openai (3)", callback_data: "mdl_list_openai_1" }, |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import { describe, expect, it } from "vitest"; |
| 2 | +import { isLegacyModelsAddCodexMetadataModel } from "./openai-codex-models-add-legacy.js"; |
| 3 | + |
| 4 | +function buildLegacyModel(id: string) { |
| 5 | +return { |
| 6 | + id, |
| 7 | +api: "openai-codex-responses", |
| 8 | +reasoning: true, |
| 9 | +input: ["text", "image"], |
| 10 | +cost: { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 }, |
| 11 | +contextWindow: 400_000, |
| 12 | +contextTokens: 272_000, |
| 13 | +maxTokens: 128_000, |
| 14 | +}; |
| 15 | +} |
| 16 | + |
| 17 | +describe("isLegacyModelsAddCodexMetadataModel", () => { |
| 18 | +it("matches the legacy gpt-5.5-pro models-add fingerprint", () => { |
| 19 | +expect( |
| 20 | +isLegacyModelsAddCodexMetadataModel({ |
| 21 | +provider: "openai-codex", |
| 22 | +model: buildLegacyModel("gpt-5.5-pro"), |
| 23 | +}), |
| 24 | +).toBe(true); |
| 25 | +}); |
| 26 | + |
| 27 | +it("does not match current pro pricing as legacy models-add metadata", () => { |
| 28 | +expect( |
| 29 | +isLegacyModelsAddCodexMetadataModel({ |
| 30 | +provider: "openai-codex", |
| 31 | +model: { |
| 32 | + ...buildLegacyModel("gpt-5.5-pro"), |
| 33 | +cost: { input: 30, output: 180, cacheRead: 0, cacheWrite: 0 }, |
| 34 | +}, |
| 35 | +}), |
| 36 | +).toBe(false); |
| 37 | +}); |
| 38 | +}); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -848,7 +848,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
848 | 848 | defineChatCommand({ |
849 | 849 | key: "models", |
850 | 850 | nativeName: "models", |
851 | | -description: "List model providers/models or add a model.", |
| 851 | +description: "List model providers/models.", |
852 | 852 | textAlias: "/models", |
853 | 853 | tier: "standard", |
854 | 854 | argsParsing: "none", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。