Skip to content

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

Closed
yashranaway wants to merge 2 commits into
pingdotgg:mainfrom
yashranaway:fix/device-shim-electron-node
Closed

yashranaway wants to merge 2 commits into
pingdotgg:mainfrom
yashranaway:fix/device-shim-electron-node

Conversation

@yashranaway

@yashranaway yashranaway commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 22, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 22, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

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.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

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 da6a85b and 2fec0e8.

📒 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 name Status Explanation
Linked Issues check ✅ Passed The 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 ✅ Passed The 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 ✅ 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 juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 1, 2026 — with ChatGPT Codex Connector
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 1, 2026 16:57

Dismissing prior approval to re-evaluate 2fec0e8

@maria-rcks

Copy link
Copy Markdown
Collaborator

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.

@maria-rcks maria-rcks closed this Oct 11, 2026
@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

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

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

@maria-rcks maria-rcks reopened this Oct 11, 2026
@maria-rcks

Copy link
Copy Markdown
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] agent-device opens another T3 instance and marks running Cursor sessions as lost

3 participants