Skip to content

Commit 293d9ce

Browse files
rlaprayclaude
andcommitted
Don't send the developer role to Ollama.
Ollama Cloud returns a 500 for any request that carries both a `developer` role message and an image. The same request succeeds with `system`, and text-only requests with `developer` are fine, so the two only conflict together. pi selects the `developer` role whenever a model reports reasoning support, and the ollama case hardcodes `reasoning: true` for every model, so every image sent to a vision model like gemma4:31b-cloud failed. The case carried no `compat` at all and therefore inherited pi's OpenAI-shaped defaults; Workers AI already pins the same flag just above. Pin the role rather than the `reasoning` capability, which is reported unconditionally and would disable thinking for ollama models that do support it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SetKoutv8UUpQn2MeV66RF
1 parent aedcda8 commit 293d9ce

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/workshop-backend/src/ai-models.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,9 @@ function getModelDirect(config: AiModelConfig, sessionAffinity?: string): ModelH
563563
input: ["text", "image"],
564564
cost: ZERO_COST,
565565
...window,
566+
// Ollama Cloud 500s when a request carries both a `developer` message and an image; pi
567+
// picks that role because we report reasoning: true above, so pin the role, not the flag.
568+
compat: { supportsDeveloperRole: false } satisfies OpenAICompletionsCompat,
566569
},
567570
...(config.apiToken === ""
568571
? { apiKey: "unused", headers: { Authorization: null } }

0 commit comments

Comments
 (0)