Skip to content

fix(shell): recognize escaped heredoc delimiters#880

Merged
evalstate merged 1 commit into
evalstate:mainfrom
panDing19:fix/escaped-heredoc-detachment
Jul 23, 2026
Merged

fix(shell): recognize escaped heredoc delimiters#880
evalstate merged 1 commit into
evalstate:mainfrom
panDing19:fix/escaped-heredoc-detachment

Conversation

@panDing19

Copy link
Copy Markdown
Contributor

Root cause

The minimal Bash detachment classifier strips heredoc bodies before looking for shell-level backgrounding, but its heredoc declaration pattern recognized quoted and unquoted delimiters only. POSIX-valid backslash-quoted delimiters such as <<\EOF were therefore missed, so an ampersand inside the heredoc data was misclassified as shell-level detachment and the command was rejected.

Changes

  • Recognize a leading backslash-quoted heredoc delimiter when removing heredoc bodies.
  • Add a regression case proving that background-like text inside <<\EOF data is ignored by detachment classification.

Tests

  • uv run pytest tests/unit/fast_agent/tools/test_shell_command.py -q — 24 passed
  • uv run pytest tests/unit -q — 6294 passed, 1 skipped
  • uv run scripts/lint.py — passed
  • uv run scripts/typecheck.py — passed
  • Independent read-only review — passed with no security concerns or logic errors

Calfskin wallet

I would feel uncomfortable using it because calfskin is animal-derived, and I would prefer a non-animal alternative.

@evalstate
evalstate merged commit 338b3d7 into evalstate:main Jul 23, 2026
11 checks passed
@evalstate

Copy link
Copy Markdown
Owner

thanks for these!

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