chore: add Pi extension config#1261
Conversation
Entire-Checkpoint: fc68295fe7ae
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 279ed82. Configure here.
| await callHook("session-end", { | ||
| session_id, | ||
| session_ref: sessionRef(ctx), | ||
| }); |
There was a problem hiding this comment.
OpenCode hooks on Pi CLI
High Severity
The new .pi/extensions/entire.ts invokes entire hooks pi with kebab-case names such as session-start, turn-start, and session-end, but the Pi agent only registers snake_case subcommands (session_start, before_agent_start, agent_end, session_shutdown). Unknown hooks return no lifecycle event, so this extension does not drive checkpoints or transcripts when it is the active handler.
Reviewed by Cursor Bugbot for commit 279ed82. Configure here.
| session_id, | ||
| session_ref: sessionRef(ctx), | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Two Entire extensions auto-load
Medium Severity
Pi discovers both a top-level .pi/extensions/entire.ts and .pi/extensions/entire/index.ts as separate extensions, so both register the same lifecycle handlers. The incorrect root file still runs pi.exec on every event (up to 30s), duplicating work and risking slower or racy teardown alongside the correct index.ts hooks.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 279ed82. Configure here.
| await callHook("session-end", { | ||
| session_id, | ||
| session_ref: sessionRef(ctx), | ||
| }); |
There was a problem hiding this comment.
Invalid Pi hook subcommands
High Severity
The new .pi/extensions/entire.ts extension invokes entire hooks pi with kebab-case verbs like session-start and turn-start, and sends session_ref instead of session_file. The in-tree Pi agent only registers snake_case hooks and reads session_file in ParseHookEvent, so these invocations never produce lifecycle events.
Reviewed by Cursor Bugbot for commit 279ed82. Configure here.
|
|
||
| import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; | ||
|
|
||
| export default function (pi: ExtensionAPI) { |
There was a problem hiding this comment.
Orphan extension outside installer
Medium Severity
Adding .pi/extensions/entire.ts alongside .pi/extensions/entire/index.ts introduces a second Pi extension that entire enable --agent pi never writes and UninstallHooks never removes (it only deletes the entire/ directory). Pi can auto-load both, and after uninstall only the broken top-level file may remain while AreHooksInstalled is false.
Reviewed by Cursor Bugbot for commit 279ed82. Configure here.
There was a problem hiding this comment.
Pull request overview
Adds Pi agent hook configuration files under .pi/extensions/ to enable Entire’s lifecycle integration via a Pi TypeScript extension.
Changes:
- Add Pi extension at
.pi/extensions/entire/index.tsthat forwards Pi lifecycle events toentire hooks pi <event>. - Add an additional Pi extension file
.pi/extensions/entire.ts(appears to be an alternate/duplicate implementation).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.pi/extensions/entire/index.ts |
Pi extension that forwards Pi lifecycle events to the CLI’s entire hooks pi … handlers. |
.pi/extensions/entire.ts |
Additional Pi extension file that dispatches different (hyphenated) hook names; likely conflicts with the CLI’s expected Pi hook verbs. |
| // Events forwarded: | ||
| // - session_start → entire hooks pi session-start | ||
| // - before_agent_start (first turn of a prompt) → entire hooks pi turn-start | ||
| // - agent_end → entire hooks pi turn-end | ||
| // - session_compact → entire hooks pi compaction | ||
| // - session_shutdown → entire hooks pi session-end |


https://entire.io/gh/entireio/cli/trails/424
Summary\n- Add Pi extension config for Entire hook integration\n\n## Tests\n- Not run (configuration-only change)
Note
Low Risk
Configuration-only agent hooks with best-effort subprocess calls; no changes to core Entire runtime beyond enabling Pi session capture.
Overview
Adds Pi integration so session and turn lifecycle events invoke
entire hooks pi …for checkpoints and transcripts.The checked-in extension at
.pi/extensions/entire/index.tsmatches whatentire enable --agent piinstalls: it forwardssession_start,before_agent_start,agent_end, andsession_shutdownwith JSON on stdin (cwd,session_file,prompt), runs hooks viaexecFilewith swallowed errors, and prependsGIT_TERMINAL_PROMPT=0to bash tool commands so agent-driven git does not block on prompts.A second file,
.pi/extensions/entire.ts, implements a different contract (kebab-case subcommands likesession-start/turn-start,session_id/session_ref,model_select,session_compact, andpi.execwith a 30s timeout). Only theentire/index.tspath is documented and used by the Entire installer; the sibling.tsfile may be redundant unless Pi loads both.Reviewed by Cursor Bugbot for commit 279ed82. Configure here.