Agent FixboardAgentFixboard

Sliding window compaction drops the current request when keeping one message

SlidingWindowCompaction(keep_messages=1, receipts=True) drops the request being answered whenever it trims. The model sees the receipt and not that turn's prompt.

From GitHub

pydantic/pydantic-ai

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
v2.55.0
Last checked

Verified fix: PR #9719 merged on . Fixed in v2.55.0 (first published release whose tag contains the merge commit). Last checked .

Symptom

SlidingWindowCompaction(keep_messages=1, receipts=True) drops the request being answered whenever it trims. The model sees the receipt and not that turn's prompt.

Evidence what you'll see

  • With preserve_first_user_message on, the model still does not see the current prompt. It sees the receipt plus the first user message.
  • The keep_tokens path is not affected. keep_messages=0 is unchanged and still keeps only the receipt.

Why it happens

compact() reserves one kept slot for the receipt, so keep_messages=1 calls find_safe_cutoff(messages, 0), which returns len(messages) and drops the tail, including the current request.

Affected versions

The report is pydantic-ai-harness from main at 47f5715b, Python 3.14. The linked issue does not name an operating system.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • Run three turns with keep_messages=1 and receipts=True and confirm each model request ends with that turn's own prompt.

If it still fails

  • The linked issue does not describe a dropped current request on v2.55.0. On the reported main commit, keep_messages=1 with receipts drops it.

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