Skip to content

Add Oh My Pi agent integration - #580

Merged
sbertix merged 5 commits into
supabitapp:mainfrom
louisgundelwein:feature/omp-agent-integration
Jul 7, 2026
Merged

Add Oh My Pi agent integration#580
sbertix merged 5 commits into
supabitapp:mainfrom
louisgundelwein:feature/omp-agent-integration

Conversation

@louisgundelwein

@louisgundelwein louisgundelwein commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Closes #492

What

Adds omp / Oh My Pi as a first-class coding agent alongside the existing agent integrations:

  • SkillAgent.omp display/config metadata, using the existing Pi mark fallback.
  • Developer-tab install support for:
    • OMP extension at ~/.omp/agent/extensions/supacode/index.ts.
    • Supacode CLI skill at ~/.omp/agent/skills/supacode-cli/SKILL.md.
  • Presence reporting over OSC 3008 for:
    • extension load → session_start
    • agent_startbusy
    • agent_endidle + notification from last_assistant_message
    • session_shutdownsession_end + defensive idle
  • Settings/sidebar metadata and tests so OMP appears in the coding-agents card and Active sidebar grouping.
  • Coding-agents setup-card relevance cutoff bump so users who dismissed the old card are re-engaged for the expanded supported-agent lineup.

How

Oh My Pi is fork-compatible with Pi's extension API, but this PR keeps the OMP integration separate from Pi's installer/content instead of parameterizing Pi's existing implementation. That is intentional: OMP gets the fork-specific path/import/agent id, while existing Pi installs keep their current code path untouched.

Aspect Pi OMP
Config dir .pi/agent .omp/agent
Extension path .pi/agent/extensions/supacode/index.ts .omp/agent/extensions/supacode/index.ts
Emitted OSC agent id pi omp
Type import package @mariozechner/pi-coding-agent @oh-my-pi/pi-coding-agent
Icon pi-mark pi-mark fallback

The OMP installer mirrors the Pi ownership model:

  • installs only into the managed supacode extension directory,
  • uses /* supacode-managed-extension */ as the ownership marker,
  • refuses to overwrite or remove user-authored content at the managed path,
  • reports managed-but-drifted content as .outdated,
  • removes stale empty managed directories on uninstall.

The extension stays inert unless SUPACODE_SURFACE_ID is present, so installing it outside a Supacode terminal has no effect. When SUPACODE_SOCKET_PATH is present, the OSC payload includes the local pid so Supacode's liveness sweep can reap crashed local agents; over SSH the pid is omitted because it is not meaningful to the local app.

Compared with closed PR #515, this keeps the low-risk parts and avoids the risky ones:

  • Kept: fork-specific .omp/agent path, omp OSC id, @oh-my-pi/pi-coding-agent type import, installer/test coverage.
  • Did not copy: global Pi installer/content parameterization, because this PR does not need to touch existing Pi behavior.
  • Did not copy: custom omp-mark asset, because this PR intentionally uses the existing Pi mark fallback until an official/accepted asset is added.
  • Did not copy: binary-availability gate, because this installer writes files only and does not need to execute omp; users can install the integration before installing/running the binary.

Tests

Added/updated coverage for:

  • OmpSettingsInstallerTests
    • missing file → .notInstalled
    • user-authored file without marker is not treated as installed
    • invalid UTF-8 read failure does not masquerade as installed
    • install writes the expected OMP extension body under .omp/agent/extensions/supacode
    • install refuses to clobber user-authored content
    • stale managed content is overwritten by the canonical bundled extension
    • uninstall removes managed content and preserves user-authored content
    • OMP OSC lifecycle wire-string snippets are present
  • AgentPresenceFeatureTests
    • OMP session_start registers the badge and pid
    • OMP session_end removes the local pid record
    • OMP busy sets activity
    • OMP idle clears activity while keeping the badge
  • SidebarActiveClassificationTests
    • an idle OMP badge classifies the row as Active/agent
  • CodingAgentsSidebarCardModeTests
    • OMP included in install-state dictionaries
    • cardRelevantSinceDate matches the OMP launch cutoff and re-engages previously dismissed users

Verification status

Ran locally:

  • xcrun swiftc -parse SupacodeSettingsShared/BusinessLogic/OmpExtensionContent.swift SupacodeSettingsShared/BusinessLogic/OmpSettingsInstaller.swift SupacodeSettingsShared/Models/SkillAgent.swift SupacodeSettingsShared/BusinessLogic/CLISkillContent.swift SupacodeSettingsShared/BusinessLogic/CLISkillInstaller.swift SupacodeSettingsShared/BusinessLogic/AgentIntegrationFactory.swift supacode/Features/Settings/Views/DeveloperSettingsView.swift supacode/Features/AgentPresence/Views/CodingAgentsSidebarCardView.swift supacodeTests/OmpSettingsInstallerTests.swift supacodeTests/CodingAgentsSidebarCardModeTests.swift supacodeTests/AgentPresenceFeatureTests.swift supacodeTests/SidebarActiveClassificationTests.swift
  • make format
  • make lint
  • git diff --check
  • reviewer subagent: no Critical/Important findings before review follow-up

Review follow-up already included:

  • Fixed the OMP OSC wire-string test expectation to match the installed TypeScript content (\\x1b, not doubled raw-string backslashes).
  • Added a regression assertion that cardRelevantSinceDate matches the OMP launch cutoff.

Needs CI / maintainer-side validation:

  • make build-app
  • full make test
  • targeted xcodebuild test for OmpSettingsInstallerTests

Blocked locally:

  • make doctor / make build-app still fail because this machine lacks Xcode 26.3 with the macOS 26.2 SDK required for Zig 0.15.2/GhosttyKit.
  • targeted xcodebuild test -project supacode.xcodeproj -scheme supacode -destination "platform=macOS" -only-testing:supacodeTests/OmpSettingsInstallerTests ... still stops before running tests: missing .build/ghostty/GhosttyKit.xcframework from the same Xcode/GhosttyKit prerequisite.

Contribution policy status

Aligned with CONTRIBUTING.md:

AI assistance disclosure

Prepared with AI assistance in the Supacode / Oh My Pi coding harness. Louis is the human author of record and accountable for the changes; no AI agent is listed as a git author or co-author.

@louisgundelwein
louisgundelwein force-pushed the feature/omp-agent-integration branch from 6047b02 to 4768343 Compare July 5, 2026 13:47
louisgundelwein and others added 2 commits July 7, 2026 10:40
- Add a dedicated omp-mark asset (full-color gradient, original rendering
  intent) and point SkillAgent.omp at it instead of the shared pi-mark.
- Correct the installState() catch comment in the omp and pi installers to
  match behavior: an unreadable file resolves to not-installed and is logged,
  with the real error surfaced on the next install.
- Bound the extension's terminal-write retry: retry EINTR immediately and cap
  EAGAIN with a short backoff so a wedged tty degrades instead of spinning.
- Cover the .outdated install state and pin the emitted OSC lifecycle events
  end to end, so a HookEvent rename or an emitPresence typo can't silently
  break presence.
- Import SupacodeSettingsShared in SidebarActiveClassificationTests so the omp
  badge test compiles, and drop em dashes to match house style.
@sbertix
sbertix enabled auto-merge (squash) July 7, 2026 08:42

@sbertix sbertix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks 🙇‍♂️

@sbertix
sbertix merged commit 4f33f61 into supabitapp:main Jul 7, 2026
2 checks passed
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.

Add pi / oh-my-pi as a coding agent

2 participants