Skip to content

Commit d580ec4

Browse files
authored
fix(telegram): show full OpenRouter model labels
Summary:\n- show provider-prefixed fallback labels for nested OpenRouter model ids in Telegram model picker\n- add regression coverage and changelog credit\n\nVerification:\n- pnpm test extensions/telegram/src/model-buttons.test.ts\n- OPENCLAW_TESTBOX=0 pnpm check:changed
1 parent 2c873af commit d580ec4

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Docs: https://docs.openclaw.ai
7272
- MCP/tools: prefix bundle MCP server/tool fragments that would start with digits, keeping generated tool names valid for Moonshot/Kimi and other strict providers. Fixes #79179.
7373
- Models/OpenRouter: treat `403 API key budget limit exceeded` as billing so model fallback advances instead of retrying the exhausted primary. Fixes #60191. Thanks @omgitsgela.
7474
- Models/OpenRouter: repair stale session overrides that lost the outer `openrouter/` provider wrapper, so sessions return to the configured OpenRouter model instead of failing as an unknown direct-provider model. Fixes #78161. Thanks @hjamal7-bit.
75+
- Telegram: show full provider/model labels for nested OpenRouter model ids in the model picker, so `openrouter/openai/gpt-5.4-mini` no longer displays as `openai/gpt-5.4-mini`. Fixes #67792. (#72752) Thanks @iot2edge.
7576
- Kimi Code: use Kimi's stable `kimi-for-coding` API model id in bundled catalog, onboarding, and docs while normalizing legacy `kimi-code` and `k2p5` refs. Fixes #79965.
7677
- Volcengine/Kimi: strip provider-unsupported tool schema length and item constraint keywords for direct and coding-plan models so hosted Kimi runs do not reject message tools with `minLength`. Fixes #38817.
7778
- DeepSeek: backfill V4 `reasoning_content` replay fields for unowned OpenAI-compatible proxy providers, preventing follow-up request failures outside the bundled DeepSeek and OpenRouter routes. Fixes #79608.

‎extensions/telegram/src/model-buttons.test.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,27 @@ describe("buildModelsKeyboard", () => {
264264
expect(result[1]?.[0]?.text).toBe("unknown-id");
265265
});
266266

267+
it("prefixes provider in fallback label for nested provider-local ids (OpenRouter)", () => {
268+
const result = buildModelsKeyboard({
269+
provider: "openrouter",
270+
models: ["openai/gpt-5.4-mini"],
271+
currentPage: 1,
272+
totalPages: 1,
273+
});
274+
expect(result[0]?.[0]?.text).toBe("openrouter/openai/gpt-5.4-mini");
275+
});
276+
277+
it("marks nested provider-local id as current when full ref matches", () => {
278+
const result = buildModelsKeyboard({
279+
provider: "openrouter",
280+
models: ["openai/gpt-5.4-mini"],
281+
currentModel: "openrouter/openai/gpt-5.4-mini",
282+
currentPage: 1,
283+
totalPages: 1,
284+
});
285+
expect(result[0]?.[0]?.text).toBe("openrouter/openai/gpt-5.4-mini ✓");
286+
});
287+
267288
it("uses provider-scoped modelNames keys to avoid cross-provider collisions", () => {
268289
const modelNames = new Map([
269290
["openai/shared-id", "OpenAI Shared"],

‎extensions/telegram/src/model-buttons.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ export function buildModelsKeyboard(params: ModelsKeyboardParams): ButtonRow[] {
217217
}
218218

219219
const isCurrentModel = isCurrentModelSelection({ currentModel, provider, model });
220-
const displayLabel = modelNames?.get(`${provider}/${model}`) ?? model;
220+
const fallbackLabel = model.includes("/") ? `${provider}/${model}` : model;
221+
const displayLabel = modelNames?.get(`${provider}/${model}`) ?? fallbackLabel;
221222
const displayText = truncateModelId(displayLabel, 38);
222223
const text = isCurrentModel ? `${displayText} ✓` : displayText;
223224

0 commit comments

Comments
 (0)