Skip to content

spark-server: accept write paths with spaces and parentheses - #323

Merged
AzeezIsh merged 1 commit into
Atlas-Inf:mainfrom
Enntity:fix/write-path-spaces
Nov 3, 2026
Merged

AzeezIsh merged 1 commit into
Atlas-Inf:mainfrom
Enntity:fix/write-path-spaces

Conversation

@data-angel

Copy link
Copy Markdown
Contributor

Summary

The write-family path check rejected any path containing a space, (, ), &, $, * or ?, treating it as a shell command the model had leaked into the path argument. Real paths carry these characters. A ZCode Edit under /Volumes/JMac Overflow/… was refused with [atlas] Tool call rejected, and the agent's turn ended; every write under a volume like /Volumes/JMac External fails the same way.

The check now rejects only what marks a command rather than a name: tabs, newlines, |, ;, backticks, <, >, && and $(. created && ls -R is still refused. Atlas never runs these paths through a shell; the check exists to catch a model that pasted a command into the path.

Test plan

  • cargo fmt --all -- --check
  • ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --locked -p spark-server --tests (pinned 1.93.1 toolchain): clean
  • SPDX headers present on every changed file (no new files)
  • cargo test -p spark-server: 3,043 passed. 3 fail identically without a git checkout (bench_selfstart serve pin, two tui::bench_variants): they call repo_root().
  • New test validate_write_paths_reject_commands_not_ordinary_names, failing first on main with the production error. It accepts 4 real paths (/Volumes/JMac External/…, /tmp/My Files (2)/notes.md, docs/R&D plan.md, src/main.rs) and rejects 8 values (7 command-shaped, one too short).
  • Deployed on a four-Spark GLM-5.3-Flash ring together with spark-server: send GLM native calls to undeclared tools to the client #322; live repro: a ZCode-style Edit with file_path "/Volumes/JMac External/software/notes (draft).md" now goes out as a tool call.

Notes for reviewers

  • A lone $ ($HOME/x), * and ? are now accepted. They are legal in file names and do not run anything here; the client writes the path as given.
  • validation.rs is on the file-size allow-list; it ends one line shorter.

🤖 Generated with Claude Code

The write-family path check rejected any path containing a space,
parenthesis, `&`, `$`, `*` or `?` as a leaked shell command. Real paths
carry these: a ZCode Edit under "/Volumes/JMac Overflow/..." was refused
with "[atlas] Tool call rejected" and the agent's turn ended, and every
write under "/Volumes/JMac External" failed the same way.

Keep rejecting what marks a command rather than a name: control
characters, `|`, `;`, backticks, redirections, `&&` and `$(`. Paths are
never run by a shell here; the check only catches a model that pasted a
command into the path argument.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@data-angel
data-angel requested a review from AzeezIsh as a code owner November 2, 2026 19:41
data-angel added a commit to Enntity/atlas that referenced this pull request Nov 3, 2026
The fixture path '/tmp/a b' was rejected only because it holds a space.
Atlas-Inf#323 accepts spaces in write paths, so with both changes the call
reaches the client and the finish-reason test fails. '/tmp/a; b' carries
a command separator, which the check rejects before and after Atlas-Inf#323.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AzeezIsh

AzeezIsh commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Gated this head (77da2a99b) on reiner + spark2 against 9c4519131, both built fresh.

  • KL logit drift: exactly 0 (34,245 of 34,245 positions in each of 2 spark-config boots; 36,765 on rc16 with vision).
  • rc16: greedy C1 and C8 8/8 identical; tools 21/21.
  • BFCL ST-995: 87.54 / 86.85 (run-1793657801150500991), the same as its base.
  • Bench: every cell is inside the base's run-to-run range.

Merging on green CI. The main sentinel checks the merged main afterwards.

@AzeezIsh
AzeezIsh merged commit d491136 into Atlas-Inf:main Nov 3, 2026
26 of 27 checks passed
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