piagent_
← /news
Sep 16, 2026community

pi records mid-conversation system messages in the transcript, fails user bash commands closed on hook errors, and skips transcript scans for exact session IDs

pi merged three pull requests on September 16, 2026 — a feature and two issue-linked fixes. mitsuhiko, Earendil’s co-founder, contributed #9548, which records mid-conversation system messages as transcript state instead of silently rewriting a conversation’s starting conditions. christianklotz’s #9662 stops a crashing routing extension from silently running a user’s bash command on the host, and metaist’s #9601 removes a whole-transcript startup scan that slowed as sessions piled up.

#9548 records the initial system prompt and complete tool definitions in the first system message, then appends a system message before the next model response whenever instructions or tools change — including changes tools make mid-run. Tool activation no longer rides on tool results. Unchanged state adds no message; every change is a section diff: updates repeat only changed sections, removals are marked null, and toolsAdded and toolsRemoved are listed.

Models without support fall back through collapseSystemMessages(): prompt and tools fold into the leading system message. A catalog flag (supportsMidConvoSystemMessages) marks verified models — GPT-5.x and GPT-6 Astra on OpenAI Responses, Kimi K3 and DeepSeek V4 Pro on Chat Completions, Opus 4.8 and 5 and Fable 5/5.1 on Anthropic — while Google/Gemini, Vertex, Bedrock Converse, and unflagged models collapse. The default prompt becomes a fixed introduction plus named XML-style sections (<tools>, <rules>, <docs>, an optional <addendum>, <project_context> and <skills>, <cwd>), the tool-result-based deferred-loading mechanism is removed, and compaction entries gain a systemMessage checkpoint. Cache preservation is endpoint-dependent, not universal, the PR says. A rider fix gates OpenRouter configuration_update messages on anthropic/claude-opus-5, which 400’d on main.

#9662 fixes #9068, where an exception in a user_bash routing handler — say, one routing ! and !! commands into an isolated VM — left pi running the command through its default local shell. Now !, !!, and RPC bash commands fail when a handler throws. Handlers returning undefined keep the explicit local fallback, and the breaking change ships with a documented migration path.

#9601 fixes #9440, where a --session-id startup scanned every transcript — an extension with 4,000+ transcripts measured ~16-second starts. The fix reads session headers by exact session-ID lookup, going synchronous for better subsequent cache hits. The microbenchmark puts lookups at 3.5 seconds instead of 68.1 — roughly 19.5x faster — still linear in transcript count, per the PR.

Until the next tag after v0.85.1, all three live only on main. #9068 and #9440 hold the before pictures for both fixes.

source: https://github.com/earendil-works/pi/pulls?q=is%3Apr+merged%3A2026-09-16+is%3Aclosed