Skip to content

chore(wsl): keep the Sleep folder and bridge-exit lines in the local trace - #35378

Merged
nwparker merged 3 commits into
mainfrom
nwparker/wsl-sleep-folder-trace
Oct 28, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/wsl-sleep-folder-trace

Conversation

@nwparker

@nwparker nwparker commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​48 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​74 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​61

ELI5

Two diagnostic lines that explain how WSL terminals behave on Sleep and on a distro shutdown were only printed to the console. A packaged build keeps no console output, so on a real device nobody could see them. They're now also written to Orca's local trace file, which is already kept on disk.

What Changed

  • logWslPaneDiagnostic (new, src/main/daemon/daemon-wsl-diagnostic-log.ts) prints the line as before. It also records a span in the local trace (<userData>/logs/main.trace.ndjson), with the full line plus its facts as separate fields.
  • Sleep: the [history] Sleep folder for … line (chore(wsl): log what a Sleep's folder read saw for each terminal #35150) becomes span wsl.sleep-folder, with fields probe (wsl/live), distro, live, folderFound, elapsedMs, and for the WSL probe rows, shells, timedOut and budgetMs.
  • Bridge exit: the [pty] WSL bridge exit: … verdict line becomes span wsl.bridge-exit, with fields verdict, distro, code and probeMs.

Why

  • verify-18 (b): the device run couldn't see these lines, because the main process's stdout isn't persisted on a packaged build. The local trace sink is already on by default (off only in CI or with ORCA_DIAGNOSTICS_DISABLED), is written by the same process, and is collected by the diagnostics bundle. That makes it the persisted log this process already has.
  • daemon.log is written by the terminal daemon process, not by the process that logs these lines. Sending them there would need a new daemon request.
  • The span goes through the tracer's normal client-side redaction. A tracing failure never fails a Sleep or an exit.

Flag-off: not behind the WSL hosts gate. Bridge panes exist with it off, and the lines are emitted with the gate on or off.

User risk: none. This adds one small trace record per WSL pane Sleep and per bridge exit, and nothing changes in behaviour.

Linked Issue

Internal: verify-18 item (b); unblocks device diagnosis of the p8 Sleep→Wake folder branches.

Visual Proof

N/A.

Testing

  • daemon-pty-adapter-wsl-sleep-cwd.test.ts: a Sleep records a wsl.sleep-folder span carrying the same line and its probe facts.
  • daemon-pty-adapter-wsl-distro-loss.test.ts: each bridge exit records a wsl.bridge-exit span with its verdict, distro and code.
  • pnpm tc:node, oxlint, pnpm run check:code-quality:changed and the ast-grep gate pass. src/main/daemon and src/main/observability: 3,328 passed.

AI Disclosure

Written with Claude Code.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…trace

A packaged build keeps no console, so #35150's Sleep folder line and the WSL bridge exit verdict
were invisible on a device. Each now also goes to main.trace.ndjson as a span with the line and
its facts as filterable fields.

Co-Authored-By: Claude <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable defects were found.

Summary

Keeps Sleep-folder and WSL bridge-exit diagnostics in the local trace while preserving console output.

  • WSL Sleep and bridge exits now leave details in local traces.

No actionable issues found. Tests were not run during this review.

Reviews (3) · Last reviewed commit: "Merge branch 'main' into nwparker/wsl-sl..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 26e2a6d8-1ca3-431b-8acb-31eab657dd3f
Commits

Reviewing files that changed from the base of the PR and between 6e590d6 and b1a3c52.

Files selected for processing: 6
  • src/main/daemon/daemon-pty-adapter-wsl-distro-loss.test.ts
  • src/main/daemon/daemon-pty-adapter-wsl-sleep-cwd.test.ts
  • src/main/daemon/daemon-pty-adapter.ts
  • src/main/daemon/daemon-pty-session-control.ts
  • src/main/daemon/daemon-wsl-diagnostic-log.ts
  • src/main/daemon/daemon-wsl-sleep-cwd.ts

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: b577b1d6-6a81-4740-88d0-414ffe23195d
Commits

Reviewing files that changed from the base of the PR and between 88e23db and 6e590d6.

Files selected for processing: 6
  • src/main/daemon/daemon-pty-adapter-wsl-distro-loss.test.ts
  • src/main/daemon/daemon-pty-adapter-wsl-sleep-cwd.test.ts
  • src/main/daemon/daemon-pty-adapter.ts
  • src/main/daemon/daemon-pty-session-control.ts
  • src/main/daemon/daemon-wsl-diagnostic-log.ts
  • src/main/daemon/daemon-wsl-sleep-cwd.ts

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

Walkthrough

WSL bridge-exit and sleep-folder diagnostics now use logWslPaneDiagnostic to write console messages and record spans with structured attributes. The sleep-folder path uses sleepFolderAttributes to build its span fields. Tests capture spans and check the recorded names and attributes.

Priority: Normal

Merge Risk: Minimal · previous review 6e590

When diagnostics are enabled, WSL Sleep and bridge-exit records reach the trace. No merge-blocking risk was identified.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description covers the change, rationale, testing, AI disclosure, and checklist. However, the Linked Issue section does not provide an actual issue link and only references “verify-18 item (b),” w… Add the actual issue URL or issue reference in the Linked Issue section, using the required format such as “Fixes #123” or the repository’s standard linked-issue syntax. Complete or explain any remaining required sections, including Review …
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… 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 identifies the main change: preserving WSL Sleep-folder and bridge-exit diagnostics in the local trace.
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 covers the change, rationale, testing, AI disclosure, and checklist. However, the Linked Issue section does not provide an actual issue link and only references “verify-18 item (b),” while the template requires a linked issue.

Resolution

Add the actual issue URL or issue reference in the Linked Issue section, using the required format such as “Fixes #123” or the repository’s standard linked-issue syntax. Complete or explain any remaining required sections, including Review and Notes, if applicable.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. 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 2 functions across 6 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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.

@nwparker
nwparker merged commit a03598d into main Oct 28, 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