Skip to content

fix(apply-all): always write 'store' into the generated manifest - #11

Merged
devbydaniel merged 1 commit into
mainfrom
fix/deterministic-manifest-store
Aug 3, 2026
Merged

devbydaniel merged 1 commit into
mainfrom
fix/deterministic-manifest-store

Conversation

@devbydaniel

Copy link
Copy Markdown
Owner

writeManifest emitted store only when repo.Store differed from the host's global default_store. That makes the generated .agentfiles host-dependent.

Concretely: the assistant repo is deployed from two hosts —

Host default_store repo.Store Generated manifest
laptop work private includes store = "private"
agent-runtime pod private private omits it

So whichever host ran apply-all last left the other with a dirty working tree. On the pod that's not cosmetic: entrypoint.sh's clone_or_pull skips git pull for any repo with a dirty tree, so the agent repo silently stopped updating.

Always emitting store also fixes af apply run from inside such a repo — it resolves the bundle against default_store rather than the registry entry, so on the laptop it failed with:

resolving manifest: reading bundle "assistant": open /Users/daniel/.agentfiles-work/bundles/assistant.toml: no such file or directory

Tests

Two added in cmd/apply_all_manifest_test.go: output is byte-identical across both default_store values, 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 .agentfiles needs its manifest regenerated (or the store line added by hand) in the same rollout that ships this binary — otherwise the first apply-all after upgrade dirties the tree once. The agent-runtime image pins agentfiles@v0.8.2, so shipping this needs a tag plus a Dockerfile bump.

🤖 Generated with Claude Code

https://claude.ai/code/session_012Yr6kaXeDJGYJzkbhkVPmf

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
@devbydaniel
devbydaniel merged commit 9d83c7f into main Aug 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant