Skip to content

feat(agenthook): report Pi sessions so hosts can resume them - #161

Open
rodboev wants to merge 13 commits into
mainfrom
pr/agenthook-pi
Open

rodboev wants to merge 13 commits into
mainfrom
pr/agenthook-pi

Conversation

@rodboev

@rodboev rodboev commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

A Pi conversation now comes back after a restart. Tools that install agenthook hooks, such as Forge, get Pi's session ID and reopen it with pi --session <id>. Pi has no command-hook config, so install writes one extension module, extensions/agenthook.js, that runs every application's commands without a shell. It needs Pi 0.80.4 or later.

The module reports only from Pi's terminal UI, and only after Pi saves the session file, so each reported ID resumes from the project it started in. SessionEnd fires only when another session replaces the current one, so quitting leaves the session resumable. A root index.ts, index.js or package.json extension list stops Pi loading the module.

Refs kenn-io/forge#1282, slice 11 (Resume Pi agents)

@roborev-ci

roborev-ci Bot commented Oct 6, 2026

Copy link
Copy Markdown

roborev: Combined Review (477efad)

Verdict: Changes require fixes for 1 finding.

Medium

  • agenthook/script.go:34: Install writes agenthook.js and reports success when the Pi extensions directory has a root index.ts, index.js, or package.json pi.extensions configuration that prevents discovery of agenthook.js. This documented limitation leaves installed hooks silently inactive because installation does not check for these blockers.

    Fix: Detect directory entry points and manifest configuration that prevent discovery before installing, and return an actionable error. Add behavioral tests confirming blocked installations leave files unchanged.


Reviewers: 2x codex, codex (security) | Synthesis: codex, 8s | Total: 2m38s

@roborev-ci

roborev-ci Bot commented Oct 6, 2026

Copy link
Copy Markdown

roborev: Combined Review (865f5c1)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security) | Synthesis: codex | Total: 1m50s

@roborev-ci

roborev-ci Bot commented Oct 6, 2026

Copy link
Copy Markdown

roborev: Combined Review (1127390)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security) | Synthesis: codex | Total: 1m34s

@roborev-ci

roborev-ci Bot commented Oct 6, 2026

Copy link
Copy Markdown

roborev: Combined Review (e83b47e)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security) | Synthesis: codex | Total: 1m50s

@rodboev
rodboev marked this pull request as draft October 7, 2026 03:28
@rodboev rodboev self-assigned this Oct 7, 2026
@roborev-ci

roborev-ci Bot commented Oct 7, 2026

Copy link
Copy Markdown

roborev: Combined Review (0122104)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security) | Synthesis: codex | Total: 1m25s

@rodboev
rodboev marked this pull request as ready for review October 7, 2026 03:40
@rodboev
rodboev requested a review from wesm October 7, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant