Repository navigation
Conversation
…e trace sink exists The ready foundation consumed the hang marker and emitted main_thread_hang_detected before initObservability installed the tracer sink, so the span was a no-op and the trace never showed the hang. Emit it from the observers step instead, after the sink and the lifecycle_started breadcrumb. Claude-Session: https://claude.ai/code/session_01DvNJ16LEPYmdEkpQWtDL7n
…uring a stall Emit main_thread_hang_detected after the trace sink exists (upstream stablyai#26468), and retry the main-thread stack read up to three times while the stall lasts, recording how many reads were tried so a missing stack can be told apart from no attempt. Claude-Session: https://claude.ai/code/session_01DvNJ16LEPYmdEkpQWtDL7n
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughStartup still consumes the hang-detection marker during ready-foundation initialization. Observer initialization now records the durable Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to On successful startup with local tracing enabled, the next run records the previous hang details. The implementation order is correct, but the test does not verify the resulting trace record, leaving a bounded regression-detection gap that can be followed up without blocking merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/startup/main-process-observers-hang-breadcrumb.test.ts (1)
65-85: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd assertions for the breadcrumb payload and trace sink
The test mock records only the breadcrumb name. It can pass when
previousPid,unresponsiveMs, orselfRecoveredis incorrect, and it does not inspect the trace output. Assert the mock call arguments and use a trace-backed fixture to verify that the breadcrumb is persisted.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f06d41b8-1132-44ed-8d15-74d2eb0fc8f3
📒 Files selected for processing (3)
src/main/startup/main-process-observers-hang-breadcrumb.test.tssrc/main/startup/main-process-observers.tssrc/main/startup/main-process-ready-foundation.ts
💤 Files with no reviewable changes (1)
- src/main/startup/main-process-ready-foundation.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
@coderabbitai Added the payload assertion in eb026ba: the test now checks previousPid, unresponsiveMs and selfRecovered. I left out a trace-backed fixture. The bug was the call order relative to initObservability, and the test already pins that order. The tracer's no-op-before-sink behavior is covered by the tracer's own tests. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
ast-grep outline src/main/startup/main-process-observers-hang-breadcrumb.test.ts
sed -n '1,160p' src/main/startup/main-process-observers-hang-breadcrumb.test.ts
ast-grep outline src/main/startup/main-process-observers.ts
rg -n -C 8 'initObservability\(|main_process_lifecycle_started|main_thread_hang_detected' src/main/startup/main-process-observers.tsLength of output: 6486
A trace-backed fixture is not needed for this startup-order regression, given the tracer test coverage you described. ✏️ Learnings added
If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! You are interacting with an AI system. |
…ve operations Enable the existing worker watchdog on Windows and retain a bounded name-only snapshot from atomic shared slots when the main thread stops responding. Preserve the previous marker until the startup trace sink exists, so a new startup hang cannot overwrite the unreported previous run. Adapt the startup-order regression coverage from community PR #26468. Co-authored-by: fanzzzd <[email protected]>
…vidence (#26763) Enable the independent hang watchdog on Windows and preserve the previous run's marker until the startup trace sink is ready. Retain local consent, heartbeat timing, worker cleanup and bounded marker validation. Operation tracking is deferred. Adapt the startup-order regression coverage from community PR #26468. Co-authored-by: fanzzzd <[email protected]>
ELI5
When Orca freezes, a watchdog leaves a note on disk. The next launch reads the note and should write it into the log. It wrote it before the log was open, so the note was lost. This writes it after the log is open.
What Changed
main_thread_hang_detectedis now emitted frominitializeMainProcessObservers, afterinitObservability()and themain_process_lifecycle_startedbreadcrumb. Before,initializeReadyFoundationemitted it while the tracer had no sink, so the span was a no-op. The marker is still consumed in the same place, and the telemetry event already in the observers step is unchanged.Before: after a hang, the next run's
main.trace.ndjsonhas no record of it. After: it has amain_thread_hang_detectedspan with the previous pid, the stall duration and whether it recovered.Why
Moving one emit is the smallest change that puts the breadcrumb behind the sink. Calling
initObservability()earlier would also fix it, but that changes when every startup span starts recording. That is a larger change than this bug needs.Linked Issue
Fixes #26466
Visual Proof
N/A. No UI change; this only affects what goes into the local trace file.
Testing
main-process-observers-hang-breadcrumb.test.tschecks the order: sink init, thenmain_process_lifecycle_started, thenmain_thread_hang_detected. It fails without the change.The existing
main-process-ready*tests pass. Typecheck (node), oxlint and the changed-code gate pass.Platforms: macOS. The change is startup ordering only, with no platform-specific code.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Claude Opus 5.5 (Claude Code). I reviewed the change and the test.
Agent skill upstream boundary
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)https://claude.ai/code/session_01DvNJ16LEPYmdEkpQWtDL7n