Skip to content

Add Pi agent support and preset icon#2562

Merged
Kitenite merged 1 commit into
superset-sh:mainfrom
Kitenite:kitenite/please-add-pi-supp
Mar 18, 2026
Merged

Add Pi agent support and preset icon#2562
Kitenite merged 1 commit into
superset-sh:mainfrom
Kitenite:kitenite/please-add-pi-supp

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Mar 18, 2026

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

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

  • bun test packages/shared/src/agent-command.test.ts apps/desktop/src/shared/utils/agent-settings.test.ts
  • bunx 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.ts
  • bunx biome check packages/ui/src/assets/icons/preset-icons/index.ts

Screenshots (if applicable)

N/A

Additional Notes

  • Pi is launched in interactive mode for prompt-based sessions because pi -p exits after printing output.
  • The Pi repo does not check in a standalone logo asset, so the added SVGs were derived from the upstream logo URL referenced in Pi's README.

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.

  • New Features
    • Built-in pi agent with preset, label, and command; added to desktop default presets and settings search.
    • Prompt launches use interactive mode for Pi (not pi -p); tests added to verify behavior.
    • MCP start_agent_session accepts pi; README and docs updated (agent list, MCP, terminal presets).
    • New preset icons added (pi.svg, pi-white.svg) and registered in packages/ui.

Written for commit 59f420d. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added Pi agent support, now available in terminal quick-add templates and presets with dedicated icons.
  • Documentation

    • Updated supported agents list, agent integration guide, and terminal presets documentation to include Pi.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fdc8e5c5-5611-4e5c-81b5-6cab9bb90004

📥 Commits

Reviewing files that changed from the base of the PR and between cbea37d and 59f420d.

⛔ Files ignored due to path filters (2)
  • packages/ui/src/assets/icons/preset-icons/pi-white.svg is excluded by !**/*.svg
  • packages/ui/src/assets/icons/preset-icons/pi.svg is excluded by !**/*.svg
📒 Files selected for processing (11)
  • README.md
  • 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
  • apps/docs/content/docs/agent-integration.mdx
  • apps/docs/content/docs/mcp.mdx
  • apps/docs/content/docs/terminal-presets.mdx
  • packages/mcp/src/tools/devices/start-agent-session/start-agent-session.ts
  • packages/shared/src/agent-command.test.ts
  • packages/shared/src/agent-command.ts
  • packages/ui/src/assets/icons/preset-icons/index.ts

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Core Agent Definition
packages/shared/src/agent-command.ts, apps/desktop/src/lib/trpc/routers/settings/index.ts
Added Pi agent support by registering it in AGENT_TYPES, AGENT_LABELS, AGENT_PRESET_COMMANDS, AGENT_PRESET_DESCRIPTIONS, and AGENT_PROMPT_COMMANDS; also added pi to DEFAULT_PRESET_AGENTS.
Tests
packages/shared/src/agent-command.test.ts, apps/desktop/src/shared/utils/agent-settings.test.ts
Added test cases verifying Pi interactive mode for prompt launches and Pi as a built-in terminal config with expected properties.
Documentation
README.md, apps/docs/content/docs/agent-integration.mdx, apps/docs/content/docs/mcp.mdx, apps/docs/content/docs/terminal-presets.mdx
Updated documentation to include Pi in supported agents list, AI Sessions capability, start_agent_session API description, and quick-add templates.
UI & Search
packages/ui/src/assets/icons/preset-icons/index.ts, apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts
Added Pi preset icons (light and dark variants) with public exports; added "pi" keyword to search items for AGENTS_ENABLED, AGENTS_COMMANDS, and TERMINAL_QUICK_ADD.
API Tools
packages/mcp/src/tools/devices/start-agent-session/start-agent-session.ts
Updated agent field description in input schema to include Pi among supported AI agents.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A new agent hops into our warren,
Pi joins the fold with icons so bright,
Tests and docs all declare this bargain,
Configuration dances left and right,
Hopping forward, our system's just right! 🥧

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add Pi agent support and preset icon' clearly and concisely summarizes the main changes: introducing Pi as a new agent and adding corresponding preset icons.
Description check ✅ Passed The description includes all required template sections: clear description, related issues, type of change, testing steps, screenshots, and additional notes with context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 13 files

@Kitenite Kitenite merged commit 988efea into superset-sh:main Mar 18, 2026
17 of 20 checks passed
Kitenite pushed a commit that referenced this pull request May 5, 2026
* 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.
saddlepaddle pushed a commit that referenced this pull request May 6, 2026
* 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.
MocA-Love pushed a commit to MocA-Love/superset that referenced this pull request May 21, 2026
…-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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant