Skip to content
AIBRAINWORX / OpenSourceCoder.comLOCAL-FIRST. BUILT IN THE OPEN.
Open Source

Pydantic AI 2.77 makes compaction and delegated instructions more explicit

The agent framework adds observable history compaction and preserves parent authority when delegating work to another directory.

Listen to this articleBrowser Voice
Ready
Original explanatory diagram of compaction and delegated workspace authority, not a runtime screenshot.
Original explanatory diagram of compaction and delegated workspace authority, not a runtime screenshot. · Genuine official project mark for editorial identification; no endorsement implied.
Event / context: 2026-11-27. Source check: Nov 27, 2026.

Pydantic AI 2.77.0, published November 27, brings two consequential changes to long-running agents: a first-class way to request and observe conversation compaction, and stricter rules for treating delegated workspace files as instructions. Neither change makes an agent automatically trustworthy, but both make important behavior easier to inspect.

Compaction becomes an explicit operation

The release introduces a compact_history() capability hook, RunContext.request_compaction(), and start/end events. Applications can distinguish an actual compaction operation from ordinary response generation rather than infer it from a shorter history.

Those events are conditional: existing streams do not suddenly compact just because the package was upgraded. Something must request compaction or supply the relevant hook. However, code that exhaustively matches the event union may need updating to handle its new variants.

The tagged documentation distinguishes provider-native compaction from model-agnostic editing. NativeCompaction asks the model serving the next request to compact when its profile supports that operation. The documented routes include OpenAI Responses on OpenAI and Azure, and supported Anthropic models. Other models fall through so another capability can handle compaction.

This is history management, not an enlargement of the underlying model's context window. Summarizing or trimming older material necessarily changes what remains available. Recent context and tool-call integrity are therefore practical design concerns, even when the provider supplies the summarizer.

A new directory should not silently gain authority

A separate included change skips disk sub-agent definitions below operator authority. The tagged loader checks authority before reading a definition whose body would become the delegate's instructions; a skipped definition produces a warning.

Delegates given a working directory also inherit a conservative authority bound from the parent. A directory outside the parent's workspace defaults to no instruction authority unless an applicable path-authority entry grants it. Moving work to another checkout is not, by itself, permission to promote that checkout's instructions.

Applications that intentionally relied on those definitions need to review their configured trust boundaries. Durable runs using disk agent definitions also need the upgrade coordination described in the release notes; allowing in-flight work to finish or using the relevant worker-versioning mechanism avoids treating this as a trivial hot swap.

Our analysis

The useful common thread is explicit state. Compaction changes the agent's available history; delegation changes which files it encounters. Both deserve visible application policy rather than an assumption that a framework will infer the right decision. The new hooks and authority rules provide places to express that policy, not proof that every prompt-injection or memory-loss problem is solved.

Inspect the source through our Pydantic AI repository profile. The framework is MIT licensed; provider access and model terms remain separate. We reviewed the release, tagged documentation and relevant implementation without running agents or provider calls.

EXPLORE THE SOURCE

GitHub repositories

Independent primary-source review. No upstream tests, inference, installations, weight downloads or hardware benchmarks performed. Publisher measurements are not independent validation.

Follow your curiosity.

Pass the signal.