pi-mono/packages/ai/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
..
api Anthropic message threads (#11545) 2026-11-03 14:07:57 +01:00
auth fix: harden handling of untrusted URLs, terminal text, and streamed data 2026-10-26 20:46:31 +01:00
compat feat(coding-agent): confirm device-code browser and clipboard actions 2026-10-22 21:38:58 +02:00
providers Anthropic message threads (#11545) 2026-11-03 14:07:57 +01:00
utils Release v1.5.0 2026-11-02 11:38:21 +01:00
bedrock-provider.ts fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
bun-oauth.ts feat(ai,coding-agent): add alternative sign in for the openai provider 2026-09-29 17:16:15 +02:00
cli.ts fix: harden handling of untrusted URLs, terminal text, and streamed data 2026-10-26 20:46:31 +01:00
compat.ts Mid conversation system messages (#9548) 2026-09-16 15:54:07 +02:00
env-api-keys.ts feat(ai): support Azure Foundry Chat Completions deployments (#9714) 2026-10-05 09:46:48 +02:00
image-models.ts feat(ai,coding-agent): unify image and classifier model infrastructure (#9948) 2026-09-23 17:41:19 +02:00
images-api-registry.ts feat(ai,coding-agent): unify image and classifier model infrastructure (#9948) 2026-09-23 17:41:19 +02:00
images.ts feat(ai,coding-agent): unify image and classifier model infrastructure (#9948) 2026-09-23 17:41:19 +02:00
index.ts feat(ai,agent,coding-agent): validate tool arguments with pi-schema, drop TypeBox 2026-11-01 10:08:42 +00:00
legacy-api-aliases.ts fix(ai): restore legacy compat stream aliases 2026-06-23 22:20:20 +02:00
model-catalog.ts feat(ai,coding-agent): unify image and classifier model infrastructure (#9948) 2026-09-23 17:41:19 +02:00
models-store.ts feat(ai,coding-agent): unify image and classifier model infrastructure (#9948) 2026-09-23 17:41:19 +02:00
models.generated.ts feat(ai): refactor provider definitions (#11368) 2026-10-28 11:06:10 +01:00
models.ts feat(ai): add totalFromProvider flag to usage cost (#11178) 2026-10-22 09:02:01 +02:00
oauth.ts feat(coding-agent): replace model registry with model runtime 2026-07-14 17:48:45 +02:00
session-resources.ts fix(coding-agent): decouple codex session cleanup 2026-05-04 00:45:56 +02:00
telemetry.ts fix(ai,chord,durable,coding-agent): parse streamed tool-call arguments incrementally (fixes #9265) 2026-10-24 08:00:07 +00:00
types.ts Anthropic message threads (#11545) 2026-11-03 14:07:57 +01:00