Skip to content

fix(perf): preserve TS worker idle deadlines and boot guard diagnostics - #34055

Merged
OrcaWin merged 1 commit into
mainfrom
ram/review-followups
Oct 26, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
ram/review-followups

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Closing unrelated files should not keep an unused TypeScript worker alive. Build failures should report every failed boot guard in one run.

What Changed

  • Start the existing 60-second worker stop timer only when a TypeScript/JavaScript model is disposed or changes to another language. Markdown/plaintext events cannot postpone it. The expiry still checks for reopened TS/JS models, and cleanup still cancels the timer and subscriptions.
  • Report both charset and forbidden-payload violations before returning a failing build status.
  • Pin the literal --max-semi-space-size=4 in the launchd integration test, independently of the production constant.

Why

Unrelated model events could postpone the memory saving indefinitely. A charset failure also returned before the payload diagnostics were printed. The daemon test previously accepted any value in the production flag constant.

Linked Issue

Internal follow-up to review findings on #33810, #33786 and #33837; no separate issue.

Visual Proof

N/A — no visual or interaction changes. This changes worker cleanup scheduling, build error reporting, and a daemon launch test assertion.

Testing

  • Automated tests added/updated.
  • Both regression tests failed against the original implementation: unrelated-model deadline starvation and simultaneous boot-guard diagnostics.
  • macOS: 35 focused tests passed across the worker idle-stop, boot guards, and launchd suites.
  • Worker coverage includes reopening a TS/JS model, language departure, and cleanup cancellation.
  • Boot-guard coverage includes clean output, either failure independently, and both failures together.
  • ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2 passed all 26 checks (format, lint, typecheck, affected tests, ratchets).
  • Linux/Windows packaging and the full PR checks will run in CI.

Review

Self-reviewed event filtering, expiry rechecks, disposal ordering, cleanup, and build exit status. No new polling, broad per-event model scans, or wire changes.

Agent skill upstream boundary

  • Not applicable; no upstream skill source is copied or translated.

Notes

Worker cleanup remains renderer-owned for local and remote projects, folder workspaces and git worktrees. No platform-specific runtime behavior, protocol, security boundary, or mobile UI changes.

Checklist

  • Small and focused; problem and resulting behavior explained.
  • Visual proof is N/A with reason.
  • Self-reviewed for correctness, security, and performance.
  • Cross-platform, SSH/remote, mobile, and folder workspaces considered.
  • Focused tests pass; lint, typecheck, affected tests and ratchets are covered by the local gate and full CI before merge.

@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent 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: 2c0bbefb-ec0d-4f74-8945-cbc8a20df2a0
Commits

Reviewing files that changed from the base of the PR and between 2451037 and 88db84e.

Files selected for processing: 5
  • config/scripts/renderer-boot-graph.mjs
  • config/scripts/renderer-boot-graph.test.mjs
  • src/main/daemon/macos-daemon-launchd.test.ts
  • src/renderer/src/lib/monaco-ts-worker-idle-stop.test.ts
  • src/renderer/src/lib/monaco-ts-worker-idle-stop.ts

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

Walkthrough

The boot graph verifier now reports both two-byte chunks and forbidden payload violations in one run. Monaco worker idle-stop handling now filters disposal and language-change events by model language. Tests cover verifier diagnostics, worker stop timing and cleanup. The macOS launchd test now expects the explicit --max-semi-space-size=4 argument.

Priority: Normal

Merge Risk: Minimal · up to 88db8

No merge-blocking issue is established; proceed with normal checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description is detailed and covers the changes, reasons, testing, review, and compatibility considerations. However, it does not provide the required linked issue in the expected issue-link format… Link an actual issue in the Linked Issue section, preferably with a Fixes #<issue-number> entry. If the referenced review discussions are the only tracking records, confirm that the repository allows those references instead of requiring …
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the two primary changes: preserving TypeScript worker idle deadlines and reporting boot guard diagnostics.
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 is detailed and covers the changes, reasons, testing, review, and compatibility considerations. However, it does not provide the required linked issue in the expected issue-link format and explicitly states that no separate issue exists.

Resolution

Link an actual issue in the Linked Issue section, preferably with a Fixes #&lt;issue-number&gt; entry. If the referenced review discussions are the only tracking records, confirm that the repository allows those references instead of requiring an issue.

Finishing Touches: 💡 1
📝 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

Comment @coderabbitai help to get the list of available commands.

@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed the automated feedback on commit 88db84e724684337b5adb3e4d79b412a6f571155: CodeRabbit reviewed all five files, reported no actionable comments, and rated merge risk minimal.

The two generic warnings do not require code changes:

All 26 local checks and the 35 focused tests passed. Full CI is still running; merge will wait for its aggregate gate.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@OrcaWin
OrcaWin merged commit faaa590 into main Oct 26, 2026
32 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