pi-mono/packages/agent/src
David Brailovsky a758f3ae4c
Anthropic message threads (#11545)
Anthropic can keep a conversation on the server (message threads beta).
A request can then continue from the previous reply and send only the
new messages, instead of the whole history every turn.

pi uses this when a session id is set and caching is on. It still builds
the full request, compares it with the previous one, and only sends the
new part if nothing earlier changed.

- Default: on only for the anthropic provider on api.anthropic.com.
  Gateways that drop unknown fields would lose the conversation.
  Override with compat.supportsMessageThreads.
- If the server rejects a continuation, pi resends the full request
  as a new thread. Other errors turn threads off for the session.
- New option StreamOptions.disableContinuation. The cache warmer sets
  it so warm requests don't replace the session's thread.
- cleanupSessionResources(sessionId) frees a session's thread state.
2026-11-03 14:07:57 +01:00
..
agent-loop.ts fix(ai,agent,coding-agent,durable): client identity follow-ups 2026-10-21 11:18:16 +00:00
agent.ts fix(ai,agent,coding-agent,durable): client identity follow-ups 2026-10-21 11:18:16 +00:00
index.ts feat(agent): remove the experimental harness from pi-agent-core 2026-10-01 14:45:01 +02:00
proxy.ts Anthropic message threads (#11545) 2026-11-03 14:07:57 +01:00
stream-fn.ts fix(agent): restore streamFn extension compatibility 2026-07-21 18:37:07 +02:00
types.ts feat(agent): pi-schema's Static types TypeBox-built schemas too, without depending on TypeBox 2026-11-01 11:12:44 +00:00