Skip mirror hydration when the agent reports the sticky disk commit will be denied - #54
Closed
piob-io wants to merge 4 commits into
Closed
Skip mirror hydration when the agent reports the sticky disk commit will be denied#54piob-io wants to merge 4 commits into
piob-io wants to merge 4 commits into
Conversation
…ill be denied The agent's GetStickyDisk response carries commitEarlyDeny when it already knows at expose time that this job's disk commit will be discarded (sticky disk branch protection). Until now the action ignored it: the first job to win the hydration race did the full clone --mirror, the agent then elided the commit, the backend purged the entry, and the next job repeated the clone. Any repository whose jobs are mostly pull requests re-hydrated on every job. Now, when the commit is denied and the mirror does not exist yet, the action skips hydration and clones directly from the remote; a job that is allowed to commit hydrates. An existing mirror is still used read-only, but the deferred post-step sync, GC and commit request are skipped since nothing would persist. Bumps the generated vm-agent packages to a version that includes the commit_early_deny fields. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
While the disk is held the backend treats this job as the hydrator and turns other jobs away, including ones that could commit. Releasing at setup instead of in the post step keeps that window to seconds. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 382ce42. Configure here.
This reverts commit 382ce42.
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 agent's
GetStickyDiskResponsecarriescommit_early_deny/commit_early_deny_reasonwhen it already knows at expose time that this job's disk commit will be elided (sticky disk branch protection:pull_request,issue_comment, non-default-branch jobs). The action ignored it, so on installations with branch protection the first job to win the hydration race did the fullclone --mirrorinline, the agent then elided the commit, the backend purged the entry, and the next job repeated the clone — repositories whose jobs are mostly pull requests re-hydrated on every job and never got a usable mirror.Action-side only; no agent or backend change:
The denied job still exposes/mounts the disk (needed to know whether a mirror already exists) and releases it with
shouldCommit=false,vmHydratedGitMirror=false; the backend keeps the entry unhydrated for the next job that is allowed to commit.Also: the post-step log after
commitStickyDiskno longer says "Successfully committed" unconditionally (the agent may elide the request).Bumps
@buf/blacksmith_vm-agent.*to a version that includes the new fields.Tests:
__test__/blacksmith-cache-commit-denied.test.ts—setupCachemaps the response fields;shouldSkipHydrationon denied+missing / denied+existing / allowed.Link to Devin session: https://app.devin.ai/sessions/a3b42ef15226438faf3f9cdde9662918
Open in Devin Desktop: https://app.devin.ai/desktop/session/a3b42ef15226438faf3f9cdde9662918?variant=devin
Requested by: @piob-io
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled. (Staging)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.