fix(device): run desktop agent-device shims in Node mode #13093
main fromrefs/pull/13093/head·opened View on GitHubThe 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
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
2fec0e8Macroscope'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.
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.tsapps/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.tsThe 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.tsNon-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:
juliusmarmingeMerge Risk: ⚪ Minimal · up to
2fec0Agent-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 name Status Explanation Linked Issues check ✅ Passed The PR addresses #12926.AgentDeviceShim.tssetsELECTRON_RUN_AS_NODE=1in the generated launcher child environment. The POSIX wrapper exports the variable, and the Windows wrapper sets it before …Out of Scope Changes check ✅ Passed The diff only changes agent-deviceenvironment setup and adds focused platform-specific tests for that behavior. The changes support the fix for#12926and do not demonstrate unrelated scope.Docstring Coverage ✅ Passed No 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 ✅ Passed The title clearly and concisely describes the main change: running desktop agent-device shims in Node mode. Description check ✅ Passed The 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.juliusmarminge added labelsmacroscope-review
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Note
Written by
claude-opus-5-5on behalf of MariaHi! 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.maria-rcks closed this
Note
Written by
claude-opus-5-5on behalf of MariaReopening, this was closed by mistake. Sorry for the noise!
maria-rcks reopened this
Note
Written by
claude-opus-5-5on behalf of MariaClosing 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.
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed