Skip to content

fix: keep the engine to this computer, show local paths in agent requests, and start Windows launchers safely - #18

Merged
nodemode-ai merged 10 commits into
mainfrom
fix/review-2026-11-28
Nov 29, 2026
Merged

nodemode-ai merged 10 commits into
mainfrom
fix/review-2026-11-28

Conversation

@gbarnai

@gbarnai gbarnai commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Any HTTP request or WebSocket whose Host is not localhost, 127.0.0.1, ::1 or tauri.localhost is now refused. /api/live and the window key claim now check Origin and Host.
  • registry.checkout can only be changed from the window. A checkout given to submit from the command line or MCP is used for that one submit and is not saved.
  • Agent requests now show the resolved local path a tool will read or write. Control and direction characters in it are shown as escapes.
  • package out must be a folder or a file name ending in .formpkg. A trailing separator still makes a new folder, and the file is written through an exclusive temporary file.
  • run_op decides once whether a call goes to the running engine, so a call that skipped consent is never run in-process.
  • At most eight agent requests can wait at once. The answer, request list and health routes run on the event loop.
  • On Windows, npm .cmd launchers are followed to their node script or program and started directly. Any other .cmd or .bat gets only plain words: no control characters, %, double quotes or & | < > ^ ( ) !.
  • On Windows, agents install registers formext.bat, and the Codex command is written as a valid TOML string.
  • Tests cover each change. Not run: anything on Windows (covered by tests that simulate win32).
  • On Windows, when a word cannot be passed safely to a .cmd or .bat launcher through cmd.exe, the refusal message now suggests passing long or special text through stdin or a file.
  • Added tests for the command script refusal message, for a capitalised .BAT launcher using COMSPEC from the environment, and for an npm launcher with no node to run it falling back to plain words only.

Tests

  • Each fix has a test that fails on the previous code where practical.
  • The repo CI commands were run locally on macOS. Every failure seen locally also fails on main in the same environment (missing local tools or platform-specific tests); none is introduced here.
  • Please rely on this PR's CI run for Linux and Windows.

For the owner

  • A few related items need an owner decision; they are listed separately, not here.

How to ship

  • Independent of other repos; merge in any order. No version bump; release as usual.

A checkout given to submit from the command line or the MCP server is
now used for that submit only, passed in the request body, and is not
saved. Only the window can change registry.checkout, as with
agent_access.
…pkg files

The request the window shows for an outside tool call now names the
local file or folder the call reads or writes. package out is a folder
or a file name ending in .formpkg, written through a temporary file.
run_op decides once whether a call goes to the running engine, so a
call is never run in this process after that answer.
At most eight outside requests wait for an answer at once; another is
refused at once with a sentence. The answer, request list and health
routes run on the event loop, so waiting requests cannot hold them up.
Every HTTP request and WebSocket whose Host is not localhost,
127.0.0.1, ::1 or tauri.localhost is refused, and the live event
socket now checks Origin and Host as the terminal sockets do. The
loopback check moves to services/local_host.py and the terminal
routes use it. Test clients address the engine at 127.0.0.1.
… TOML string

agents install and the Studio's own agent tabs now name formext.bat as
the MCP launcher on Windows, and the Codex block escapes the command
path, so a Windows path keeps config.toml readable.
…s to cmd.exe

services/agent_start.py follows an npm .cmd launcher to the node script
or program it runs and starts that directly. Any other .cmd or .bat
goes through the command interpreter only when no word has a control
character, %, a double quote, or one of & | < > ^ ( ) ! outside a word
that will be quoted. The shared finder is left unchanged.
…r not

cmd /c can drop the outer quotes of a command line that holds more than
two quote characters, for example when the launcher folder has a space,
so a quoted word is no protection there. Any word with one of
& | < > ^ ( ) ! is now refused for a .cmd or .bat that is not an npm
launcher.
…requests

The request text now names the path a tool will really touch, with
control and direction characters written as escapes. package out keeps
a trailing separator so a new folder is made, and writes through an
exclusive temporary file. Claiming the window key checks Origin and
Host.
A word that cannot be passed safely to a .cmd or .bat launcher through
cmd.exe is refused with a message that now suggests stdin or a file for
long or special text. Tests cover the message, a capitalised .BAT with
COMSPEC from the environment, and an npm launcher with no node to run it.
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner November 29, 2026 18:17
@nodemode-ai
nodemode-ai merged commit 3da4792 into main Nov 29, 2026
3 checks passed
@nodemode-ai
nodemode-ai deleted the fix/review-2026-11-28 branch November 29, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants