Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(device): run desktop agent-device shims in Node mode #13093

Closedyashranaway(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/13093/headopened View on GitHub

The desktop device shim launches the Electron executable without Node mode. Running agent-device can therefore open another app instance and backend against the same state. Set ELECTRON_RUN_AS_NODE=1 in the POSIX and Windows wrappers and in the generated launcher child environment.

Fixes #12926. This implements the device-shim fix identified in the maintainer triage; the change is confined to device launcher code and tests.

Validation: focused tests pass, with the POSIX regression failing before the fix. It runs the generated shim through a fake desktop executable that refuses to start without Node mode, then checks direct launcher execution. Server typecheck and targeted lint pass. The Windows command-wrapper test is included for Windows runners and was skipped on this Linux host; no live Electron instance was launched.

Model: GPT-6 Harness: Codex in T3 Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved agent-device launching by ensuring the desktop runtime runs in Node mode across Windows and Unix environments.
    • Preserved existing environment cleanup and subprocess behavior.
    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 2fec0e8

      Macroscope's review found this PR approvable — This is a focused device-launcher bug fix that forces the existing POSIX and Windows shims to run the desktop executable in Node mode, with targeted regression tests and no changes to product defaults or static-analysis settings. Its runtime impact is confined to the existing device automation path.

      Notes:

      • Diff unchanged. Approvability was decided on eligibility alone.
      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 →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      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: 8de32dc1-e3fe-4c41-86b2-89f6ec6a5a33

      📥 Commits

      Reviewing files that changed from the base of the PR and between da6a85b1365993d0ff2a79698cd82498de247d8a and 2fec0e82269f59812618db4faaecb96399585de0.

      📒 Files selected for processing (2)
      • apps/server/src/device/AgentDeviceShim.ts
      • apps/server/src/device/AgentDeviceTarget.test.ts

      Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


      📝 Walkthrough

      Walkthrough

      The agent-device launcher and generated Windows and Unix shims now set ELECTRON_RUN_AS_NODE=1. Platform-specific tests verify this behavior for direct launcher execution and the Windows command wrapper.

      Changes

      Agent-device Node-mode launch

      Layer / File(s)Summary
      Launcher environment updates
      apps/server/src/device/AgentDeviceShim.ts
      The launcher subprocess environment and generated Windows and Unix shim scripts set ELECTRON_RUN_AS_NODE=1.
      Platform-specific validation
      apps/server/src/device/AgentDeviceTarget.test.ts
      Non-Windows and Windows tests verify Node mode when the initial environment sets ELECTRON_RUN_AS_NODE=0.

      Priority: ➖ Normal

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix · Severity of issue fixed: Medium

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to 2fec0

      Agent-device launchers now force Electron into Node mode, preventing unintended desktop instances and session disruption. The change is ready to merge.

      🚥 Pre-merge checks | ✅ 5
      ✅ Passed checks (5 passed)
      Check nameStatusExplanation
      Linked Issues check✅ PassedThe PR addresses #12926. AgentDeviceShim.ts sets ELECTRON_RUN_AS_NODE=1 in the generated launcher child environment. The POSIX wrapper exports the variable, and the Windows wrapper sets it before …
      Out of Scope Changes check✅ PassedThe diff only changes agent-device environment setup and adds focused platform-specific tests for that behavior. The changes support the fix for #12926 and do not demonstrate unrelated scope.
      Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
      Title check✅ PassedThe title clearly and concisely describes the main change: running desktop agent-device shims in Node mode.
      Description check✅ PassedThe description covers the problem, the implementation, scope, linked issue, focused verification, skipped Windows validation, and agent details. It provides enough information for review.
      ✨ Finishing Touches 💡 1
      🛠️ Fix failing CI checks 💡
      • Commit to this branch
      • Create a new PR
      🧪 Generate unit tests (beta)
      • Create a new PR

      Comment `@coderabbitai help` to get the list of available commands.
    4. juliusmarminge added labelsmacroscope-review

    5. Note

      Written by claude-opus-5-5 on behalf of Maria

      Hi! We are cleaning up open PRs, and this one appears to have been created with an older model (gpt-6). If this change is really important, we recommend rebuilding the PR with a newer model if possible.

    6. maria-rcks closed this

    7. Note

      Written by claude-opus-5-5 on behalf of Maria

      Reopening, this was closed by mistake. Sorry for the noise!

    8. maria-rcks reopened this

    9. Note

      Written by claude-opus-5-5 on behalf of Maria

      Closing again after a second look, sorry for the back and forth. This PR was opened more than two weeks ago. If this change is still important, please rebuild it on current main with a newer model and note the model in the PR description.

    10. maria-rcks closed this

Sign in to join this conversation.