fix(bash): align tool description with per-call working directory - #44
Merged
Merged
Conversation
Correct the LLM-facing Bash description: each invocation starts a new shell in the current bound worktree, or the backend default when unbound. Directory changes and shell state do not persist across calls; dependent commands must set their directory in the same invocation using host-compatible syntax. Keep runtime isolation unchanged. Add registered-description checks, per-call context rebinding/default-cwd coverage, and real LocalBackend POSIX subprocess regressions for cd, exports, paths with spaces and persistent filesystem writes. Refs #43. Local validation: Python syntax and prompt-contract checks only; full dependency-backed tests are delegated to repository CI.
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.
Result
Merged into
mainas 4bdfca1, after the complete PR CI and Windows install smoke passed. The merge used GitHub's normal PR endpoint with expected headb107fe69591ad3186af086835831f6f81db60fab.A read-back of
mainconfirms treeb2930cd6b6aec9cabda0c769c4d77a69becee8d5, identical to the tested PR head. Issue #43 is now closed with reasoncompleted.Fixes #43.
What changed
The report was correct: the Bash description promised working-directory persistence, but the tool deliberately resolves
current_worktree_path()and launches a new backend invocation on every call. This PR corrects the model-facing description rather than introducing shared mutable shell state.cd, exported variables and aliases do not persist between calls.Only two files changed:
openprogram/programs/tools/files/bash/prompt.pyand the newtests/component/programs/tools/test_bash_cwd.py.Regression coverage
Five parametrized cases:
cddoes not affect subsequent calls, same-callcdhandles paths with spaces, exports do not leak, and ordinary local filesystem writes persist. Cover a bound worktree and the backend-default directory (two cases).The real-shell cases use POSIX syntax and are explicitly skipped on Windows. The description and cwd-routing cases are platform-independent. The shell tests replace only their own sandbox configuration; production sandbox behavior is unchanged.
Completed remote verification
Both workflows completed successfully on the first attempt before merge:
The component job ran the complete component selection on Ubuntu with Python 3.12.14:
That selection includes the new Bash regression file. Skipped and expected-failing cases are not counted as verified behavior; the quiet suite log does not enumerate individual passing case names.
Local validation was limited to Python AST/syntax, the description assertions with an old-description negative control, and a standard-library shell smoke check. Full project execution results above are from GitHub Actions. Uploaded source files were read back and matched the locally checked Git blob SHAs.
No dependency, protocol, workflow, hook or branch-protection changes. No force push or manual patch-application step was used.