Repository navigation
fix(agents): keep a changelog capture going past files the agent can't read - #359
Merged
Merged
Conversation
…t read The claude-code and gemini captures archive /usr/local and /etc with GNU tar. Run as a non-root user, as on a VM sandbox's container, tar can't read /etc/ssl/private and exits 2, so every increment was dropped and an apply had nothing to replay. --ignore-failed-read skips what the agent can't read, which it can't have written either. opencode's capture gets the same flag. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Comment on lines
+401
to
+402
| assert "captured seq=0" in result.stderr, result.stderr | ||
| assert f"{staging.ROOT_PATH}/000000.tgz" in staging.objects |
There was a problem hiding this comment.
The new Gemini test writes marker.txt but only checks that an archive was uploaded. An archive containing metadata alone would pass, even if readable writes were lost. Check that the uploaded archive contains marker.txt, as the Claude Code test does.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tst/unit/agents/gemini/test_object_transfer.py
Line: 401-402
Comment:
**Missing writes could pass**
The new Gemini test writes `marker.txt` but only checks that an archive was uploaded. An archive containing metadata alone would pass, even if readable writes were lost. Check that the uploaded archive contains `marker.txt`, as the Claude Code test does.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
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.
Summary
The claude-code, gemini and opencode agents' changelog captures pass
--ignore-failed-readto GNU tar. A file the agent can't read no longer drops the whole increment. It's skipped, and the rest of the tool call's writes are captured and uploaded.Why
claude-code and gemini capture
/usr/localand/etcby default, beside the workspace and the CLI's state. Their images run as the non-root useragent. Where the agent runs as that user, as in a VM sandbox's container, tar can't read root-only files such as/etc/ssl/privateand exits 2:The post-tool hook treats exit 2 as a failed capture, so it uploaded nothing. An
apply-changelogthen had no increments to replay. The validator's round trip reportedsave: true, apply: true, roundtrip: false, and the marker file never reached the apply agent. Where the agent runs as root, as on a container sandbox, every file is readable, so the round trip passed there. That's why it failed on VMs only.A file the agent can't read is one it couldn't have written, so skipping it loses none of the agent's changes. With the flag, tar exits 0 when the only problem is an unreadable file. A file that changed while it was read still exits 1, which the hook already accepts as a warning.
opencode captures only its workspace by default, so it didn't hit this. Its capture gets the same flag, because a caller may name other roots.
Testing
Unit:
captured seq=0, and uploads the new file. It's skipped as root, who reads everything, and without GNU tar, like the other changelog tests.--listed-incremental=by its position in the tar command line. They now find it by prefix, and one of them checks that--ignore-failed-readis passed.End to end, in a deployment's dev stage on VM sandboxes, with the validator's own round trip (capture agent, marker write,
apply-changelogonto a fresh agent, marker check):tar failed … /etc/ssl/private)--ignore-failed-readadded in the running container/app--ignore-failed-readadded🤖 Generated with Claude Code
The PR appears safe to merge, with a non-blocking gap in the new Gemini test.
Fix with agent prompt
Summary
Adds
--ignore-failed-readto baseline and capture commands for Claude Code, Gemini, and OpenCode.earakely-scaleexplicitly identifies skipping unreadable files as intentional so other writes can still be captured.Reviews (1) · Last reviewed commit: "fix(agents): keep a changelog capture go..." · Reviewed by Greptile