fix(apply-all): always write 'store' into the generated manifest - #11
Merged
Merged
Conversation
writeManifest emitted 'store' only when repo.Store differed from the host's global default_store. That made the generated .agentfiles host-dependent: the same repo deployed from a laptop (default_store = "work") and from the agent-runtime container (default_store = "private") produced two different manifests, so whichever host ran apply-all last left the other with a dirty working tree — which in turn made the container's clone_or_pull skip that repo's git pull entirely. Always emitting it also fixes 'af apply' run from inside such a repo, which resolves the bundle against default_store rather than the registry entry and so failed with 'reading bundle: no such file or directory'. Note for deployment: this changes the generated manifest's bytes, so any repo with a committed .agentfiles needs its manifest regenerated (or the 'store' line added by hand) in the same rollout that ships this binary. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Yr6kaXeDJGYJzkbhkVPmf
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.
writeManifestemittedstoreonly whenrepo.Storediffered from the host's globaldefault_store. That makes the generated.agentfileshost-dependent.Concretely: the assistant repo is deployed from two hosts —
default_storerepo.Storeworkprivatestore = "private"privateprivateSo whichever host ran
apply-alllast left the other with a dirty working tree. On the pod that's not cosmetic:entrypoint.sh'sclone_or_pullskipsgit pullfor any repo with a dirty tree, so the agent repo silently stopped updating.Always emitting
storealso fixesaf applyrun from inside such a repo — it resolves the bundle againstdefault_storerather than the registry entry, so on the laptop it failed with:Tests
Two added in
cmd/apply_all_manifest_test.go: output is byte-identical across bothdefault_storevalues, and an entry with no explicit store writes the resolved fallback rather than leaving it implicit. Full suite green.Deployment note
This changes the generated manifest's bytes. Any repo with a committed
.agentfilesneeds its manifest regenerated (or thestoreline added by hand) in the same rollout that ships this binary — otherwise the firstapply-allafter upgrade dirties the tree once. The agent-runtime image pinsagentfiles@v0.8.2, so shipping this needs a tag plus a Dockerfile bump.🤖 Generated with Claude Code
https://claude.ai/code/session_012Yr6kaXeDJGYJzkbhkVPmf