Add Pi review-runner adapter#1313
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Pi as a first-class entire review worker by wiring a new AgentReviewer adapter that runs pi --mode json --print and maps Pi's NDJSON AgentSessionEvent stream into Entire review events. Pi is also added as a summary/text-generation provider and to the default profile / master preference order, and review-run model matching is tightened so multiple Pi workers using different models map to the correct lifecycle sessions.
Changes:
- New
agent/pi/reviewer.go(+ tests) implementingReviewerTemplatefor Pi, and newagent/pi/generate.goso Pi can serve as a summary/master provider. review_bridge.launchableReviewerForreturnspi.NewReviewer(); Pi added to summary provider binaries, default profile workers, master preference order, and user-facing help/error text.review/manifest.gonormalizes model IDs (strips provider prefix and tier suffix) for same-agent/different-model session matching;pi/lifecycle.gobackfillsModelonTurnEndviaExtractModel.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/agent/pi/reviewer.go | New Pi review adapter: builds argv/env and parses Pi's JSON event stream into review events. |
| cmd/entire/cli/agent/pi/reviewer_test.go | Unit tests for adapter name, argv/env shape, JSON event parsing, and message-end fallback text. |
| cmd/entire/cli/agent/pi/generate.go | Implements GenerateText so Pi can act as a master / summary provider. |
| cmd/entire/cli/agent/pi/lifecycle.go | Populates Model on TurnEnd by extracting from the captured Pi session transcript. |
| cmd/entire/cli/agent/text_generator_cli.go | Registers Pi binary (pi) as a summary-capable provider. |
| cmd/entire/cli/review_bridge.go | Wires pi.NewReviewer() into launchableReviewerFor. |
| cmd/entire/cli/review/manifest.go | Tighter model-ID normalization (strip provider prefix / tier suffix) for session matching. |
| cmd/entire/cli/review/manifest_test.go | Adds disambiguation test for same-agent/different-model worker → session mapping. |
| cmd/entire/cli/review/profile.go | Adds Pi to default profile agents and master preference order; updates error messaging. |
| cmd/entire/cli/review/picker.go | Updates guided-setup error message to mention Pi. |
| cmd/entire/cli/review/cmd.go | Doc-comment update listing Pi among adapter-backed agents. |
| cmd/entire/cli/review/types/template.go | Doc-comment update listing Pi as a template user. |
| cmd/entire/cli/explain_summary_provider.go | Adds Pi to the "no summary-capable provider" error guidance. |
| cmd/entire/cli/settings/settings.go | Doc comment lists Pi as a valid summary provider. |
| cmd/entire/cli/setup.go | --summarize-agent help text mentions Pi. |
| docs/architecture/review-command.md | Documents Pi as a prompt/model-driven worker in profiles and adapter list. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 27f6781. Configure here.
27f6781 to
c660e06
Compare
|
Addressed the Cursor Bugbot finding and rebased onto the updated #1312.
Also fixed the lint findings in Note: the earlier |
# Conflicts: # docs/architecture/review-command.md
Pi has a real model-enumeration command, so ListModels shells out to `pi --list-models` and parses the table into provider/model entries. parsePiModelList is split out and unit-tested (no pi binary needed).

Summary
Adds Pi as a first-class
entire reviewworker by implementing itsAgentRevieweradapter. This is the concrete proof that the previous "only claude-code/codex/gemini" limit was just missing adapters, not a launch-capability wall.Stacked on #1312 (review profiles). Review/merge that first.
What changed
cmd/entire/cli/agent/pi/reviewer.go—NewReviewer()returning aReviewerTemplate:BuildCmd:pi --mode json --print [--model <model>] <prompt>withENTIRE_REVIEW_*env viaAppendReviewEnvParser: maps Pi's--mode jsonAgentSessionEventstream (message_updatetext deltas,tool_execution_start,message_end/turn_endusage,agent_end) into Entire's reviewEventstream. Falls back tomessage_endcontent text when no deltas streamed; usesstopReasonfor success.cmd/entire/cli/agent/pi/generate.go—GenerateTextso Pi can also serve as a master / summary provider.launchableReviewerForreturnspi.NewReviewer(); Pi added to summary provider binaries, default-profile agents, master-preference order, and config/help text.agent_endbackfills the model viaExtractModel.Testing
reviewer_test.go: name, argv/env shape with--model, JSON event-stream parsing, message-end fallback textgo vet ./cmd/entire/cli/agent/pi/...env -u PI_CODING_AGENT go test ./cmd/entire/cli/...Note
Medium Risk
Touches review orchestration, manifest session matching, and summary provider selection; behavior is well covered by unit tests but depends on Pi CLI JSON event stability.
Overview
Pi is wired into
entire reviewas a first-class worker alongside Claude Code, Codex, and Gemini, using the sharedReviewerTemplatepattern instead of marker fallback.A new
pireview adapter runspi --mode json --print [--model …] <prompt>withENTIRE_REVIEW_*env, and maps Pi’s NDJSON session stream (text deltas, tools, usage,stopReason,agent_end) into Entire review events, including fallback text frommessage_endwhen no deltas streamed.GenerateText(pi --print --no-tools --no-session) lets Pi act as a review master and checkpoint summary provider.Integration:
launchableReviewerForreturnspi.NewReviewer(); Pi is added to summary-provider binaries, default profile agents (prompt-driven like Gemini), master preference order, and user-facing configure/help text. Onagent_end,TurnEndnow setsModelfrom the captured session transcript viaExtractModel.Manifest matching uses tighter model ID normalization (strip provider prefix / tier suffix) so multiple Pi workers with different models map to the correct lifecycle sessions; tests cover argv/env, JSON parsing, and same-agent/model disambiguation.
Reviewed by Cursor Bugbot for commit 27f6781. Configure here.