Repository navigation
Conversation
This branch has not been deployed
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.
Description
ov snapshot diffand plainov snapshot ignore-getdiscarded stdout write and flush errors. A caller-provided nonblocking pipe could therefore receive only part of the output while the command still exited with status 0.This change makes the raw snapshot output path fallible. Successful output and JSON output stay unchanged. An early reader close (
BrokenPipe) remains normal pipeline completion.WouldBlockand other output failures now use the existing CLI error path and return a nonzero status.Human Involvement
Related Issue
Fixes #6221
External signal: anthropics/claude-code#103055
Type of Change
Changes Made
BrokenPipeas normal pipeline completion.BrokenPipeandWouldBlock.Testing
Validation performed:
rustfmt --edition 2024 --check crates/ov_cli/src/commands/snapshot.rsCARGO_TARGET_DIR=/private/tmp/openviking-pass973-cargo-target CARGO_INCREMENTAL=0 cargo test -p ov_cli commands::snapshot::tests(5 passed)RUST_MIN_STACK=16777216 CARGO_TARGET_DIR=/private/tmp/openviking-pass973-cargo-target CARGO_INCREMENTAL=0 cargo test -p ov_cli(509 unit tests and 4 integration tests passed)ov snapshot diffprobe: the base command wrote 512 of 110,596 bytes to a backpressured nonblocking pipe and exited 0; this branch wrote the same partial prefix, reported the existingIO Error, and exited 1. Blocking-pipe output remained complete on both revisions.git diff --checkThe larger test-thread stack avoids an existing stack overflow in
help_ui::tests::bare_command_group_detection_allows_global_flags_before_command. The same test overflows with the default stack on the untouched base revision.Checklist
Screenshots (if applicable)
Not applicable.
Additional Notes
This PR changes only the two raw snapshot output paths. It does not change the shared JSON renderer or other CLI commands.