mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 22:24:32 +00:00
revert: per-model thinkingDefault override (#19195)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: fe2c59e222
Co-authored-by: sebslight <19554889+sebslight@users.noreply.github.com>
Co-authored-by: sebslight <19554889+sebslight@users.noreply.github.com>
Reviewed-by: @sebslight
This commit is contained in:
@@ -20,6 +20,7 @@ Docs: https://docs.openclaw.ai
|
|||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
|
- Agents: revert accidental per-model thinkingDefault override merge. (#19195) Thanks @sebslight.
|
||||||
- Voice call/Gateway: prevent overlapping closed-loop turn races with per-call turn locking, route transcript dedupe via source-aware fingerprints with strict cache eviction bounds, and harden `voicecall latency` stats for large logs without spread-operator stack overflow. (#19140) Thanks @mbelinky.
|
- Voice call/Gateway: prevent overlapping closed-loop turn races with per-call turn locking, route transcript dedupe via source-aware fingerprints with strict cache eviction bounds, and harden `voicecall latency` stats for large logs without spread-operator stack overflow. (#19140) Thanks @mbelinky.
|
||||||
- iOS/Onboarding: stop auth Step 3 retry-loop churn by pausing reconnect attempts on unauthorized/missing-token gateway errors and keeping auth/pairing issue state sticky during manual retry. (#19153) Thanks @mbelinky.
|
- iOS/Onboarding: stop auth Step 3 retry-loop churn by pausing reconnect attempts on unauthorized/missing-token gateway errors and keeping auth/pairing issue state sticky during manual retry. (#19153) Thanks @mbelinky.
|
||||||
- Fix types in all tests. Typecheck the whole repository.
|
- Fix types in all tests. Typecheck the whole repository.
|
||||||
|
|||||||
@@ -452,29 +452,10 @@ export function resolveThinkingDefault(params: {
|
|||||||
model: string;
|
model: string;
|
||||||
catalog?: ModelCatalogEntry[];
|
catalog?: ModelCatalogEntry[];
|
||||||
}): ThinkLevel {
|
}): ThinkLevel {
|
||||||
// 1. Per-model thinkingDefault (highest priority)
|
|
||||||
// Normalize config keys via parseModelRef (consistent with buildModelAliasIndex,
|
|
||||||
// buildAllowedModelSet, etc.) so aliases like "anthropic/opus-4.6" resolve correctly.
|
|
||||||
const configModels = params.cfg.agents?.defaults?.models ?? {};
|
|
||||||
for (const [rawKey, entry] of Object.entries(configModels)) {
|
|
||||||
const parsed = parseModelRef(rawKey, params.provider);
|
|
||||||
if (
|
|
||||||
parsed &&
|
|
||||||
parsed.provider === params.provider &&
|
|
||||||
parsed.model === params.model &&
|
|
||||||
entry?.thinkingDefault
|
|
||||||
) {
|
|
||||||
return entry.thinkingDefault as ThinkLevel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Global thinkingDefault
|
|
||||||
const configured = params.cfg.agents?.defaults?.thinkingDefault;
|
const configured = params.cfg.agents?.defaults?.thinkingDefault;
|
||||||
if (configured) {
|
if (configured) {
|
||||||
return configured;
|
return configured;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Auto-detect from model catalog (reasoning-capable → "low")
|
|
||||||
const candidate = params.catalog?.find(
|
const candidate = params.catalog?.find(
|
||||||
(entry) => entry.provider === params.provider && entry.id === params.model,
|
(entry) => entry.provider === params.provider && entry.id === params.model,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ export type AgentModelEntryConfig = {
|
|||||||
params?: Record<string, unknown>;
|
params?: Record<string, unknown>;
|
||||||
/** Enable streaming for this model (default: true, false for Ollama to avoid SDK issue #1205). */
|
/** Enable streaming for this model (default: true, false for Ollama to avoid SDK issue #1205). */
|
||||||
streaming?: boolean;
|
streaming?: boolean;
|
||||||
/** Per-model default thinking level (overrides global thinkingDefault). */
|
|
||||||
thinkingDefault?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AgentModelListConfig = {
|
export type AgentModelListConfig = {
|
||||||
|
|||||||
@@ -38,17 +38,6 @@ export const AgentDefaultsSchema = z
|
|||||||
params: z.record(z.string(), z.unknown()).optional(),
|
params: z.record(z.string(), z.unknown()).optional(),
|
||||||
/** Enable streaming for this model (default: true, false for Ollama to avoid SDK issue #1205). */
|
/** Enable streaming for this model (default: true, false for Ollama to avoid SDK issue #1205). */
|
||||||
streaming: z.boolean().optional(),
|
streaming: z.boolean().optional(),
|
||||||
/** Per-model default thinking level (overrides global thinkingDefault). */
|
|
||||||
thinkingDefault: z
|
|
||||||
.union([
|
|
||||||
z.literal("off"),
|
|
||||||
z.literal("minimal"),
|
|
||||||
z.literal("low"),
|
|
||||||
z.literal("medium"),
|
|
||||||
z.literal("high"),
|
|
||||||
z.literal("xhigh"),
|
|
||||||
])
|
|
||||||
.optional(),
|
|
||||||
})
|
})
|
||||||
.strict(),
|
.strict(),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user