Repository navigation
fix #475: guide Windows shell execution and report quoting hazards - #476
Closed
ahmad-ajmal wants to merge 1 commit into
Closed
ahmad-ajmal wants to merge 1 commit into
ahmad-ajmal wants to merge 1 commit into
Conversation
Signed-off-by: ahmad-ajmal <ahmadajmal1514@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Windows shell commands can fail or silently produce incorrect output when an agent wraps PowerShell source in another interpreter. Teach the agent to select PowerShell explicitly and pass raw source. Add the selected shell, resolved interpreter and advisory recovery guidance to Windows
run_shellresults, including successful nested calls that may have changed semantics.Closes #475.
Why
A nested
$n=2; Write-Output $nloses its variables before the inner PowerShell executes. A single-quoted-Commandwrapper can return exit code 0 while printing the script as a string. The new tool and system-prompt guidance explains these traps and gives the direct disk-query payload. Explicit cmd, default/auto routing and intentional nested execution retain their behavior; submitted commands are never rewritten or retried automatically.How to test
python -m unittest discover -s tests/windows_shell -v— 17 tests pass locally on Windows, including seven direct-script cases each on Windows PowerShell and pwsh, the disk query, both silent-output reproductions, parser guidance, cmd compatibility, nonzero exits, timeout registration/cleanup and background completion.ruff format --check .andruff check .with Ruff 0.16.1 — repository-wide checks pass (1655 formatted files).python -m compileall -q app agent_core agents decorators skills— passes.git diff --check— passes.Add a focused Windows CI workflow that runs these tests using only the Python standard library. The tests execute the production function source with real OS processes, while stubbing only Node PATH preparation and cancellation registration. Full user-triggered cancellation and an end-to-end LLM retry-count comparison are not covered.
Scope
Recovery guidance recognizes common nested
powershell/pwsh -Commandwrappers and known parser-error markers. It is advisory and does not establish whether arbitrary successful output is correct. The existing direct-Commandtransport passed the reproductions, so this change does not introduce EncodedCommand or temporary scripts.