Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Security-sensitive guard clearedThis PR no longer has blocked security-sensitive file changes. A future security-sensitive change requires a fresh
|
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 6:30 PM ET / 22:30 UTC. ClawSweeper reviewWhat this changesThe PR serializes sandbox reads with earlier writes, edits, and patch operations for the same physical file, including remote aliases. Merge readinessThe race remains on current main and the branch repairs its shared queue boundary with credible real-run evidence, but it adds an optional public sandbox-plugin API that needs owner confirmation before merge. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherAgent coding tools read and mutate files through sandbox filesystem bridges. The shared queue prevents same-file tool calls in one assistant turn from observing a write before it finishes. flowchart LR
A[Parallel agent tool calls] --> B[Read write edit and patch tools]
B --> C[Bridge resolves physical file identity]
C --> D[Per-file admission queue]
D --> E[Local or remote sandbox filesystem]
E --> F[Read snapshot or mutation result]
Decision needed
Why: The patch is functionally coherent and preserves existing bridge implementations, but the type is exported through the plugin SDK and therefore sets a durable external contract. Before merge
Agent review detailsSecurityNone. PR surfaceSource +196, Tests +114. Total +310 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one canonical queue-identity boundary, and approve the narrow optional SDK capability only if sandbox-backend owners accept it as the supported way to expose physical file identity. Do we have a high-confidence way to reproduce the issue? Yes, source reproducible: current main reads immediately after path resolution without joining the mutation queue, and the PR supplies a matching real red/green scenario. Is this the best way to solve the issue? Unclear pending API direction: shared physical identity is the right repair layer, but maintainers must decide whether its public plugin SDK surface is acceptable. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b181d789837d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
Co-authored-by: Ayaan Zaidi <[email protected]>
|
Thanks @malimo! Proof: On exact head
Example
|
What Problem This Solves
Same-turn tool calls can run in parallel. A write and read of the same new sandbox file could race. The read could return
File not foundeven though the accepted write finished moments later.Why This Change Was Made
write,edit, andapply_patchalready share one per-file operation queue.readnow joins that queue through path resolution, access, and byte capture. The queue releases before image handling, text decoding, truncation, and result formatting.Sandbox bridges now own physical file identity. This makes host-mirror, remote-workspace, and filesystem-alias spellings converge before the operation is registered. When identity lookup is asynchronous, registration keeps the provider's tool-call order even if the later lookup finishes first. Identity lookups still run concurrently, and operations on different files remain parallel.
Bridge identity stays internal. The public
SandboxFsBridgecontract is unchanged, and existing plugin bridges retain their resolved-path identity behavior. This change adds no retry, configuration, protocol, or storage path.User Impact
An agent can write and read one file in the same turn without an intermittent stale or missing-file result. Independent files do not wait for the write to finish.
Evidence
Live red and green
A real Telegram Test Server direct-message turn used one provider response with three parallel calls:
same-turn-written-by-providerthrough the remote workspace path.parallel-control.txtfile.The proof delayed the real write for 1.5 seconds before file creation.
mainatef858c0f1bbFile not foundbefore the write finishedparallel-controlduring the delay4954c13058csame-turn-written-by-providerparallel-controlduring the delayCurrent
mainadvanced to599b46c49bbafter the red run. The queue, sandbox bridge, tool, and agent-loop files are unchanged from the proven revision.The final Telegram reply was:
The retained provider requests contain the real tool results. The filesystem timeline records the full pre-creation delay. The final command read both values from disk. The exact build records
4954c13058cd0c3c26607e977378a49611b95f6cin its build metadata.Regression support
statbefore the write registers.check-changedpasses production and test types, lint, formatting, dead exports, import cycles, and repository guards.Scope
🤖 Generated with Claude Code