Skip to content

fix(session): respawn pi when New Task runs with a dead process - #40

Merged
imrj05 merged 3 commits into
mainfrom
fix/issue-30-new-task-reconnect
Sep 28, 2026
Merged

imrj05 merged 3 commits into
mainfrom
fix/issue-30-new-task-reconnect

Conversation

@imrj05

@imrj05 imrj05 commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

Fix #30: when New Task runs while the session's pi process has already exited, orbit-pi reused the stale handle and the task never started. The session now detects the dead process and respawns pi before launching the new task.

  • crates/orbit-pi/src/app/session.rs: check liveness of the pi child 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

  • Bug fix
  • New feature
  • Refactor / performance
  • Documentation
  • Chore / tooling

Checklist

  • cargo build --workspace is clean (zero warnings)
  • cargo test --workspace passes (pi-dependent tests may skip)
  • cargo clippy --workspace --all-targets has no new warnings
  • No web UI reintroduced (GPUI only — no React, Tauri, webview, DOM, Node tooling)
  • pi remains the only agent runtime (JSONL RPC over stdio)
  • No new dependency without a stated reason
  • No unsafe without a comment
  • INTENT.md → Implementation status updated (and a D# decision added or revised if the architecture changed)
  • README.md features/roadmap and CHANGELOG.md [Unreleased] updated
  • Other docs updated if behavior or a convention changed

Screenshots / recordings

None — no UI changes.

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
imrj05 marked this pull request as ready for review September 28, 2026 16:56
@imrj05
imrj05 requested a review from rj05xdev September 28, 2026 16:57
rj05xdev
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.
@imrj05
imrj05 merged commit 6544639 into main Sep 28, 2026
4 checks passed
@imrj05
imrj05 deleted the fix/issue-30-new-task-reconnect branch September 29, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: New Task not working when pi_disconnected

2 participants