fix(session): respawn pi when New Task runs with a dead process - #40
Merged
Merged
Conversation
The New Task button only checked for a turn in flight, so with pi exited and the reconnect banner up it sent `new_session` into the dead process's stdin — a write nobody answers — and no fresh session started. Route New Task (and a workspace group's "+") through `can_reuse_session()`: reuse the live process only when it is alive and idle, otherwise start the task on a fresh one. A dead process is dropped instead of parked, and dropping it clears its stale exit banner. Closes #30
Every push and pull request now builds the app on all three shipped platforms instead of macOS alone, so a change that only compiles on one OS fails the check. The Linux job installs the same system libraries the release bundle uses; clippy stays a single macOS run (informational).
imrj05
marked this pull request as ready for review
September 28, 2026 16:56
rj05xdev
previously approved these changes
Sep 28, 2026
The "Protect Main Branch" ruleset requires a status check named `build`, but the matrix legs report `build (macos-latest)` / `build (ubuntu-22.04)` / `build (windows-latest)`, so the required context was never reported and every PR sat on "Expected — Waiting for status to be reported". Add a fan-in job named `build` that needs the platform matrix and runs unconditionally (`always()`), failing when the matrix did not succeed. The required check now means "all three platforms built", stays stable when the matrix changes, and can never hang waiting.
rj05xdev
approved these changes
Sep 28, 2026
3 of 15 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.
Summary
Fix #30: when New Task runs while the session's
piprocess has already exited,orbit-pireused the stale handle and the task never started. The session now detects the dead process and respawnspibefore launching the new task.crates/orbit-pi/src/app/session.rs: check liveness of thepichild before starting a new task and respawn it when it has exited.crates/orbit-pi/src/app/runtime.rs: add the helper used by the session to detect and respawn the runtime.crates/orbit-pi/src/app/new_task_reconnect_tests.rs: regression tests covering the New Task path with a dead process..github/workflows/ci.yml: build the workspace on macOS, Linux, and Windows.CHANGELOG.md,AGENT.md: record the fix and the reconnect behavior.Related issue
Closes #30
Type of change
Checklist
cargo build --workspaceis clean (zero warnings)cargo test --workspacepasses (pi-dependent tests may skip)cargo clippy --workspace --all-targetshas no new warningspiremains the only agent runtime (JSONL RPC over stdio)unsafewithout a commentINTENT.md→ Implementation status updated (and aD#decision added or revised if the architecture changed)README.mdfeatures/roadmap andCHANGELOG.md[Unreleased]updatedScreenshots / recordings
None — no UI changes.