# What changed in @earendil-works/pi-ai

> 67 changes in @earendil-works/pi-ai 0.78 to 1 from its official release notes, upgrade guides and advisories: 13 breaking, 4 security, 18 new APIs and options. Each one cited. Sources checked 2026-10-28. HTML: https://unstale.sh/npm/@earendil-works/pi-ai/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @earendil-works/pi-ai 1

### Breaking changes

- Replaces TranscriptTools.anchorsAdditions with a count of leading system messages folded into requestTools. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Exports formatUserAgent() for formatting the User-Agent. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- The utility getPiUserAgent() is removed; use formatUserAgent(). (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Removed from the openai-codex provider listing because the Codex backend rejects it for ChatGPT accounts. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Removed from the openai-codex provider listing because the Codex backend rejects it for ChatGPT accounts. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Now takes a TranscriptToolSupport value of "none", "additions", or "changes" instead of a boolean. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Replaces the provider request option telemetryContext with telemetry?: TelemetrySpan, without a compatibility alias; pass a parent span rather than an adapter. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- The default User-Agent changes to include the version and runtime, with a different format. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Malformed final JSON tool-call arguments now carry argumentsError and fail validation with the raw arguments text, so the model sees what it sent. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Removed this API, which was only used by the removed experimental agent harness. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Removed this API, which was only used by the removed experimental agent harness. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Overrides of the kimi-coding base URL must now include /v1. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Removed this API, which was only used by the removed experimental agent harness. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)

### New APIs and options

- Adds the AI_TELEMETRY_SCHEMA export for opt-in request and poll tracing. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Adds the @cf/cloudflare/clef-omni and typesafe/jev-1.14.0 classifier models. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Exports getIdentityHeaders(). (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Exports getOpenCodeSessionHeaders(). (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Adds an identity request option and createModels({ identity }) default to choose the User-Agent and provider attribution headers. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Exports mergeClientIdentity(). (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Adds MiniMax-M3.1-Flash to minimax and minimax-cn, with thinking levels low through max sent as output_config.effort; thinking cannot be turned off. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Exports PI_AI_VERSION. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Exports PI_ATTRIBUTION. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Adds opt-in poll tracing around Models requests with content-free attributes and metrics. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Adds opt-in request tracing around Models requests with content-free attributes and metrics. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Adds classifier model compatibility configuration, including imageInput and sendImageOptInHeader; models without it detect the form from provider, baseUrl, and model ID. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Opts in to experimental Jev image input on typesafe. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Applies an identity to a Models or MutableModels instance received from a host. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Grok 4.3 and Grok 4.5 on xai now offer the xhigh thinking level, matching xAI's supported reasoning efforts. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Controls cache-preserving thinking level changes for GPT-6 models on the openai provider; with an API key, the level is sent as configuration_update input items instead of changing reasoning.effort. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Adds a function that narrows an OpenRouter catalog to chat models a key may use, using that key's context size, max output, and prices. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#120---2026-10-12)
- Adds the registered provider's base URL, including configuration overrides applied by wrappers, so dynamic catalogs can follow a base URL set in models.json. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#120---2026-10-12)

### Behavior and default changes

- These errors are not retried and tell the user to ask their workspace admin to increase the limit. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Adds image input for System One classifiers on Jev, Clef, cloudflare-workers-ai, and eligible OpenRouter decision models, using service-specific wire forms. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- New MiniMax models from models.dev now appear without a manual allowlist entry; only older listed models stay hidden. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Failed model request spans report provider_error status with up to 500 error-message characters. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Bedrock, OpenRouter image generation, pi-messages, and classifier requests now send pi's User-Agent. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Uses OpenAI Chat Completions at https://api.kimi.com/coding/v1; K3, K3-256K, and Kimi For Coding accept tools added mid-conversation without invalidating the prompt cache. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Drops thinking blocks from earlier assistant messages produced by a different model instead of sending them as plain text. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)

### Fixes and other changes

- Retries now trigger for gateway upstream failures such as upstream_error, upstream_stream_read_error, and Upstream HTTP/2 stream failed. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Retries now trigger when Google Vertex OAuth token refresh fails with a transient network error. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Retries now trigger for stream disconnected before completion errors relayed by proxies wrapping the Codex CLI. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Digits in request IDs and other numbers are no longer incorrectly treated as retryable HTTP status codes. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Corrects Clef Flash pricing and context window, and Jev input-token pricing. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Any HTTP 413 now counts as context overflow, allowing callers to compact and retry instead of failing on oversized Copilot requests. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Tool loads no longer rewrite the top-level tool list and lose the prompt cache after a removal; tool declarations and anchoring behavior are corrected. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- OpenAI Completions, OpenAI Responses, and Google providers now use the empty-output placeholder instead of sending whitespace-only tool content. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Models requests with a sessionId to custom providers pointing at opencode.ai now send the x-opencode-session header. (1.4.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#140---2026-10-21)
- Avoids 400 errors when an error tool result contains images by sending the images after the tool results of the turn. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Retries when gateway errors say Unable to forward upstream stream. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Retries when errors say The service is temporarily unavailable; this also prevents compaction from failing on the first attempt. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- For Claude Haiku 5.5 and Claude Opus 5, off sends thinking: {type: "disabled"} without effort settings. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Uses the 500K context window Codex now provides instead of a 272K context window. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Avoids showing thinking after the answer when a proxy sends reasoning and content in the same stream chunk. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Gemini models use the opencode.ai/inference endpoint, and the provider now supports Google Generative AI. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Uses the Anthropic Messages API to avoid the “Model does not support this protocol” failure. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Moved to the opencode.ai/inference endpoint. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Gemini 4 and later models send thinkingLevel, fixing Vertex requests and ensuring the thinking level is not ignored on the Gemini API. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- No longer drops fields when a string contains an invalid \u escape such as \usepackage. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Sends only the documented thinking on/off toggle and exposes only the off and high levels, fixing 400 errors at minimal. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#130---2026-10-15)
- Streams are no longer aborted mid-generation after the request timeout; the timeout now applies only while waiting for response headers. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#120---2026-10-12)
- OpenRouter's negative placeholder prices are now treated as 0, preventing router models such as openrouter/auto from showing a cost of -$1,000,000 per 1M tokens. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#120---2026-10-12)
- When Anthropic rejects a strict tool set for grammar size, tool count, or union limits, requests retry once with preferred tools non-strict while keeping required tools strict. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#120---2026-10-12)
- “The upstream provider returned an error” is now retried as a transient provider error. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/2e0f175bd58752ad4123aa12c2f3979839003dc7/packages/ai/CHANGELOG.md#120---2026-10-12)

## @earendil-works/pi-ai 0.79

### Security

- Pi Agent: Pi loads project-local extensions without approval (0.79.0) — [security advisory](https://github.com/advisories/GHSA-MQXH-6GQ7-558M)

## @earendil-works/pi-ai 0.78

### Security

- Pi Agent: Potential XSS in HTML session exports via Markdown URL sanitization bypass (0.78.1) — [security advisory](https://github.com/advisories/GHSA-7V5M-PR3Q-6453)
- Pi Agent: Predictable temporary extension install paths allow local privilege escalation on shared Linux hosts (0.78.1) — [security advisory](https://github.com/advisories/GHSA-JFGX-WXX8-MP94)
- Pi Agent: Race condition in Pi auth.json writes could expose stored credentials (0.78.1) — [security advisory](https://github.com/advisories/GHSA-R95R-RJ6R-C39X)
