Repository navigation
Restore process-table agent identity via OSC 133-triggered foreground reads - #7189
Merged
brennanb2025 merged 1 commit intoJul 3, 2026
Conversation
… reads Adds a pane foreground-agent tracker that reads the foreground process once when a command starts (OSC 133;C) and marks shell-foreground on command finish (133;D, no RPC), publishing into a pane-keyed store slice. The tab resolver ranks this process identity below live hook rows and above titles, and treats the shell-foreground mark as title-independent launched-agent exit evidence. Local panes only; remote/SSH panes are untouched. Covers agents that emit neither hooks nor titles — the regression left by removing the foreground probe in #7059. Co-authored-by: Orca <help@stably.ai>
brennanb2025
merged commit Jul 3, 2026
b1f5419
into
brennanb2025/codex-icon-running-agent
3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #7059. Restores the one capability the probe removal genuinely lost — process-table identity for agents that emit neither hooks nor titles (aider/goose-class, manual launches) — without resurrecting the parallel per-tab probe pipeline that #7059 was directed to remove.
Process identity is now a producer into the shared store, read at OSC 133 command boundaries, and consumed by the same tab-icon resolver that layers hook/title/launch evidence. One identity hub; no per-tab probe state machine, no retry ladders, no per-title-frame RPCs.
How it works
terminal-command-lifecycle(the existing OSC 133 parser riding on data xterm already parses — zero new stream scanning) now also surfaces133;C(command started). That is exactly the moment a pane's foreground changes.pane-foreground-agent-trackerwaits a short settle (350ms), readsgetForegroundProcessonce (the still-alive daemon RPC with shell/helper→agent ancestry resolution), and maps it through the sharedrecognizeAgentProcess(covers allTUI_AGENT_CONFIGagents). If the read still sees an interpreter wrapper (node/python), one bounded re-read (1.2s) — not a retry ladder.133;D, the tracker marks shell-foreground with no RPC at all — D itself proves the foreground command exited back to the prompt. A new C immediately clears that mark (the foreground left the prompt), closing the stale-evidence window.paneForegroundAgentByPaneKey(new slice) — pane-keyed{ agent, shellForeground }, cleaned up at the existing pane-close and PTY-exit teardown sites.resolveLaunchedAgentExitEvidencetreats the shell-foreground mark as title-independent exit evidence — a TUI that dies without restoring its title no longer keeps painting the tab. A recognized foreground process also arms exit clearing (hasObservedAgentSignal) for launched agents with no hook/title integration.Scope guards
What this fixes (vs #7059 alone)
aider/goose/etc. in a plain terminal tab: correct icon while running (was: no icon).Deferred
Checks
pnpm exec vitest runoverpane-foreground-agent-tracker.test.ts(8),use-tab-agent-process-signals.test.ts(7), plus the fullterminal-pane/,use-tab-agent,tab-agent,diffCommentssuites — 1526 tests passedpnpm run typecheck— passedpnpm run lint— passedMade with Orca 🐋