Skip to content

fix: support Pi 0.99.1 native contracts - #636

Merged
tt-a1i merged 4 commits into
openpi-dev:mainfrom
testikun:codex/pi-0-99-compat
Oct 1, 2026
Merged

tt-a1i merged 4 commits into
openpi-dev:mainfrom
testikun:codex/pi-0-99-compat

Conversation

@testikun

@testikun testikun commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

OpenPI main develops against Pi 0.85.1, while newer hosts use native transcript deltas, JSON argument types, execution contexts, and prompt dispositions. Web can report a request as rejected during asynchronous agent_settled handlers even though Pi later executes it. It can also settle handled input while an extension's follow-up remains queued.

Closes #635.

Value

Establish a tested Pi 0.99.1 baseline, preserve provider prompt/tool fidelity and Plan approval, and keep Web admission and completion tied to native execution evidence.

Approach

  • Raise the three Pi SDK development dependencies and peer minimums to 0.99.1. Update the lockfile and documented installation requirements.
  • Replace local transcript replay with Pi's native normalization, system-prompt, and tool-delta helpers. Adapt provider JSON arguments and message-role handling.
  • Use started / queued / handled dispositions, preserving ready Plan approval for handled input and queue tracing when queue length stays unchanged.
  • Observe each Session's native run boundary before binding extensions, including startup and retained runs. Wait past asynchronous settlement before dispatching a new request; settle handled input immediately only when Pi confirms idle.
  • Adapt direct-tool fixtures, use a SessionManager-backed compaction fixture, and verify nested child exclusions, allowlists, and permission hooks for codemode/deferred exposure.
  • Integrate main 657eff9, retaining its Session ownership and compaction queues, and migrate its new admission fixtures to Pi's current contract.
  • Align the real-Pi observer browser fixture with the Web host's abort boundary. Verify that stopping preserves unconsumed native follow-ups and explicit queue clearing removes them without recording them as executed.

The research record preserves the source boundary, validation, and limitations. Removing the local replay and queue-growth heuristic still satisfies the existing acceptance tests. Ablating the idle guard or replacing native Session phase observation with only a Web trace reproduces the lifecycle failures.

Validation

  • bun install --frozen-lockfile passed with the Pi 0.99.1 SDK and native Pi dependency graph.
  • bun run check passed on macOS, Node 24.20.0, and Bun 1.3.14, including Web build, formatting, lint, and types. Generated Web assets match the committed main build.
  • bun run test passed after integration: 2,057 Node tests and 856 Vitest tests; 8 platform-dependent Node tests skipped.
  • Four new real Pi Session tests cover queued handled input and admission during the settlement of Web, extension, and startup runs. Admission stays pending until dispatch, the model executes each request once, and the admitted request retains its command identity through native start and settlement.
  • The original isolated Pi 0.99.1 CLI smoke passed with local fixture responses. All five Plan provider browser tests passed again after integrating main, and the real-Pi observer cancellation/queue-clearing browser test passed.
  • CI for 552ab0e passed all five jobs: Node 22/24/26 checks and full suites with package smoke checks; 78 Web E2E and five Plan provider browser tests; and Windows lifecycle/full-suite isolation checks.
  • Live remote Cursor/Antigravity OAuth requests, interactive TUI visual acceptance, and externally configured MCP servers were not exercised locally.

Impact

  • User-visible behavior: requires Pi 0.99.1 or newer; Web avoids false rejection and premature completion, and handled Plan input preserves Ready state.
  • Model-visible context/tools: providers resolve native prompt sections and tool deltas. Existing OpenPI tool names, schemas, and authority remain in place.
  • Runtime/lifecycle: Pi owns admission and terminal evidence. Native phase subscriptions follow the Session lifetime and are cleared on native disposal; failed binding removes its observer.
  • Persisted config/data: no migration or new package configuration.
  • Compatibility/risk: older Pi hosts are outside the peer range. Local fixture validation does not establish live remote-provider compatibility.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area:workflows Workflow engine, capability, skills, or tests area:subagents Subagent delegation, skills, or tests area:setup OpenPI setup, configuration, or setup documentation area:ui Terminal UI, rendering, themes, or visual assets labels Sep 30, 2026
@testikun testikun self-assigned this Sep 30, 2026
@testikun
testikun marked this pull request as ready for review September 30, 2026 13:57

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 552ab0e. No actionable defect found in the Pi 0.99.1 transcript and native admission changes. 202 focused local tests passed; all current-head CI jobs passed.

@tt-a1i
tt-a1i merged commit b490f39 into openpi-dev:main Oct 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:setup OpenPI setup, configuration, or setup documentation area:subagents Subagent delegation, skills, or tests area:ui Terminal UI, rendering, themes, or visual assets area:workflows Workflow engine, capability, skills, or tests documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade OpenPI’s Pi host baseline to 0.99.1

2 participants