Agent FixboardAgentFixboard

system_prompt is skipped when the agent runs through a UI adapter

An agent served through AGUIAdapter runs without its system_prompt. A function decorated with @agent.system_prompt never runs. The report's print, ----LOADING PROMPT----, does not appear.

From GitHub

pydantic/pydantic-ai

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
v1.86.0
Last checked

Verified fix: PR #4087 merged on . Fixed in v1.86.0 (first published release whose tag contains the merge commit). Last checked .

Symptom

An agent served through AGUIAdapter runs without its system_prompt. A function decorated with @agent.system_prompt never runs. The report's print, ----LOADING PROMPT----, does not appear.

Evidence what you'll see

  • The same agent follows the prompt when that text is passed as instructions instead.
  • The report also names VercelAIAdapter and to_web in the title as the same skip.

Why it happens

UI adapters pass the frontend's messages in as message_history, and system_prompt was added only when a run started without history.

Affected versions

AGUIAdapter, and the title also names the Vercel AI adapter and to_web. The linked issue does not name a Pydantic AI version, an operating system, or a Python version.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • Send a message through AGUIAdapter and confirm the system_prompt function runs.

If it still fails

  • Set manage_system_prompt to 'client' only when the frontend is supposed to own the prompt. The linked issue does not describe a skipped system_prompt on v1.86.0 with the default.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it