[2/9] Preserve collision-safe output paths#63
Draft
hi-michael-li wants to merge 2 commits into
Draft
Conversation
This was referenced Jul 13, 2026
183e5cd to
302c59a
Compare
bfb5111 to
1215758
Compare
302c59a to
f7ca694
Compare
1215758 to
edf5641
Compare
Visibility (critical): output-save rejections were invisible at default log levels — the root agent logged result.failed only at DEBUG, and the E2B path regressed from WARNING/ERROR to DEBUG when its override was removed. Rejections now log at WARNING (expected ValueError / FileNotFoundError) or ERROR with traceback (unexpected), the root agent warns per failed file and exposes last_output_files_result, and subagent results now tell the parent model which files failed to transfer. Robustness: a post-write destination-identity refresh failure no longer marks a delivered file as failed; identity helpers only swallow FileNotFoundError (other OSErrors warn instead of silently weakening hard-link collision detection); host-backed saves snapshot sources to a temp directory under the output root instead of buffering whole files in RAM; collision errors name the claiming source; E2B realpath failures include exit code and stderr. Contract: output_source_roots() now returns typed OutputSourceRoot entries (explicit posix/windows flavor and host_path), replacing the implicit ordering and Path-vs-str conventions; destination identities are typed DestinationIdentity values instead of prefix-formatted strings; both are exported for backend implementers. Docstrings and docs/extending/code_backends.md updated: stale "silently overwritten" claims corrected, the Windows-drive rejection claim qualified by flavor, the validate_output_destination double-call protocol and move-vs-copy semantics documented. Tests: new unit coverage for the Windows/POSIX/mixed flavor matrix on POSIX hosts, E2B and Docker as transfer destinations, direct-save and case-alias collisions, file-mode preservation, and the base-class default hooks; the docker to_thread mock now always invokes its function. CI gains a pytest job (it previously ran only lint and type checks, so the mocked E2B suite never ran anywhere). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
Why
Output collection could flatten nested paths, overwrite same-named files, or misclassify valid POSIX filenames that resemble Windows paths. Users could lose or fail to receive generated artifacts.
What
Testing
Stack
Part 2 of 9. Previous: #62. Next: #64.