Add Pi agent support and preset icon#2562
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThis pull request adds support for a new agent called "Pi" across the application. Changes include adding Pi to configuration defaults, updating documentation, implementing tests, adding UI icons, and updating API descriptions to reference the new agent option. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
* feat(desktop): wire pi terminal agent to notification hooks Follow-up to #2562, which added pi as a built-in agent (preset, command, icon, settings UI, docs). This PR adds the corresponding notification-hook integration in apps/desktop/src/main/lib/agent-setup/, so pi participates in the same Start/Stop/PostToolUse lifecycle that drives Superset's working indicator and completion chime for claude, codex, gemini, cursor, copilot, opencode, mastra, amp, and droid. Mechanism: ship a small TypeScript pi extension to the global pi extensions directory (~/.pi/agent/extensions/superset-hooks.ts). The extension subscribes to pi's lifecycle events and spawns notify.sh with Claude-Code-format hook_event_name JSON payloads, which the existing notify.sh dispatcher already speaks natively — no per-agent translator shim needed. Mapping: pi before_agent_start → UserPromptSubmit → Superset Start pi tool_execution_end → PostToolUse → progress pi agent_end → Stop → completion / chime pi session_shutdown → Stop → cleanup on Ctrl+C, /quit, /reload Subagent flicker is prevented by gating every event on ctx.hasUI === false (strict equality, so older pi versions where hasUI is undefined still fire). Structurally identical to the opencode integration: template file + wrapper module + barrel re-export + capabilities target + runners map entry. Mirrors writeFileIfChanged + signature/version marker convention. No changes required to notify.sh, the v2 host-service tRPC endpoint, the renderer event bus, or the server-side mapEventType. * fix(desktop): drop redundant comment prefix from pi extension template PI_EXTENSION_MARKER already starts with '//' ("// Superset pi extension v1"), so wrapping the placeholder in another comment produced '// // Superset pi extension v1' on the installed file's first line. Aligns with opencode's template, which places {{MARKER}} on a bare line for the same reason.
* feat(desktop): wire pi terminal agent to notification hooks Follow-up to #2562, which added pi as a built-in agent (preset, command, icon, settings UI, docs). This PR adds the corresponding notification-hook integration in apps/desktop/src/main/lib/agent-setup/, so pi participates in the same Start/Stop/PostToolUse lifecycle that drives Superset's working indicator and completion chime for claude, codex, gemini, cursor, copilot, opencode, mastra, amp, and droid. Mechanism: ship a small TypeScript pi extension to the global pi extensions directory (~/.pi/agent/extensions/superset-hooks.ts). The extension subscribes to pi's lifecycle events and spawns notify.sh with Claude-Code-format hook_event_name JSON payloads, which the existing notify.sh dispatcher already speaks natively — no per-agent translator shim needed. Mapping: pi before_agent_start → UserPromptSubmit → Superset Start pi tool_execution_end → PostToolUse → progress pi agent_end → Stop → completion / chime pi session_shutdown → Stop → cleanup on Ctrl+C, /quit, /reload Subagent flicker is prevented by gating every event on ctx.hasUI === false (strict equality, so older pi versions where hasUI is undefined still fire). Structurally identical to the opencode integration: template file + wrapper module + barrel re-export + capabilities target + runners map entry. Mirrors writeFileIfChanged + signature/version marker convention. No changes required to notify.sh, the v2 host-service tRPC endpoint, the renderer event bus, or the server-side mapEventType. * fix(desktop): drop redundant comment prefix from pi extension template PI_EXTENSION_MARKER already starts with '//' ("// Superset pi extension v1"), so wrapping the placeholder in another comment produced '// // Superset pi extension v1' on the installed file's first line. Aligns with opencode's template, which places {{MARKER}} on a bare line for the same reason.
…-sh#4083) * feat(desktop): wire pi terminal agent to notification hooks Follow-up to superset-sh#2562, which added pi as a built-in agent (preset, command, icon, settings UI, docs). This PR adds the corresponding notification-hook integration in apps/desktop/src/main/lib/agent-setup/, so pi participates in the same Start/Stop/PostToolUse lifecycle that drives Superset's working indicator and completion chime for claude, codex, gemini, cursor, copilot, opencode, mastra, amp, and droid. Mechanism: ship a small TypeScript pi extension to the global pi extensions directory (~/.pi/agent/extensions/superset-hooks.ts). The extension subscribes to pi's lifecycle events and spawns notify.sh with Claude-Code-format hook_event_name JSON payloads, which the existing notify.sh dispatcher already speaks natively — no per-agent translator shim needed. Mapping: pi before_agent_start → UserPromptSubmit → Superset Start pi tool_execution_end → PostToolUse → progress pi agent_end → Stop → completion / chime pi session_shutdown → Stop → cleanup on Ctrl+C, /quit, /reload Subagent flicker is prevented by gating every event on ctx.hasUI === false (strict equality, so older pi versions where hasUI is undefined still fire). Structurally identical to the opencode integration: template file + wrapper module + barrel re-export + capabilities target + runners map entry. Mirrors writeFileIfChanged + signature/version marker convention. No changes required to notify.sh, the v2 host-service tRPC endpoint, the renderer event bus, or the server-side mapEventType. * fix(desktop): drop redundant comment prefix from pi extension template PI_EXTENSION_MARKER already starts with '//' ("// Superset pi extension v1"), so wrapping the placeholder in another comment produced '// // Superset pi extension v1' on the installed file's first line. Aligns with opencode's template, which places {{MARKER}} on a bare line for the same reason.
Description
Adds Pi as a built-in agent option across shared presets, desktop defaults, search keywords, MCP copy, and docs. Also adds Pi preset icons so the new agent renders with a first-party icon in the UI.
Related Issues
N/A
Type of Change
Testing
bun test packages/shared/src/agent-command.test.ts apps/desktop/src/shared/utils/agent-settings.test.tsbunx biome check packages/shared/src/agent-command.ts packages/shared/src/agent-command.test.ts apps/desktop/src/lib/trpc/routers/settings/index.ts apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts apps/desktop/src/shared/utils/agent-settings.test.ts packages/mcp/src/tools/devices/start-agent-session/start-agent-session.tsbunx biome check packages/ui/src/assets/icons/preset-icons/index.tsScreenshots (if applicable)
N/A
Additional Notes
pi -pexits after printing output.Summary by cubic
Adds Pi as a built-in agent across presets, desktop defaults, MCP, search, and docs, with new preset icons. Pi can be launched from terminal presets and agent sessions with correct prompt behavior.
piagent with preset, label, and command; added to desktop default presets and settings search.pi -p); tests added to verify behavior.start_agent_sessionacceptspi; README and docs updated (agent list, MCP, terminal presets).pi.svg,pi-white.svg) and registered inpackages/ui.Written for commit 59f420d. Summary will update on new commits.
Summary by CodeRabbit
New Features
Documentation