Skip to content

fix(shell): recognize escaped heredoc delimiters#880

Open
panDing19 wants to merge 1 commit into
evalstate:mainfrom
panDing19:fix/escaped-heredoc-detachment
Open

fix(shell): recognize escaped heredoc delimiters#880
panDing19 wants to merge 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.

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.

1 participant