fix(desktop): preserve signals in backend exit logs #15406
main fromrefs/pull/15406/head·merged by juliusmarminge View on GitHubA desktop backend killed by a signal was logged as an exit-status read error, hiding the signal in the short-lived trace. Recognize Effect’s signal-exit error and pass killed by SIGKILL through the existing output log and restart event. Genuine exit-status read failures keep their existing error handling.
Fixes #15359. Thanks @SunkenInTime for the diagnosis and original implementation in #15406. Maintainer takeover preserves the contributor commits, merges current main, fixes the renamed HTTP test fixture, and inlines the signal handling.
Verification on headless Linux:
- One PR-specific regression before and after; 28/28 tests in
DesktopBackendManager.test.tspass. Against main the regression fails withBackendProcessExitStatusError; the genuine-error test still passes. - Desktop typecheck, targeted lint, formatting, and whitespace checks pass (two unrelated typecheck suggestions).
- A live Node child launched through the real
runBackendProcessand Effect Node spawner was killed via its captured PID. Result:code: null,reason: "killed by SIGKILL". This used a synthetic readiness response and bootstrap, without launching Electron. - Recognition relies on Effect’s current signal-error message; other errors retain the original fallback.
Not verified on this revision: Windows, macOS, WSL, iOS, Android, or a packaged Electron desktop. The Electron runtime is unavailable in this VM; tests bypassed only its executable-path lookup. The original author’s platform evidence remains in the PR history.
Implementation: GPT-6.1-Sol; tests: GPT-6-Astra; independent reviews: Claude Opus 5.5 and GPT-6-Sol. Orchestrated in T3 Code through the Codex harness.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
Approvability#
Verdict: Approved at
c96d092Macroscope's review found this PR approvable — This focused desktop bug fix preserves signal information in backend exit logs while leaving genuine exit-status failures unchanged. The production change is small and covered by a targeted regression test, with no default, schema, infrastructure, or diagnostic-suppression changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
361d2d86-a77f-4772-a6e9-696481126a2b
📥 Commits
-
Reviewing files that changed from the base of the PR and between 88744f3ddba9d3883ba631f0f4801f1a97fe77ce and 70f39a31dd5cbb66c02d5865a6250dc40da05560.
📒 Files selected for processing (2)
-
apps/desktop/src/backend/DesktopBackendManager.test.tsapps/desktop/src/backend/DesktopBackendManager.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.
-
📝 Walkthrough
-
runBackendProcessnow reports recognized signal-related exit-status failures with a signal-specific reason and no exit code. Other read failures remainBackendProcessExitStatusErrorinstances. A test covers a backend process terminated by SIGKILL.Changes: Backend signal exit reporting
Layer / File(s) Summary Signal-aware exit handling
apps/desktop/src/backend/DesktopBackendManager.ts,apps/desktop/src/backend/DesktopBackendManager.test.tsThe exit-status failure parser extracts signal names. runBackendProcessreturns no exit code and akilled by <signal>reason when a failure identifies a signal; other failures remainBackendProcessExitStatusErrorinstances. The test checks the SIGKILL result.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
70f39-
Signal-terminated backends retain the signal in their logs and restart flow, while genuine status-read failures retain their existing error report. No actionable merge risk is evident.
Pre-merge checks:
4 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Docstring Coverage 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 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold. Passed checks: 4 passed-
Check name Status Explanation Linked Issues check Issue #15359requires signal-terminated backend exits to name the signal in the persisted log and restart event, while retaining the read-error message for genuine status-read failures. `runBackendPro…Out of Scope Changes check All changes are limited to signal-exit handling in DesktopBackendManager.tsand its focused test. They directly support issue#15359. The test is relevant, and no unrelated changes appear in the who…Title check The title clearly and concisely describes the main change: preserving signal information in desktop backend exit logs. Description check The description explains the problem and change, links the issue, and gives detailed verification results and platform limitations. It does not use the template headings or explicitly state the scope … Full details: Linked Issues check
-
Explanation
Issue
#15359requires signal-terminated backend exits to name the signal in the persisted log and restart event, while retaining the read-error message for genuine status-read failures.runBackendProcessnow recognizes the spawner’s signal failure and returnskilled by <signal>; other failures still becomeBackendProcessExitStatusError. The new test checks the SIGKILL result. The PR summary states that existing finalization uses this reason in both durable locations.
Full details: Out of Scope Changes check
-
Explanation
All changes are limited to signal-exit handling in
DesktopBackendManager.tsand its focused test. They directly support issue#15359. The test is relevant, and no unrelated changes appear in the whole-PR diff.
Full details: Description check
-
Explanation
The description explains the problem and change, links the issue, and gives detailed verification results and platform limitations. It does not use the template headings or explicitly state the scope approval or why the fix qualifies without prior approval, but it is otherwise mostly complete.
-
-
- Fix all pre-merge checks with AI
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge added labelsmacroscope-review
Taking over this one as maintainer for desktop-app-03. I will preserve the contributor commits, update it against current main, and run focused verification plus independent reviews. No merge is planned.
juliusmarminge assignedjuliusmarminge
juliusmarminge changed the title
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged this3b744af
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed