Repository navigation
chore(deps): upgrade pi to 1.2.0 - #723
Merged
Merged
Conversation
Rinat S (rsolmano)
requested review from
Olga Lavrichenko (OLavrik),
Rustam Sadykov (SBOne-Kenobi) and
danyaberezun
as code owners
October 13, 2026 10:59
This was referenced Oct 13, 2026
🌐 Website previewPreview retired when this pull request closed. |
2 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fresh installs of pi 1.1.0 stopped working on 2026-10-13:
@earendil-works/pi-coding-agent@1.1.0depends on@earendil-works/pi-codemode@^1.1.0, which now resolves to the newly published 1.2.0, and 1.1.0's bundledcodemode tool imports
MCP_TYPESCRIPT_PREAMBLE/mcpStructuredContentSchemathat 1.2.0'sdeclarationsentry no longer exports. The result is aSyntaxErroron import under Node, so thecheck:pi-packagesparity gate (vanilla pi under Node) fails on every PR, includingmain.Pi 1.2.0 also carries MCP fixes ThinkRail wants: cancelled/timed-out MCP calls are no longer sent after
an OAuth refresh, an unverifiable OAuth
issis rejected, servers with resources register their toolswithout listing every resource first, and
structuredContentaccepts any JSON value.Approach
Move the whole pinned pi family (
pi-coding-agent,pi-ai,pi-agent-core,pi-tui) to exact 1.2.0 inthe root catalog so the transitive
pi-mcp/pi-codemode/pi-telemetryresolve coherently. Theupgrade needs exactly one runtime adaptation:
before_agent_starton andcalls
preflightResultinside that busy span, outside its try/finally. The old mechanism — throwing frompreflightResultwhen the child's run was cancelled during preflight — therefore left the child busyforever (5 pi-delegation/pi-dag tests hung). A prompt whose run was cancelled is now dropped by an internal
inputhandler every child loads after its own extensions: no user message is written, no request ismade, and the child stays reusable. Cancellation is still reapplied at
agent_startfor the remainingwindow. Rationale is in
packages/pi-delegation/SPEC.md.Everything else was audited and intentionally left unchanged:
before_agent_startis now a union onmessageTypeand also fires for extension-triggered runs. Thefive handlers (
titleTool,pi-thinkrail-workflow,pi-todos,spec-graph,pi-subagents) only addsystem-prompt sections or re-register a tool and never read
prompt, so applying them to custom-messageruns is the behavior pi intends; the workflow test gained the discriminant and a custom-run case.
noThemes; the headless theme is constructeddirectly).
serializeConversationand the widenedstructuredContentneed no code change here.packages/server/src/agent/SPEC.mdcorrects the reload-gate wording for pi 1.2's busy-at-start semantics.The MCP stack (#691–#695) is rebased on this branch and re-checks its pi adaptations against 1.2.0 in its
own commits; nothing MCP-specific lives here.
Changes
package.jsoncatalog: pi family 1.1.0 → 1.2.0;bun.lockregenerated (pi-mcp,pi-codemode,pi-telemetry1.2.0;@earendil-works/chordand the removed experimental packages leave the lockfile).packages/pi-delegation/src/service.ts+SPEC.md:input-handler drop replaces the throwingpreflightResult;extensionFactoriesis always passed.packages/pi-thinkrail-workflow/index.test.ts+SPEC.md:messageTypediscriminant, custom-run coverage.packages/server/src/agent/SPEC.md: reload-gate idle wording.packages/pi-dag/extension/adapter.test.ts: the 128-node / >64 KiB snapshot test gets a 30 s budget. It runs in ~0.3 s locallybut 1.1–8.4 s on CI runners (on
mainand on these branches alike) against Bun's 5 s default, and timed out twice in thisPR's and the stack's CI runs; the assertion is unchanged.
Screenshots
Not applicable — no frontend changes.
Related issues
None.
Testing
All isolated:
env -i, freshHOME/PI_CODING_AGENT_DIR/THINKRAIL_DATA_DIR,PI_OFFLINE=1, pinned Bun 1.4.0, Node 22.19.0.bun install→ lockfile regenerated;bun run check:deps→ OK (23 catalog entries)bun run typecheck→ 20/20;bun run lint→ clean;check:boundaries/check:seams/check:spec-surface/check:compiler→ greenbun run test→ 20/20 package tasks, 0 failures (before the delegation fix: pi-delegation 2 and pi-dag 3 failed/hung)bun run check:pi-packages→ OK, pi 1.2.0 under Node 22.19 — the gate that fails onmaintodaybun run e2e(4 lanes, standard retries) → 542 passed + 1 flaky (chat-scrolltouch-momentum, a knownbaseline flake that also reproduces on clean
main; passed on retry)bun apps/cli/scripts/build-binary.ts && bun run smoke:binary→ passedmainbf4da661(fix(server): keep the attention dot off while background commands or subagents run #716):turbo run typecheck --filter='!@thinkrail/desktop'→ 19/19 (thedesktop
electrobun preparestep was blocked by another local worktree'selectrobun dev; it passed before therebase and fix(server): keep the attention dot off while background commands or subagents run #716 does not touch desktop) and
bun run test→ see the CI run for this head; the rebased MCP stackbuilt on this exact commit passed the complete bar again (gates 20/20, units 20/20,
bun run e2e551 passed + the sameflaky, binary smoke)
bun run e2e:full e2e/agent.live.spec.ts e2e/queue.live.spec.ts e2e/chat-resources.live.spec.ts e2e/tool-cards.live.spec.ts e2e/subagents.live.spec.ts→ 11 passedhandler scope/ordering, residual abort window) → no findings
Checklist
bun run lint,bun run typecheck,bun run testbun run e2e, orbun run e2e:fullwhen touching agent behavior)SPEC.md/ top-level specs updated to reflect any boundary, contract, or behavior change