Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): preserve signals in backend exit logs #15406

MergedSunkenInTime(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/15406/headmerged by juliusmarminge View on GitHub

A 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.ts pass. Against main the regression fails with BackendProcessExitStatusError; 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 runBackendProcess and 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 labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at c96d092

      Macroscope'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).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      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.ts
      • apps/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

      runBackendProcess now reports recognized signal-related exit-status failures with a signal-specific reason and no exit code. Other read failures remain BackendProcessExitStatusError instances. 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.ts
      The exit-status failure parser extracts signal names. runBackendProcess returns no exit code and a killed by <signal> reason when a failure identifies a signal; other failures remain BackendProcessExitStatusError instances. 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: Passed 4 · Failed 1
      Failed Failed checks: 1 warning
      Check nameStatusExplanationResolution
      Docstring CoverageWarningDocstring 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 Passed checks: 4 passed
      Check nameStatusExplanation
      Linked Issues checkPassedIssue #15359 requires 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 checkPassedAll changes are limited to signal-exit handling in DesktopBackendManager.ts and its focused test. They directly support issue #15359. The test is relevant, and no unrelated changes appear in the who…
      Title checkPassedThe title clearly and concisely describes the main change: preserving signal information in desktop backend exit logs.
      Description checkPassedThe 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 #15359 requires 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. runBackendProcess now recognizes the spawner’s signal failure and returns killed by &lt;signal&gt;; other failures still become BackendProcessExitStatusError. 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.ts and 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
      Comment `@coderabbitai help` to get the list of available commands.
    4. juliusmarminge added labelsmacroscope-review

    5. 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.

    6. juliusmarminge assignedjuliusmarminge

    7. juliusmarminge changed the title

    8. juliusmarminge merged this3b744af

    9. juliusmarminge closed this

Sign in to join this conversation.