Repository navigation
feat: add support for the pi.dev coding agent - #240
Conversation
Register `pi` (pi.dev) as a fourth AI tool: AI_TOOLS entry, config schema flags block, and idle/working/waiting status detection from real captured pi v0.74.1 terminal output. pi's spinner is a braille glyph (`⠙ Working...`) and its waiting states are select-dialog UIs — detection uses regex (PI_WORKING_RE / PI_WAITING_RE) like claude rather than plain substrings. Waiting also covers the pi-permission-system extension's gate, pi's only agent-blocked prompt. Also harden detectToolFromArgs: the loose `.includes()` fallback is replaced with whole-word matching so the 2-char name `pi` can't mis-tag `pip`, `compile`, or paths merely containing `pi`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Match the PI_WORKING_RE / PI_WAITING_RE convention so the pattern isn't recompiled on every isWaitingForTool call in the ~2s status-refresh loop. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review — PR #240: Add support for pi.dev coding agentOverviewWell-executed addition of Positives
Concerns1. The constant sets 2. Comments are borderline multi-line — AGENTS.md prefers single line AGENTS.md says: "When a comment is genuinely warranted … prefer a single line." The regex comments in 3. Only 4. Minor: The SummaryApprove with minor follow-up. The core implementation is solid — real fixtures, hardened detection, good tests, data-driven registration. The |
- FakeAIToolService: add a `case 'pi'` to the status simulation switch so pi is not the only tool falling through to the default branch - isAIPaneCommand: add a pi test documenting that it matches the pane heuristic - tighten the PI_WAITING_RE comment to a single rationale line Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review: feat: add support for the pi.dev coding agentOverviewThis PR registers Code Quality ✅Strengths:
Minor comments:
Potential Issues1. The same substring ambiguity fixed in 2. The regex 3. The strict pass strips quoted spans before matching, so this is likely already handled — but worth a quick sanity-check with the test case Performance ✅All regex constants are compiled at module load time (correct). No changes to the 2s polling hot path. Security ✅No security concerns. No network calls, no user input passed to shell commands. The regex patterns cannot produce ReDoS since they contain no nested quantifiers. Test Coverage ✅The test suite is thorough:
SummaryApprove with one follow-up to check: The implementation is solid. The single thing worth verifying before merge is how |
Summary
Registers
pi(the pi.dev coding agent, binarypi, npm@earendil-works/pi-coding-agent) as a fourth first-class AI tool alongside claude/codex/gemini.AI_TOOLS.pientry (--continueresume,processPatterns: ['pi']) and aCONFIG_SCHEMA.aiToolSettings.piflags block. TheAITooltype, availability detection, picker, and launch path are all data-driven offAI_TOOLS, so pi is selectable and launchable with no further wiring.PI_WORKING_RE(braille spinner) andPI_WAITING_RE/PI_PERMISSION_RE(pi's select/confirm dialog chrome plus thepi-permission-systemextension's gate), with explicitcase 'pi'inisWorking/isWaitingForTool. Patterns derived from real captured pi v0.74.1 output, not docs.detectToolFromArgs's loose.includes()fallback is replaced with whole-word matching, so the 2-char namepican't mis-tagpip,compile, or paths merely containingpi.tests/fixtures/ai-states/pi/*fixtures, detection-test coverage, thecapture-ai-statesskill extended for pi, and glossary/status-model docs updated.Notes
pi-permission-systemextension, which renders as a standard pi select dialog. Detection covers both pi's native interactive dialogs and that extension's prompt.Verification
npm run typecheck,npm test(815/815),npm run buildall pass. Verified end-to-end: launched pi via the realbash -c pi --continue || pipath and confirmeddetectAllSessionAIToolstags the sessionpi.🤖 Generated with Claude Code