You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(daemon): stop scanning launched agents' output for command-finished - #40599
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).
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: 5
Check name
Status
Explanation
Title check
The title clearly identifies the performance change: stopping command-finished scanning of launched agents’ output.
Description check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
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
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.
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
Checks
pnpm tcand the changed-code quality gate pass.