Skip to content

fix(sandbox): await SFTP writes before acknowledging - #3568

Merged
drew merged 1 commit into
mainfrom
codex/fix-sftp-write-ack-race
Sep 22, 2026
Merged

drew merged 1 commit into
mainfrom
codex/fix-sftp-write-ack-race

Conversation

@drew

@drew drew commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ensure the sandbox SFTP handler does not acknowledge a write until Tokio has completed the underlying blocking filesystem operation. This prevents helper shutdown from racing the final buffered write and reporting success while the destination file is still empty.

Related Issue

No issue required: this is an obvious localized correctness fix found while investigating the flaky CI failure in #3550.

Changes

  • Flush each tokio::fs::File write before returning the SFTP success response.
  • Keep the existing protocol surface and regression test unchanged.

Testing

  • mise run pre-commit
  • cargo test -p openshell-sandbox --no-fail-fast (228 passed, 1 ignored)
  • Existing SFTP round-trip test passed 1,000 consecutive iterations after reproducing the pre-fix failure on iteration 4.
  • E2E tests added or updated (not applicable for this localized SFTP write-completion fix)

Checklist

  • Follows Conventional Commits.
  • Commit is signed off for DCO.
  • Documentation reviewed; no user-facing or architecture documentation changes are needed.

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
@drew
drew enabled auto-merge September 22, 2026 23:03
@drew
drew added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit feff897 Sep 22, 2026
71 checks passed
@drew
drew deleted the codex/fix-sftp-write-ack-race branch September 22, 2026 23:14
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