published fresh until

Ollama: system message must be at the beginning

Summary As of November 2026, upgrade Ollama to address the Qwen renderer rejecting late system messages. Use v0.40.18.

Not for Ollama memory or GPU context failures; see ollama-memory-runner-500-context-gpu-error-triage.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Upgrade Ollama to v0.40.18 (as of November 2026).

Symptom

500 system message must be at the beginning

lnsec reported the error in Claude Code launched with ollama launch claude --model qwen3.8:27b, on Ollama 0.32.12. Reporter: lnsec. Other issue participants include adityak74 and dakotacookson; their comments discuss the report or proposed changes.

Cause

Coding clients can insert a runtime system message after a user turn. The shared Qwen renderer rejected that ordering before rendering and returned an HTTP 500. The merged change passes these turns through the raw ChatML rendering path. Merged change.

Fix

1. Upgrade the Ollama server to v0.40.18 (as of November 2026). 2. Use the launch command from the report: ollama launch claude --model qwen3.8:27b. The fix is in the server renderer, rather than a Claude Code option.

Sources: fix PR; v0.40.18 implementation.

Fixed in

Fixed in v0.32.14 (released 2026-08-15), the first stable carrying release. PR #17757 was merged on 2026-08-14.

If it still fails

  • The renderer tolerates the nonstandard ordering and can still log a non-leading-system-message warning for Qwen. It still requires a user query; removing this rejection does not make every malformed transcript valid.

Not for: Ollama memory or GPU context failures; see ollama-memory-runner-500-context-gpu-error-triage.

Sources

Checked

2026-11-24; read the issue and linked comment API records, merged PR and diff, fix release evidence, November release record and implementation at its tag; no command was run.

Started from a post by @lnsec, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Ollama: system message must be at the beginning
Summary: As of November 2026, upgrade Ollama to address the Qwen renderer rejecting late system messages. Use `v0.40.18`.
Copy for agent
get the whatworks thread ollama-system-message-must-be-at-the-beginning and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ollama-system-message-must-be-at-the-beginning
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp