stablyai / stablyai/orca

[Bug]: Agents running inside a user's tmux session are not detected/shown as running

Open
#7,797 1 comment 0 reactions 1 assignee View on GitHub

@OrcaWin is already working on this.

Since Jul 20, 2026.

bug has_repro
Dominant language
TypeScript
Stars
72.1k
Forks
4.7k
Avg merge
14h 54m
Merged PRs (30d)
520

Description

Summary

Orca does not identify running AI agents (e.g. claude, codex) when they run inside a user's tmux session. The agent never shows up as a live/running agent on the pane, worktree, or project view — the pane just reads as tmux.

Note: this is about live agent detection. The file-based Agent Session History (AI Vault, which scans ~/.claude/projects/**) still surfaces the transcript by cwd; only the live/running indicator is missing.

Root cause

Live foreground detection walks the process tree downward from the pane's shell pid and only inspects that subtree:

  • src/main/providers/agent-foreground-process.tscollectDescendants(rows, shellPid)
  • src/relay/pty-shell-utils.ts — the relay twin

When a user runs tmux in an Orca pane, the process in the pane is the tmux client. tmux daemonizes a server (double-fork, reparented to pid 1), and every pane process — including claude — is a child of that server, not of the pane's shell. So the descendant walk from the shell pid reaches only the tmux client (not a recognized agent) and never the agent. It falls back to the client name (tmux).

The OSC path (OSC 133 / OSC 9999 status sequences) also misses it, because tmux does not forward those to the outer terminal by default.

Proposed fix

When the shell's subtree contains a tmux client, hop to that client's active pane pid and re-run the same recognition walk from there:

  1. Detect a tmux client among the descendants.
  2. tmux [-L/-S <sock>] list-clients -F '#{client_pid} #{pane_pid}' → map our client pid to its active pane pid (one call; #{pane_pid} resolves in the client's context).
  3. Re-run the existing descendant recognition from that pane pid (and also consider the pane's own top process, for tmux new-session claude).

Best-effort (any tmux failure falls through unchanged), POSIX-only, mirrored in both the local and relay/SSH paths, with a short TTL cache to avoid forking tmux on every foreground poll.

Environment
  • Affects both local and SSH remote (relay) sessions.
  • POSIX (macOS/Linux); Windows unaffected.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.