Repository navigation
fix(pi): recover rejected inputs and clear stale cancellation - #617
Merged
Merged
Conversation
stamp-build
Bot
force-pushed
the
agent/otter/pi-turn-release
branch
from
November 5, 2026 05:18
c6729c7 to
5c7998b
Compare
stamp-build
Bot
force-pushed
the
agent/otter/pi-turn-release
branch
from
November 5, 2026 06:28
5c7998b to
8375050
Compare
added 4 commits
November 5, 2026 08:08
stamp-build
Bot
force-pushed
the
agent/otter/pi-turn-release
branch
from
November 5, 2026 08:12
d275519 to
de8cdda
Compare
Merged
stamp-build Bot
added a commit
that referenced
this pull request
Nov 5, 2026
<!-- stamp:review:v1 --> <sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_b6cea2eb70db20fefc1fe4212bbebdaf"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup> --- <!-- /stamp:review:v1 --> Patch release: a host can use its own, newer Pi executable, Pi sessions recover from a refused prompt, and two Codex startup problems are fixed. ## Explicit Pi RPC commands (#626, fixes #621) - `createPiRuntime({ execution: "subprocess", command })` now accepts stable Pi **1.4.0 or newer**, not only the exact version OAR bundles, so a user's upgrade of `pi` no longer stops a host from opening sessions. - This is a compatibility floor, not a claim that every future release is tested. Native controls passed on explicit 1.4.0 and 1.5.0 on Linux x64; older explicit versions are unverified on macOS and Windows. - A missing, unparsable or older version throws `RuntimeFailureError` with `failure: "invalid_request"`, naming the actual and required versions. It was a plain `Error` before. - The default path without `command` still requires OAR's exact bundled Pi. ## Pi SDK and RPC recovery (#617) - A prompt Pi refuses before starting no longer strands queued input: the refusal is recorded and the queue drains. - A cancellation requested for a refused prompt no longer ends the next run. - On RPC, an abort during the terminal statistics window no longer kills a healthy child about 10 seconds later. - On SDK, disposing during pending admission now answers `disposed`, and a late failure cannot settle a later run started by an extension. ## Codex startup (#627) - A refused thread name no longer fails the open. Older app-servers lack `thread/name/set`, so every start with a `name` failed on them. Codex's error is now recorded as a `thread/name/set/error` frame with no events; a lost connection still fails. - The app-server now starts in `SessionOptions.cwd` rather than the host's directory, so stdio MCP servers and a relative `CODEX_HOME` resolve there. - **Behaviour change:** a session directory that does not exist now fails the open with `Codex session directory does not exist`. Codex 0.163.0 accepted that open before. ## Documented limits - Synchronous next prompt from a `turn_ended` observer stays unsupported on Pi SDK and RPC: status can read `idle` while `prompt` returns `busy`. Submit after the observer returns. The reasoning and what would reopen it are in `docs/design/decisions.md`. - Extension-handled input can leave status provisionally `running` with no native run; the gate itself still accepts the next input. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Cindy <[email protected]>
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.
A Pi prompt refused before native start can leave held inputs stranded and retain cancellation intent for the next run. Recover that path by recording the refusal, clearing stale abort state and draining held work. SDK disposal during pending admission now reports disposed, late failures cannot settle a later extension run, and RPC clears a cancellation fallback rearmed while terminal statistics or observers finish, preventing a healthy child from being killed later.
Ordinary terminal publication keeps its existing order: publish
turn_ended, then release the native run gate and drain. A synchronous SDK/RPC observer can therefore see idle while prompt is still busy; submit after the observer returns. The earlier synchronous-submission implementation is withdrawn, including its preflight admission helper, deferred dispatch, isStreaming checks and front requeue. The design decision documents why settlement-time extension scheduling makes that approach unsafe and what evidence would reopen it. Pi Durable product behavior is unchanged.Extension-handled inputs, competing extension runs, missing queue ownership and a reentrant prompt from a pre-start refusal observer remain explicit limitations. Task #173 owns their separate record/ownership design. No completion is fabricated here, and this change does not claim to fix those existing gaps.
Validation on main
91c626a5:Task #162, intended for 0.87.2 with #626. No package version or release tag change. Windows/macOS results require this head's CI.
Rebased after #626; all four commit patches are unchanged.