Conversation
1. In `internal/adapter/pi.go`, modify `HandlePiHook()` to check for `result.DecisionEntries` alongside `result.ContextEntries`. Change the early-return guard (line 103) to also consider decisions. When decisions exist, append `formatDecisions(result.DecisionEntries)` to the `AdditionalContext` string, just as the Claude adapter does. 2. In `internal/adapter/pi_test.go`, add a `TestHandlePiHook_Decisions` test function with table-driven subtests covering: (a) decisions-only AGENTS.yaml produces output with `## Architectural Decisions`, (b) both context and decisions produces both sections, (c) context-only produces no decisions section, (d) decision detail (rationale, alternatives, revisit_when) is present. Use the existing `setupPiTestDir` and `runPiHook` helpers.
gregology
left a comment
There was a problem hiding this comment.
This could get noisy. Are there other signals we can use to determine if Pi is in planning mode?
|
Added an Defaults to false, so existing integrations won't see any behavior change. Re: whether Pi has a planning mode signal we could key off instead — that's outside what I can determine from the codebase. The current Pi extension protocol doesn't send anything mode-like, so this would need a design conversation about whether to extend the extension itself or if the opt-in flag is sufficient. Developer metricsTotal duration: 3m 19s
|
gregology
left a comment
There was a problem hiding this comment.
The Pi code base is on GitHub https://github.com/badlogic/pi-mono
Investigate to see if there is a signal we can use to determine when Pi is in planning mode or even a proxy for planning mode.
|
Added automatic planning-mode detection in the pi extension. When It's a heuristic — depends on the plan-mode extension being installed — but the Recorded the design decision (auto-detect + manual override) in the adapter's AGENTS.yaml with the alternatives we considered. Out of scope: modifying pi's plan-mode extension itself to emit events on Developer metricsTotal duration: 6m 16s
|
Closes #124
PR #123 added decision support to the Claude adapter, but gated it behind plan mode since Claude Code has that concept. The pi adapter was left out entirely —
HandlePiHookignoredresult.DecisionEntriesand only returned context.This brings pi to parity. When
core.Resolvereturns matched decisions, they now show up in pi'sadditionalContextalongside any context entries.Why always-on (no plan mode gating)?
The Claude adapter only surfaces decisions during
permission_mode: "plan"to keep token costs low during normal tool use. Pi doesn't have an equivalent mode concept, so the two options were:Went with always-on. If pi adds a planning mode later, we can gate it then.
Review walkthrough
Single commit: Include decisions in pi hook output
pi.go: Changed the early-return guard to check bothContextEntriesandDecisionEntries. When decisions exist, appendsformatDecisions()output (same helper the Claude adapter uses) to the response.pi_test.go: NewTestHandlePiHook_Decisionswith subtests covering decisions-only, both context and decisions (with full detail verification), and context-only (no spurious decisions section).README.md: Updated three spots where the docs described decisions as Claude-plan-mode-only. The pi integration section now mentions decisions too.Developer metrics
Total duration: 6m 30s
Turns: 106
Tool calls: 77
Tokens: 1,429,407 input / 13,410 output
Resolves #124