mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 02:40:43 +00:00
fix(model): preserve LM Studio '@' quant suffixes in model name resolution
stripModelProfileSuffix() in providers.ts naively truncated model names at the first '@', discarding quant variants like @iq3_xxs, @iq4_xs, @q4_k_xl that LM Studio uses to distinguish quantization levels. This caused two user-facing bugs (fixes #71474): 1. /model lmstudio/qwen3.6-27b@iq3_xxs → 'model not allowed: lmstudio/qwen3.6-27b' 2. API requests sent truncated model name → LM Studio picked a random quant Changes: - Replace the naive indexOf('@') strip in providers.ts with splitTrailingAuthProfile() which already handles quant suffixes - Extend the quant-suffix regex (q\d+...) to also match importance- quantization tags (iq3_xxs, iq4_xs, ...) via i?q\d+ pattern - Add tests for @iq* quant suffixes and auth-profile-after-iq combos
This commit is contained in:
committed by
Peter Steinberger
parent
94ceb2bbe9
commit
5bb78ea7ed
@@ -1,3 +1,4 @@
|
||||
import { splitTrailingAuthProfile } from "../agents/model-ref-profile.js";
|
||||
import { normalizeProviderId } from "../agents/provider-id.js";
|
||||
import { withBundledPluginVitestCompat } from "./bundled-compat.js";
|
||||
import { resolveEffectivePluginActivationState } from "./config-state.js";
|
||||
@@ -353,9 +354,7 @@ function resolveManifestRegistry(params: {
|
||||
}
|
||||
|
||||
function stripModelProfileSuffix(value: string): string {
|
||||
const trimmed = value.trim();
|
||||
const at = trimmed.indexOf("@");
|
||||
return at <= 0 ? trimmed : trimmed.slice(0, at).trim();
|
||||
return splitTrailingAuthProfile(value).model;
|
||||
}
|
||||
|
||||
function splitExplicitModelRef(rawModel: string): { provider?: string; modelId: string } | null {
|
||||
|
||||
Reference in New Issue
Block a user