Skip to content

perf(daemon): stop scanning launched agents' output for command-finished - #40599

Merged
Jinwoo-H merged 1 commit into
mainfrom
jinwoo/drop-daemon-launch-scan
Nov 10, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
jinwoo/drop-daemon-launch-scan

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What

The background terminal process no longer reads a launched agent's output looking for the "command finished" marker. It still keeps the saved launch so a reopened Orca can pick it back up.

Why

Performance. Every pane Orca launched an agent into paid an extra pass over its output: about 0.3 ms per MB on agent screens, or 1.35% of one core with 48 agents each printing 1 MB/s. That pass only mattered while Orca itself was closed. While Orca is open, Orca already sees the marker and clears the saved launch itself.

What changes for users

  • When Orca is open: nothing.
  • Agent exits while Orca is closed and the pane goes back to the shell: nothing. When Orca reopens it checks what is running, sees the shell and drops the saved launch.
  • Agent exits while Orca is closed and its launch then starts another program (Mac/Linux): reopening Orca sees that program and keeps the old launch settings. A restart before that program ends resumes the agent with them. This is the same as before fix(agent-launch): restarted agents keep the launch they ran with #38998.
  • Windows: nothing. Reopening Orca already can't confirm an agent there.

Checks

  • Daemon session and server tests plus the reattach tests pass (26 files, 167 tests).
  • pnpm tc and the changed-code quality gate pass.
Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​22 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The change removes OSC 133 command-finished scanning from SessionLaunchNote and removes its subprocess-data scan call from Session. Session continues to pass subprocess data to shellReady. SessionLaunchNote still clears the current note only when a retirement token matches. Every arm now replaces the current note. The class documentation states that reattachment’s foreground check catches finishes that occur while Main is down.

Merge Risk: Low · up to c96a7

On Windows, a finished agent may resume with its previous settings after sleep. This bounded restoration risk should be addressed or accepted before merge.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly identifies the performance change: stopping command-finished scanning of launched agents’ output.
Description check Passed The description explains the change, rationale, user impact, and reported checks. It does not include the template’s Linked Issue section, an explicit risk and rollback assessment, or a Visual Proof s…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the change, rationale, user impact, and reported checks. It does not include the template’s Linked Issue section, an explicit risk and rollback assessment, or a Visual Proof section with an N/A reason.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Retire finished launches when Main is detached. · session.ts:76-78

src/main/daemon/sessions/session.ts:76-78
Minor · Functional Correctness · Quick win

Retire finished launches when Main is detached.

If an agent finishes while Main is detached and Windows cannot confirm the shell on reattachment, the daemon retains its launch note and Main treats the launch as unknown. If hook presence also cannot prove exit, a later sleep can preserve an existing same-session recipe and replay its old arguments and environment on resume. Previously, the finish marker cleared the note, so reattachment marked the launch gone.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0f14906a-c09f-4d00-98f4-1a83f2de11c4
Commits

Reviewing files that changed from the base of the PR and between 9d0110a and c96a7d6.

Files selected for processing: 2

  • src/main/daemon/sessions/session-launch-note.ts
  • src/main/daemon/sessions/session.ts
Files with no reviewable changes: 1

  • src/main/daemon/sessions/session.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@Jinwoo-H
Jinwoo-H merged commit 06ee32a into main Nov 10, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant