piagent_
← /news
Sep 21, 2026release

pi v0.87.0 makes session context editable and formalizes extension boundaries

pi v0.87.0, published on September 21, 2026, reshapes how session context and the extension lifecycle work. The headline is canonical, editable model context: sessionManager.appendContextEdit(entryId, null) omits one message from future provider context without changing raw history, usage, or UI history, and a new ContextEditEntry joins the session format.

For extension authors, turn_end and agent_before_settle become actionable boundaries: they accept entries plus continue: true, persisting structural entries in order and ensuring one next provider request. The new context_with_system event runs after context handlers on the full transcript including system messages and sends its result verbatim. Image input gets per-model, cache-safe resizing via inputLimits.images.resize in models.json, covering file attachments, image reads, and tool-result images (#9631).

The breaking changes are SDK-facing. The inherited shouldStopAfterTurn agent option is removed in favor of finishTurn, which runs before turn_end, applies its decision afterward, and also receives error and aborted responses. SessionManager becomes canonical for AgentSession provider context, so assigning session.agent.state.messages no longer replaces future request history. TurnEndEvent gains required boundary fields, AgentBeforeSettleEvent joins the ExtensionEvent union, and ExtensionRunner.emit() no longer accepts turn_end — host integrations dispatch through emitBoundary. Deferred runs from agent_settled handlers wait for all settled handlers to finish.

context handlers that filter or slice messages no longer drop the prompt and tool declarations — handlers no longer see system messages, and pi restores the prompt and tool state after they run (#9789, #9822). String context-edit replacements produce valid text blocks, newly appended or replaced input is no longer summarized before its first provider request, and edited-context accounting stops discarding fresh assistant usage or reusing stale usage after compaction. Error retries and final length/overflow recovery stop retaining abandoned model attempts.

The remaining fixes are user-facing: /bug no longer allows uploads in offline mode while preserving local zip exports (#9841), malformed prompt template frontmatter is reported instead of silently ignored (#9830), text files beginning with GIF are no longer misclassified as images (#9755), and inherited unknown OpenAI-compatible Chat Completions endpoints stop receiving strict tool schemas unless they explicitly advertise support (#9816). Idle prompt-cache warming no longer rebuilds expired caches when its timer or an extension decision runs late, and crash diagnostics now hint at loaded extensions in the stack trace. Each of these changes is spelled out on the v0.87.0 release page, with tracking-issue links attached where the notes provide them.

source: https://github.com/earendil-works/pi/releases/tag/v0.87.0