seance icon indicating copy to clipboard operation
seance copied to clipboard

[agent] add support for oh-my-pi (omp)

Open kitten-lily opened this issue 1 month ago • 0 comments

Agent name and link

oh-my-pi (omp), a terminal coding agent derived from Pi: https://github.com/can1357/oh-my-pi

Add automatic session detection and status tracking in Séance, like the existing Claude Code, Codex, Pi, OpenCode and Antigravity integrations.

Does the agent have a hook / event system?

Yes. omp loads ES-module extensions (-e <file>, honoured under --no-extensions and any --profile). An extension subscribes to lifecycle events with pi.on(...): agent_start, tool_call, tool_result, tool_execution_end, tool_approval_requested/tool_approval_resolved, session_stop, agent_end (with willContinue), session_switch, plan_review_requested/plan_review_resolved and session_shutdown. The extension API is documented in omp's docs/extensions.md.

The Pi wrapper's CommonJS extension does not load in omp (Extension does not export a valid factory function), so omp needs its own wrapper and extension rather than reusing pi-hook.

Lifecycle events you care about

  • Working: agent_start, then per-tool labels from tool_call (omp's tool names are lowercase, e.g. read with path, which toolDescription currently shows verbatim).
  • Waiting for permission / input: the ask tool, tool_approval_requested (only when the user opts out of omp's default yolo approval mode), and an open plan review.
  • Idle: session_stop, confirmed by the following agent_end without willContinue. Another extension can continue a stopped session, and Esc or an error ends a run without session_stop.
  • Exit: session_shutdown, plus the wrapper's exit trap for a killed process.

Details that matter for correctness:

  • Subagents and advisors run the same extension. Task subagents have ctx.hasUI false. Advisors share the main UI but report ctx.agent.kind === "sub".
  • /new and /fork switch sessions inside the running process without session_shutdown.
  • omp sends its own completion and question notifications over OSC. The extension turns those settings off when the user hasn't set them, so each event notifies once.

Context

I have a working implementation with tests on a fork and will open a PR that references this issue: two commits, one per feature. The toolDescription change for lowercase tool names (which also improves Pi's labels) is a separate commit that can be taken on its own.

This was written with AI assistance (Claude); each commit carries an Assisted-by: trailer.

kitten-lily avatar Oct 22 '26 20:10 kitten-lily