Repository navigation
fix(sed): fall back to direct write when hidden temp file is refused - #2659
Merged
Merged
Conversation
sed -i and yq -i stage through a .bashkit-<tool>-<hex>.tmp sibling. Embedder policies that refuse dot paths (e.g. a read/write workspace policy) made sed exit 4 with the file unchanged. When the temporary cannot be checked or written, replace the target with one all-or-nothing write_file and restore its mode. Chmod/rename failures still fail with the source untouched.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | eaad228 | Commit Preview URL Branch Preview URL |
Oct 09 2026, 04:19 PM |
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.
Requested by Михайло · project thread
What changed
sed -iandyq -inow work on filesystems or embedder policies that refuse dot paths. They still stage through the hidden.bashkit-<tool>-<hex>.tmpsibling when allowed; when the backend refuses to check or write that temporary, they replace the target with a singlewrite_fileand restore its mode. Chmod and rename failures on an accepted temporary still fail with the source untouched.Why
Framework agents with a read/write workspace (
WorkspacePolicy::read_write()) deny writes to dot paths, sosed -iexited 4 and left the file unchanged. It hit 2 of 3 live runs of the repo-release agent.Before / After
New
sed_inplace_policy_testswrapInMemoryFsin a filesystem that refuses any dot-named path.Before (main):
sed -i 's/1/2/' notes.txtexits non-zero, file unchanged; 3 of 4 tests fail.After: file rewritten, mode preserved (0640), no temporary left; 4/4 pass. Editing a refused target itself (
.env) still fails and leaves it intact, so the fallback does not bypass the policy.Risk
write_fileis all-or-nothing (TM-FS-014 forRealFs), and the existing TM-FS-016 failpoint suites (allocate, every backend-write class, chmod, rename) still pass. Threat model row updated.Checklist