Skip to content

Add Pi and Pi Durable attached-worker hooks - #47

Merged
JARosen merged 1 commit into
mainfrom
codex/pi-hook-support
Oct 6, 2026
Merged

JARosen merged 1 commit into
mainfrom
codex/pi-hook-support

Conversation

@JARosen

@JARosen JARosen commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Pi coding sessions and Pi Durable harnesses could not attach to Foreman's supervisor. This adds pi and pi-durable process adapters plus buildable TypeScript bridges, using the existing responsibility routing, evidence, Jev budgeting, and session runtime.

Pi routes at cancellable input, injects the selected context before agent start, supervises tool calls/results, and checks completion at agent_before_settle. Pi Durable uses native generation/tool hooks, reads original submitted entries by durable run input IDs, and keeps routing and the one-continuation allowance through retries and handovers. Completion response replay covers the gap between Foreman's saved decision and Pi's task memo.

Both bridges refuse operations on process/protocol failures. Durable generation hooks ordinarily swallow exceptions, so refusal uses the public task abort API with a cancellation-aware waiter. Saved conversation control plus afterTools also halts mixed parallel rounds; before-tool steering becomes a block with feedback because Durable cannot inject context at that boundary. Already-running parallel calls cannot be undone.

The integration targets published @earendil-works/pi-coding-agent / pi-durable 1.0.4 and Node 22.19+. Setup instructions are in integrations/pi/README.md. The npm package is local/private; this PR does not release either package or install these bridges into existing user sessions. Codex remains the default adapter.

Validation:

  • 386 Python tests and Ruff passed locally.
  • 27 Node tests cover actual Pi CLI/SDK sessions and Durable harnesses, tool denial, context, failures, bounded continuations, storage reopen, mixed parallel halts, and the actual Foreman CLI with offline Jev doubles.
  • An isolated actual Pi CLI run using the built extension and source Foreman with real Jev assessment passed (one recorded Jev request, successful reply, no hook errors). The Pi model in this smoke run was the offline faux provider, not a live external model.
  • Wheel/sdist build and Twine checks passed; npm pack dry run includes the built bridges.
  • Adds PR CI on Python 3.11/3.12/3.13 and Node 22.19, and Pi tests to the release gate.

ThruWire Dev currently provides only a post-release FeatureComplete checkpoint. Its existing Foreman 0.4.3 receipt remains intact. There is no implementation/PR progress destination, so project synchronization for this unreleased feature is pending an appropriate record or its actual release; no planned work was marked released.

Closes #46.

@JARosen
JARosen merged commit 48d2021 into main Oct 6, 2026
4 checks passed
@JARosen
JARosen deleted the codex/pi-hook-support branch October 6, 2026 21:39
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.

Support Pi and Pi Durable attached-worker hooks

1 participant