feat: add pi-coding-agent integration#251
Closed
bytes032 wants to merge 3 commits intoentireio:mainfrom
Closed
Conversation
Author
|
@Soph @gtrrz-victor @khaong this should be ready for review |
1139063 to
f7af2af
Compare
Contributor
|
Thanks for putting this together! We're currently reworking the agent interface (#281) to make integrations simpler and more consistent, so we're holding agent PRs until that lands — otherwise a lot of this would need to be redone against the new interface. We'll update #281 when it's ready for contributions. |
3da26bf to
c7a7a87
Compare
Entire-Checkpoint: e931c4c8bcce
Entire-Checkpoint: d567eba056dd
c7a7a87 to
ded1eeb
Compare
Entire-Checkpoint: d537996f6d47
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
This PR finalizes PI integration on top of Entire’s generic lifecycle architecture while preserving PI-specific tree transcript behavior.
PI now follows the same integration flow as Claude/Gemini:
ParseHookEvent() -> Event -> DispatchLifecycleEvent()PI-specific differences (tree branches + extension hooks) remain intentional.
What Changed
1. PI lifecycle mapping on new architecture
session-start->SessionStartuser-prompt-submit->TurnStartstop->TurnEndbefore-compact->Compactionsession-end->SessionEndleaf_idfrom PIstopis captured and persisted for active-branch correctness.2. PI tree-aware transcript behavior preserved
3. PI hook robustness improvements
session_switch/session_forkprevious-session end handling by deriving prior session ID frompreviousSessionFilewhen needed.4. Hook registration parity
HookHandler(GetHookNames) soentire hooks pi <verb>subcommands are registered consistently like other agents.5. PI-aware condensation correctness
6. PI-only stop flush mitigation
stop, PI now waits briefly (best-effort, bounded) for transcript flush/non-empty content before emittingTurnEnd.Why these changes are needed
Without these fixes, PI metadata can drift in branched sessions:
Known Limitation + Strict Core Fix Path
Current limitation (shared core behavior):
How to make this strict (core change, not in this PR):
TurnCheckpointIDswhen finalize fails.UpdateCommittedon subsequent safe lifecycle points (TurnEnd/SessionEnd).This would provide eventual full-transcript consistency as a hard guarantee.
PI-Specific Differences (Intentional)
.pi/extensions/entire/index.ts), not JSON settings-based hook registration like Claude/Gemini.Validation
go test ./cmd/entire/cli/agent/pi ./cmd/entire/cli/summarize ./cmd/entire/cli/strategygo test ./cmd/entire/cli/...