Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

feat(agent-status): detect Oh My PI (OMP)

Mirro Choudd49e04234ff
diff --git a/NOTICE b/NOTICE
index 2dcbbcda..871e5b3a 100644
--- a/NOTICE
+++ b/NOTICE
@@ -26,6 +26,11 @@ included at mux/src/agent_status/manifests/LICENSE. Each bundled file
carries an attribution header naming the upstream commit it was taken
from.
+One manifest, mux/src/agent_status/manifests/omp.toml, is not from
+herdr: it was authored by ThinkTerm's contributors and is distributed
+under this repository's own license. Its header records that, and where
+each of its detection signals came from.
+
---
This product embeds user-interface icons from Lucide
diff --git a/docs/agent-status.md b/docs/agent-status.md
index abc6fe97..bb5053b0 100644
--- a/docs/agent-status.md
+++ b/docs/agent-status.md
@@ -1,10 +1,10 @@
# Agent Status Protocol
-ThinkTerm can track the state of coding agents (Claude Code, Codex, Pi,
-OpenCode, …) running in its panes: **working**, **blocked** (waiting for a
-user decision), or **idle**. The state feeds the thread status indicators
-in the left sidebar and the Agents panel in the right sidebar
-(Settings → Agents → *Agent Panel*, off by default).
+ThinkTerm can track the state of coding agents (Claude Code, Codex, Oh My
+PI, Pi, OpenCode, …) running in its panes: **working**, **blocked**
+(waiting for a user decision), or **idle**. The state feeds the thread
+status indicators in the left sidebar and the Agents panel in the right
+sidebar (Settings → Agents → *Agent Panel*, off by default).
Detection arbitrates three signal layers, strongest contract first:
@@ -117,13 +117,40 @@ reports back over `thinkterm cli` — herdr's current approach — not a
terminal sequence. (No such subcommand exists yet; `thinkterm cli agent`
is query-only today.)
+## Oh My PI (OMP) integration
+
+Screen rules plus native OSC 7501 — there is nothing to install. OMP
+(`omp`, npm `@oh-my-pi/pi-coding-agent`) is a Pi fork that reports its run
+state twice: it writes the OSC 7501 root record
+(`state=working/idle/blocked:app=omp`), which ThinkTerm consumes
+directly, and it carries the same state in its OSC 0 title. The title is
+`π > …` when it is your turn, `π <spinner> …` while a turn runs, and
+`π ! …` when it is waiting on you; the spinner follows
+`tui.titleSpinner` (Braille by default, with pulse, dots, and ASCII line
+alternatives). The manifest reads all four styles.
+
+The title is not just a duplicate of the report. OMP's shell tool emits
+nested OSC 133 command markers, and ThinkTerm reads the `133;A` marker as
+the pane shell's prompt and retires the OSC 7501 record — the same thing
+it does when a real shell gets its prompt back. Without a second signal
+the row would disappear for the rest of the turn and return only when
+OMP reported idle again. The process name and the title keep the pane
+identified and classified through that gap. Keep `tui.titleState` on (the
+default); with it off the title is `π: …` and only OSC 7501 can classify.
+
+As with every process-identified agent, a bare SSH pane gets no row: the
+local pane's foreground program is `ssh`, not `omp`. Run OMP in a
+mux-domain pane — detection happens on the host that owns the pane — or
+on the machine that owns the pane.
+
## Screen-rule manifests
Bundled manifests live in the ThinkTerm source under
`mux/src/agent_status/manifests/` and are sourced from the
-[herdr](https://github.com/herdrdev/herdr) project (Apache-2.0). The
-format is herdr's agent-detection manifest format; a user override for an
-agent replaces the bundled file of the same id wholesale.
+[herdr](https://github.com/herdrdev/herdr) project (Apache-2.0), except
+`omp.toml`, which is authored here because herdr has no manifest for that
+agent. The format is herdr's agent-detection manifest format; a user
+override for an agent replaces the bundled file of the same id wholesale.
The `osc_title` and `osc_progress` regions see only what the application
actually emitted: both are empty until an OSC title / OSC 9;4 progress
diff --git a/mux/src/agent_status/engine.rs b/mux/src/agent_status/engine.rs
index c2a3c435..47ebaafb 100644
--- a/mux/src/agent_status/engine.rs
+++ b/mux/src/agent_status/engine.rs
@@ -165,6 +165,10 @@ const BUNDLED_MANIFESTS: &[&str] = &[
include_str!("manifests/pi.toml"),
include_str!("manifests/opencode.toml"),
include_str!("manifests/kimi.toml"),
+ // Hand-authored here rather than sourced from herdr, which carries no
+ // manifest for it; the file's header records where its signals came
+ // from.
+ include_str!("manifests/omp.toml"),
];
static MANIFESTS: RwLock<Option<HashMap<String, CompiledManifest>>> = RwLock::new(None);
diff --git a/mux/src/agent_status/manifests/omp.toml b/mux/src/agent_status/manifests/omp.toml
new file mode 100644
index 00000000..8d40f40b
--- /dev/null
+++ b/mux/src/agent_status/manifests/omp.toml
@@ -0,0 +1,64 @@
+# Hand-authored for ThinkTerm: Oh My PI (`omp`, npm
+# `@oh-my-pi/pi-coding-agent`), a Pi fork. Not part of herdr's set, which
+# has no manifest for this agent. It is authored here and carries this
+# repository's own license, unlike the files around it, which are
+# Apache-2.0 from herdr; see NOTICE at the repository root.
+#
+# OMP already speaks OSC 7501 (`state=working/idle/blocked:app=omp`),
+# which ThinkTerm consumes directly. It also emits nested OSC 133 command
+# markers from its shell tool; ThinkTerm reads 133;A as the pane shell's
+# prompt and retires the OSC 7501 record. The process name and the
+# state-carrying title below keep the pane identified and classified
+# through that gap.
+#
+# Signals read off a live OMP 18.12.5 session:
+#
+# - The OSC 0 title carries the run state (tui.titleState, on by default):
+# idle: `π > <session>`
+# working: `π <spinner> <session>`
+# attention: `π ! <session>` (permission / ask)
+# The spinner follows tui.titleSpinner: Braille (default), pulse,
+# dots, or ASCII line. All four sets are matched below.
+# - The launcher is `omp` (a `#!/usr/bin/env bun` shim), so a pane's
+# foreground leader is Bun and the launcher rides in its argv.
+#
+# With tui.titleState off the title is `π: <session>`; then only OSC 7501
+# can classify, and a nested command can still blank the row. See
+# docs/agent-status.md.
+
+id = "omp"
+version = "2026.10.21.1"
+min_engine_version = 1
+updated_at = "2026-10-21T00:00:00Z"
+aliases = ["oh-my-pi"]
+
+[[rules]]
+id = "osc_title_blocked"
+state = "blocked"
+priority = 1200
+region = "osc_title"
+visible_blocker = true
+# `π ! <session>` while a permission or ask prompt waits. Above the
+# working rule in case a spinner frame is left on the title.
+regex = ['^π !(?:\s|$)']
+
+[[rules]]
+id = "osc_title_working"
+state = "working"
+priority = 1100
+region = "osc_title"
+visible_working = true
+# One spinner frame from any tui.titleSpinner style, then a space and
+# the session label (or the end of the title when there is no label).
+# The separator for idle/attention is `>`/`!`, and a disabled title
+# uses `:`, so those three are deliberately outside the frame sets.
+regex = ['^π (?:[\x{2800}-\x{28FF}]|[○◔◑◕●]|[-\\|/])(?:\s|$)']
+
+[[rules]]
+id = "osc_title_idle"
+state = "idle"
+priority = 1000
+region = "osc_title"
+visible_idle = true
+# `π > <session>` when the agent has handed the turn back to the user.
+regex = ['^π >(?:\s|$)']
diff --git a/mux/src/agent_status/mod.rs b/mux/src/agent_status/mod.rs
index 9edab76d..c91eb23e 100644
--- a/mux/src/agent_status/mod.rs
+++ b/mux/src/agent_status/mod.rs
@@ -26,6 +26,8 @@ mod hysteresis;
pub mod identify;
mod proc_match;
mod windows_select;
+#[cfg(test)]
+mod omp_tests;
use crate::pane::{Pane, PaneId};
use crate::{Mux, MuxNotification};
@@ -1737,6 +1739,35 @@ mod tests {
evict_pane(pane.id);
}
+ /// OMP's shell tool emits nested OSC 133 command markers. The terminal
+ /// retires the OSC 7501 record at the `133;A` prompt, just as it does
+ /// when a real shell gets its prompt back. OMP's process and its
+ /// state-carrying title still identify and classify the pane.
+ #[test]
+ fn omp_title_survives_its_report_being_retired_by_a_nested_prompt() {
+ let pane = FakeAgentPane::new(Some("/home/u/.bun/bin/bun"));
+ pane.set_argv(&["bun", "/home/u/.bun/bin/omp", "--no-session"]);
+ pane.set_foreground(9301, false);
+ pane.set_osc_title("π ⠋ omp-probe");
+ pane.report(ProgramState::Working, Some("omp"), |_| {});
+ assert!(evaluate_pane(pane.as_ref() as &dyn Pane));
+ let status = status_for_pane(pane.pane_id()).expect("omp reports");
+ assert_eq!(status.agent_id, "omp");
+ assert_eq!(status.state, AgentState::Working);
+ assert_eq!(status.evidence, AgentEvidence::Report);
+
+ // The tool's shell prompt retires the report. The process and the
+ // title rules have to carry the pane from here.
+ pane.program.lock().end_of_program();
+ pane.set_osc_title("π ⠋ omp-probe");
+ evaluate_pane(pane.as_ref() as &dyn Pane);
+ let status = status_for_pane(pane.pane_id()).expect("omp still identified");
+ assert_eq!(status.agent_id, "omp");
+ assert_eq!(status.state, AgentState::Working);
+ assert_eq!(status.evidence, AgentEvidence::Screen);
+ evict_pane(pane.pane_id());
+ }
+
#[test]
fn a_command_chain_does_not_attach_old_children_to_the_next_root() {
let pane = FakeAgentPane::new(Some("/usr/bin/example"));
diff --git a/mux/src/agent_status/omp_tests.rs b/mux/src/agent_status/omp_tests.rs
new file mode 100644
index 00000000..c664c82a
--- /dev/null
+++ b/mux/src/agent_status/omp_tests.rs
@@ -0,0 +1,103 @@
+//! Screen-rule tests for `manifests/omp.toml`.
+//!
+//! The titles below are the ones a live OMP 18.12.5 session emitted: the
+//! idle `π >`, the working spinner frames, and the attention `π !` form.
+//!
+//! They live outside [`engine`](crate::agent_status::engine) so adding an
+//! agent does not grow the engine's generic test module; the manifest and
+//! its tests are reviewed, and can be removed, together.
+
+mod tests {
+ use crate::agent_status::engine::{
+ evaluate, manifest_id_for_alias, DetectionInput, ScreenVerdict,
+ };
+ use thinkterm_proto::AgentState;
+
+ fn eval_omp(title: &str) -> ScreenVerdict {
+ evaluate(
+ "omp",
+ &DetectionInput {
+ screen: "",
+ osc_title: title,
+ osc_progress: "",
+ },
+ )
+ }
+
+ /// OMP installs as a `#!/usr/bin/env bun` shim, so a pane's foreground
+ /// leader is the runtime and the shim only appears in argv.
+ #[test]
+ fn omp_identifies_through_its_bun_shim() {
+ let mut argv = || {
+ Some(vec![
+ "bun".to_string(),
+ "/home/u/.bun/bin/omp".to_string(),
+ "--no-session".to_string(),
+ ])
+ };
+ assert_eq!(
+ crate::agent_status::proc_match::identify(
+ "/home/u/.bun/bin/bun",
+ &mut argv,
+ &manifest_id_for_alias
+ )
+ .as_deref(),
+ Some("omp")
+ );
+ assert_eq!(manifest_id_for_alias("omp").as_deref(), Some("omp"));
+ assert_eq!(manifest_id_for_alias("oh-my-pi").as_deref(), Some("omp"));
+ }
+
+ /// Every selectable `tui.titleSpinner` style has to read as working:
+ /// Braille (the default), pulse, dots, and the ASCII line.
+ #[test]
+ fn omp_title_reports_working_for_every_spinner_style() {
+ let frames = [
+ "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏", "○", "◔", "◑", "◕", "●", "-", "\\",
+ "|", "/",
+ ];
+ for frame in frames {
+ let title = format!("π {frame} omp-probe");
+ assert!(
+ matches!(eval_omp(&title), ScreenVerdict::State(AgentState::Working)),
+ "{} should be working",
+ title
+ );
+ }
+ assert!(matches!(
+ eval_omp("π ⠋"),
+ ScreenVerdict::State(AgentState::Working)
+ ));
+ }
+
+ #[test]
+ fn omp_title_reports_idle_and_attention() {
+ for title in ["π >", "π > omp-probe"] {
+ assert!(
+ matches!(eval_omp(title), ScreenVerdict::State(AgentState::Idle)),
+ "{} should be idle",
+ title
+ );
+ }
+ for title in ["π !", "π ! omp-probe"] {
+ assert!(
+ matches!(eval_omp(title), ScreenVerdict::State(AgentState::Blocked)),
+ "{} should be blocked",
+ title
+ );
+ }
+ }
+
+ /// `tui.titleState` off writes `π: <session>`; that says nothing about
+ /// the run state, so the manifest must not guess.
+ #[test]
+ fn omp_title_without_state_is_not_guessed() {
+ for title in ["π:", "π: omp-probe", "π", "π omp-probe", "", "omp"] {
+ assert!(
+ matches!(eval_omp(title), ScreenVerdict::NoMatch),
+ "{} should not classify",
+ title
+ );
+ }
+ }
+}
diff --git a/wezterm-gui/src/agent_status/mod.rs b/wezterm-gui/src/agent_status/mod.rs
index e4d83313..331fbc1c 100644
--- a/wezterm-gui/src/agent_status/mod.rs
+++ b/wezterm-gui/src/agent_status/mod.rs
@@ -519,7 +519,7 @@ pub(crate) const SUPPORTED_AGENTS: &[(&str, &[&str], IntegrationKind)] = &[
("pi", &["pi"], IntegrationKind::ScreenRules),
("opencode", &["opencode"], IntegrationKind::ScreenRules),
("kimi", &["kimi"], IntegrationKind::ScreenRules),
- ("omp", &["omp"], IntegrationKind::Pending),
+ ("omp", &["omp"], IntegrationKind::ScreenRules),
("soul", &["soul"], IntegrationKind::Native),
];