Files
orca/src/main/runtime
Brennan Benson 8e13485c9b fix(stats): count agent sessions from hook transitions, not OSC titles (STA-2445) (#14657)
* test(stats): dual-record the OSC-title detector against canonical hook transitions

Adds an AgentSessionTransitionRecorder that derives agent-session start/stop
boundaries from agent-hook status transitions, and a side-by-side comparison
that feeds both pipelines into a real StatsCollector.

Nothing is rewired yet — this commit only measures the delta:

                                 title detector   canonical
  hook-only agent                       0             1
  braille-spinner non-agent TUI         1             0
  one agent, one reconnect              2             1
  totals                                3             2

Refs #10201, STA-2445.

* fix(stats): count agent sessions from hook transitions and delete the title detector

Switches StatsCollector off AgentDetector and onto the canonical agent-hook
status stream, then removes the detector and its raw-PTY invocation.

- main/index.ts subscribes the recorder to subscribeEnrichedStatus and
  subscribePaneStatusClear, next to where StatsCollector is constructed.
- orca-runtime.ts no longer feeds raw PTY bytes to a stats detector.
- StatsCollector keys sessions on a stable pane key, not a per-spawn ptyId.

Fixes #10201, refs STA-2445.
2026-08-18 00:35:50 -07:00
..