Skip to content

fix: run Python scripts in a worker, start Windows launchers directly, and fix agent save and data folder handling - #12

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

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

Conversation

@gbarnai

@gbarnai gbarnai commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Python scripts from the Python panel and the workspace scripts folder now run in a dedicated module worker. They reach the editor only through the agent tool handlers, and their requests no longer carry the window key.
  • A launcher that cannot be read still goes through the command interpreter, but only with plain words. The whole line is checked the way the interpreter reads it, including the first and last quote it drops when a folder name has a space. Control characters and % and ! are refused anywhere, special characters are refused outside quotes, and names ending in a dot or space are still treated as launchers. A refusal shows as a clear error in Chat, the agent tabs and the version check.
  • The agent save_project call with no name now saves into the open project, or into a new library project named after the mesh, the same as the window's Save. The tool description and both tools.md copies are updated.
  • A home-relative FORMSURFACE_DATA (and FORMSURFACE_STATIC) is expanded everywhere, and an empty value falls back to the default, so all data stays in one folder.
  • Tests: backend/tests/test_windows_start.py (23 cases) and backend/tests/test_data_folder.py, plus the Playwright test frontend/tests/window/test_python_scripts.py.
  • Windows agent launch: a .cmd or .bat file that cannot be read as a launcher, and so still starts through the command interpreter, now refuses any word containing & | < > ^ ( ) ! % " or a control character, quoted or not, and says to pass long text through standard input or a file.
  • A launcher in a folder whose name has a space, started through the command interpreter, is no longer given a second quoted word, so the line is read as one program and its arguments.
  • Readable npm-style .cmd launchers keep starting the node script or program they wrap directly from an argument list, with every character passed through unchanged.
  • Unit tests cover both launch paths on any OS, using a fake Windows environment.

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.

Chat and the Claude Code tab now start agent programs the same way the
other tabs do. A package manager's .cmd launcher is read and the node
script or program it names is started directly, so a message with line
breaks, quotes or percent signs reaches the program as typed. A launcher
that cannot be read still goes through the command interpreter, which is
now given only words it keeps as text.
Projects, exports, the library and scripts now use the same data folder
as preferences, logs and the engine lock when the folder is given as a
home-relative path that nothing expanded. An empty value falls back to
the default folder, and FORMSURFACE_STATIC is expanded the same way.
Scripts from the Python panel and the workspace scripts folder now run
in a dedicated worker. They reach the editor through the same tool calls
agents use, and their requests no longer carry the window's key, so they
cannot change preferences, open terminals or do anything else only the
window itself may do. Events, plugin buttons and output work as before.
formsurface_save_project with no name now saves into the project that is
open, or into a new project named after the mesh when none is, the same
way the window's own Save does. Before, it used the mesh's name and could
replace another project of that name.
…nchers

A launcher in a folder whose name has a space is now checked the way the
command interpreter reads the line, which drops the first and last quote.
A ! sign is refused in any position, a launcher name ending in a dot or
space is still treated as a launcher, and a launcher that names another
.cmd or .bat goes through the same checks.
A .cmd or .bat file that cannot be read as a launcher still starts
through the Windows command interpreter, where quotes do not keep text
as text. Every word, quoted or not and with or without spaces, is now
refused when it holds & | < > ^ ( ) ! % " or a control character, and
the message says to pass long text through standard input or a file.
A launcher in a folder whose name has a space may not be given another
quoted word. Readable launchers keep starting the program they name
directly, with every character passed through.
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner November 29, 2026 18:19
@nodemode-ai
nodemode-ai merged commit 0539fd6 into main Nov 29, 2026
7 checks passed
@nodemode-ai
nodemode-ai deleted the fix/review-2026-11-28 branch November 29, 2026 18:44
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