Repository navigation
feat(claude-code): report a snapshot save's file count and phase durations - #711
Draft
andrewpark-scaleai wants to merge 3 commits into
Conversation
…s in agent-env's logs Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… logs each save ObjectSnapshotSaveResponse gains an optional stats field: the archived file count and the seconds the agent spent archiving and uploading. capture_workspace logs snapshot_save_completed with the workspace archive's size and those stats, or snapshot_save_timeout with how long it waited. An agent that sends no stats still logs its size, with the stats fields empty. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…tions The save response's stats carry the archived file count and the seconds the agent spent archiving and uploading, so agent-env logs them, and the agent's own log line names both durations. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
andrewpark-scaleai
force-pushed
the
andrew-park/rel-snapshot-save-telemetry
branch
3 times, most recently
from
November 18, 2026 23:11
35f6dc0 to
bd5d058
Compare
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.
Stacked on #697 (base is that branch, not
main). Waits for the protocol release that contains #697. Do not mark ready before that release is on PyPI.Why
The goal is that every failure of an agent run leaves enough in the logs to debug it. #697 adds an optional
statsfield to the snapshot save response and makes agent-env log it. This PR makes the claude-code agent fill it, so a slow save says whether archiving or uploading took the time.What
save_snapshottimes the archive and upload phases and returnsstats:file_count,archive_seconds,upload_seconds. Its own log line names both durations.Why this is a separate PR
The claude-code image installs
agentenv-framework-protocolfrom PyPI at or above the floor in itsrequirements.txt, not from this tree. CONTRIBUTING.md and AGENTS.md say an agent's floor rises only once the protocol it names is published. The agent validates its answer against its installed protocol, and the published one (0.1.556 and earlier) has nostatsfield and rejects it, so this code cannot run in the image until a release carries #697. Shipping it with #697 broke the claude-code image build. I kept it out of #697 rather than adding a shim that would exist only to straddle one release.Before marking ready: raise the floor in
src/agent_env/agents/agents/claude-code/requirements.txtto the first published release that contains #697, and updatetst/unit/agents/claude_code/test_image_contract.pyto match. Until then the floor stays at>=0.1.351, and this PR's claude-code snapshot integration tests are expected to fail.How to verify
Result: 40 passed.
test_save_trims_an_incomplete_tail_takes_no_lock_and_uploads_the_bundlepins the stats the agent returns, andtest_a_snapshot_saves_and_loads_through_grantspins that the answer carries them.