fix: expose ollama thinking profile before activation · openclaw/openclaw@7a9efc1
yfge
·
2026-05-05
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -68,6 +68,7 @@ Docs: https://docs.openclaw.ai
|
68 | 68 | |
69 | 69 | ### Fixes |
70 | 70 | |
| 71 | +- Ollama/thinking: expose the lightweight Ollama provider thinking profile through the public provider-policy artifact too, so reasoning-capable Ollama models such as `ollama/deepseek-v4-pro:cloud` keep `/think max` available even before the full plugin runtime activates. Fixes #77612. Thanks @rriggs. |
71 | 72 | - CLI/sessions: prune old unreferenced transcript, compaction checkpoint, and trajectory artifacts during normal `sessions cleanup`, so gateway restart or crash orphans do not accumulate indefinitely outside `sessions.json`. Fixes #77608. Thanks @slideshow-dingo. |
72 | 73 | - Video generation: wait up to 20 minutes for slow fal/MiniMax queue-backed jobs, stop forwarding unsupported Google Veo generated-audio options, and normalize MiniMax `720P` requests to its supported `768P` resolution with the usual override warning/details instead of failing fallback. |
73 | 74 | - Update/restart: probe managed Gateway restarts with the service environment and add a Docker product lane that exercises candidate-owned `openclaw update --yes --json` restarts, so SecretRef-backed local gateway auth cannot regress behind mocked restart checks. Thanks @vincentkoc. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,6 +27,7 @@ import {
|
27 | 27 | promptAndConfigureOllama, |
28 | 28 | queryOllamaModelShowInfo, |
29 | 29 | } from "./api.js"; |
| 30 | +import { resolveThinkingProfile as resolveOllamaThinkingProfile } from "./provider-policy-api.js"; |
30 | 31 | import { |
31 | 32 | OLLAMA_DEFAULT_API_KEY, |
32 | 33 | OLLAMA_PROVIDER_ID, |
@@ -249,13 +250,7 @@ export default definePluginEntry({
|
249 | 250 | contributeResolvedModelCompat: ({ model }) => |
250 | 251 | usesOllamaOpenAICompatTransport(model) ? { supportsUsageInStreaming: true } : undefined, |
251 | 252 | resolveReasoningOutputMode: () => "native", |
252 | | -resolveThinkingProfile: ({ reasoning }) => ({ |
253 | | -levels: |
254 | | -reasoning === true |
255 | | - ? [{ id: "off" }, { id: "low" }, { id: "medium" }, { id: "high" }, { id: "max" }] |
256 | | - : [{ id: "off" }], |
257 | | -defaultLevel: "off", |
258 | | -}), |
| 253 | +resolveThinkingProfile: resolveOllamaThinkingProfile, |
259 | 254 | wrapStreamFn: createConfiguredOllamaCompatStreamWrapper, |
260 | 255 | createEmbeddingProvider: async ({ config, model, provider: embeddingProvider, remote }) => { |
261 | 256 | const { provider, client } = await createOllamaEmbeddingProvider({ |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-types"; |
2 | 2 | import { describe, expect, it } from "vitest"; |
3 | | -import { normalizeConfig } from "./provider-policy-api.js"; |
| 3 | +import { normalizeConfig, resolveThinkingProfile } from "./provider-policy-api.js"; |
4 | 4 | import { OLLAMA_DEFAULT_BASE_URL } from "./src/defaults.js"; |
5 | 5 | |
6 | 6 | function createModel(id: string, name: string): ModelDefinitionConfig { |
@@ -58,4 +58,15 @@ describe("ollama provider policy public artifact", () => {
|
58 | 58 | }), |
59 | 59 | ).toEqual({}); |
60 | 60 | }); |
| 61 | + |
| 62 | +it("exposes max thinking for reasoning-capable models without full plugin activation", () => { |
| 63 | +expect(resolveThinkingProfile({ reasoning: true })).toEqual({ |
| 64 | +levels: [{ id: "off" }, { id: "low" }, { id: "medium" }, { id: "high" }, { id: "max" }], |
| 65 | +defaultLevel: "off", |
| 66 | +}); |
| 67 | +expect(resolveThinkingProfile({ reasoning: false })).toEqual({ |
| 68 | +levels: [{ id: "off" }], |
| 69 | +defaultLevel: "off", |
| 70 | +}); |
| 71 | +}); |
61 | 72 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import type { ProviderThinkingProfile } from "openclaw/plugin-sdk/plugin-entry"; |
1 | 2 | import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-types"; |
2 | 3 | import { OLLAMA_DEFAULT_BASE_URL } from "./src/defaults.js"; |
3 | 4 | |
4 | 5 | type OllamaProviderConfigDraft = Partial<ModelProviderConfig>; |
5 | 6 | |
| 7 | +const OLLAMA_REASONING_THINKING_PROFILE = { |
| 8 | +levels: [{ id: "off" }, { id: "low" }, { id: "medium" }, { id: "high" }, { id: "max" }], |
| 9 | +defaultLevel: "off", |
| 10 | +} satisfies ProviderThinkingProfile; |
| 11 | + |
| 12 | +const OLLAMA_NON_REASONING_THINKING_PROFILE = { |
| 13 | +levels: [{ id: "off" }], |
| 14 | +defaultLevel: "off", |
| 15 | +} satisfies ProviderThinkingProfile; |
| 16 | + |
6 | 17 | /** |
7 | 18 | * Provider policy surface for Ollama: normalize provider configs used by |
8 | 19 | * core defaults/normalizers. This runs during config defaults application and |
@@ -38,3 +49,11 @@ export function normalizeConfig({
|
38 | 49 | |
39 | 50 | return next; |
40 | 51 | } |
| 52 | + |
| 53 | +export function resolveThinkingProfile({ |
| 54 | + reasoning, |
| 55 | +}: { |
| 56 | +reasoning?: boolean; |
| 57 | +}): ProviderThinkingProfile { |
| 58 | +return reasoning ? OLLAMA_REASONING_THINKING_PROFILE : OLLAMA_NON_REASONING_THINKING_PROFILE; |
| 59 | +} |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。