Skip to content

fix: Google sign-in return, Windows .cmd starts, one service per data folder, panel turn tools, model import size - #15

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

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

Conversation

@gbarnai

@gbarnai gbarnai commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Let the Google sign-in return (GET /api/cloud/google/callback) through the no-Origin cross-site check so Google Drive sign-in can finish. It is still bound to the single-use sign-in state, and the return page now escapes the message it shows.
  • On Windows, an npm .cmd shim now starts its node script directly with the node beside it or on PATH, so line breaks and quotes in a message reach the program unchanged. Any other .cmd or .bat still runs through cmd.exe /c, but only with plain words: no control characters, %, ! or double quotes, and command characters only inside a word that will be quoted. When the program path itself has a space, command characters are refused in every word. Names that end in dots or spaces after .cmd or .bat are handled the same way. The shared finder is now version 1.1.0 and its hash is recorded.
  • Every running service now takes the data folder engine.lock when it starts, refuses to start while another engine holds it, and removes the lock when it stops. This stops two services from writing the same boards.
  • Codex and Cursor panel turns now run in the agent folder whose MCP files point at the running service and send the turn's own token. The rule that let any caller without a token act as the running turn is removed.
  • Model imports have their own 256 MiB limit in the request size check and in read_upload, and are still checked against the pinned SHA-256. Every other upload keeps 64 MiB.
  • Tests: test_f1_guard, test_windows_start (now 28 cases), test_startup, test_agent_programs, test_agent_guards, test_boards_and_clipper. The new cases fail on the previous code.
  • On Windows, a .cmd or .bat program still started through cmd.exe now refuses any word, its own path included, that holds & | < > ^ ( ) ! % " or a control character, whether or not it contains spaces. The message points to the program's .exe, its node script, or standard input or a file for long text.
  • npm-style .cmd shims that wrap an .exe now start that .exe directly with an argv list, as shims that wrap a node script already did.
  • The shared program finder 1.1.0 hash is updated to match.

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.

The browser opens the Google return address as a cross-site navigation
with no Origin header, which the local request check refused, so Google
Drive sign-in could never finish. Allow that one read path through; it is
still bound to the single-use sign-in state. Escape the message shown on
the return page.
A Codex or Cursor turn passes the message as one argument holding line
breaks and quotes, which the Windows command interpreter cannot carry
through a .cmd shim. Read an npm shim and run its node script directly
with the node beside it or on PATH. Any other .cmd or .bat still runs
under the interpreter, but only with words it reads as plain text;
anything else is refused with a clear message.
Only the desktop engine took engine.lock, so a service started by the
MCP server, ./formref serve or ./formref dev let the desktop engine start
a second service over the same data folder, and each overwrote the
other's boards. The service now takes the lock when it starts, unless
its own process already holds it, refuses to start while another holds
it, and lets it go when it stops.
Codex and Cursor turns from the Agent panel ran in the app folder and
relied on the source checkout's MCP files, which the installed app does
not have and which name a fixed port. Run them in the agent folder that
program tabs already use, whose files point at the running service and
send the turn's own token.
… turns

A running Codex or Cursor panel turn let every caller without a token
through and attached its changes to that turn. Those turns now carry
their own token, so a caller without one is treated by the outside
agents setting as at any other time.
The person cutout and sharp cutout files are about 180 MB, above the
64 MiB limit every upload shared, so importing a model file someone
already has could never succeed. Model imports get their own 256 MiB
limit and are still checked against the published hash.
…older

The in-process service now holds the shared test data folder, so a
second engine on it is refused as intended.
The finder changed how it starts .cmd and .bat programs on Windows, so
it carries a new version and its hash is recorded for agents sync.
When the program path itself is quoted, the Windows command interpreter
drops the first and last quote of the line, so a word with a space is no
longer read as quoted. Such a program now gets only words without command
characters. A program name with trailing dots or spaces after .cmd or .bat
is treated as one as well. The finder's 1.1.0 hash is updated.
The Windows command interpreter reads & | < > ^ ( ) ! % and " even inside
quotes, and a .cmd shim re-reads its arguments, so a word with a space is
no safer than one without. Any program still started through cmd.exe now
gets only words that hold none of these characters and no control
character, its own path included, and the refusal points at the .exe, the
node script, or standard input or a file for long text. An npm-style shim
that wraps an .exe now starts that .exe directly with an argv list, as one
that wraps a node script already did. The finder's 1.1.0 hash is updated.
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner November 29, 2026 18:19
@nodemode-ai
nodemode-ai merged commit 75e76c0 into main Nov 29, 2026
5 checks passed
@nodemode-ai
nodemode-ai deleted the fix/review-2026-11-28 branch November 29, 2026 18:52
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