Repository navigation
Conversation
The helper accepted its own prior revision only when it carried none or all of the Gateway security defaults admission fills. Each new default made revisions deployed in between look changed outside the helper. For the identified prior revision only, fill the defaults on both sides before comparing: a missing default matches, an explicit different value is still drift. New deployments stay strict.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
This was referenced Oct 28, 2026
Merged
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.
Problem
scripts/first-agent.mjsrefuses to reuse an Agent when the saved or active revision differs from what this helper would deploy. Deployment admission fills the Gateway security defaults that the Configuration leaves unset, and the helper accepted its own identified prior revision only when it carried none or all of those defaults. Each default landed separately (tools.exec.applyPatch.workspaceOnlyin #3903,agents.defaults.sandbox.modein #3951). So a revision deployed by an OCC from between those changes has only some of the defaults. A rerun against that Agent then failed with "This Agent revision was changed outside this helper. Use a new Agent name". The only way to recover was a new Agent name.Change
firstAgentRevisionValuesMatch: for the helper's own identified prior revision (revisionId === priorRevisionId) only, applyadmitGatewaySecurityDefaultsto both the saved values and the configured values before comparing. A default that is merely absent (admission would fill it) now matches. An explicit, different value is still drift, because the fill keeps values that are already set.Verification
tests/integration/first-agent-startup.test.mjsextends the existing identified-revision test with a table of prior revisions missing both defaults, only the sandbox mode, and only apply_patch. Each one matches as the identified prior revision and fails as another revision or a new deployment. Two more cases: an explicitworkspaceOnly: falseand an explicit sandbox mode other thanoffboth still fail on the prior revision.Risks
Low. This is a local development helper. The relaxation applies only to the revision the helper itself recorded, and only for keys that admission fills when they are unset. Explicit looser values and all other drift checks are unchanged.