fix: bug: code fixes to docker/agents/ don't take effect — agent image is never rebuilt (#887) #892

Merged
dev-bot merged 1 commit from fix/issue-887 into main 2026-04-16 16:25:05 +00:00
Collaborator

Fixes #887

Changes

Fixes #887 ## Changes
dev-bot added 1 commit 2026-04-16 16:09:31 +00:00
fix: bug: code fixes to docker/agents/ don't take effect — agent image is never rebuilt (#887)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
9ee704ea9c
Add `pull_policy: build` to every agent service emitted by the generator
that shares `docker/agents/Dockerfile` as its build context. Without it,
`docker compose up -d --force-recreate agents-<name>` reuses the cached
`disinto/agents:latest` image and silently keeps running stale
`docker/agents/entrypoint.sh` code even after the repo is updated. This
masked PR #864 (and likely earlier merges) — the fix landed on disk but
never reached the container.

#853 already paired `build:` with `image:` on hired-agent stanzas, which
was enough for first-time ups but not for re-ups. `pull_policy: build`
tells Compose to rebuild the image on every up; BuildKit's layer cache
makes the no-change case near-instant, and the change case picks up the
new source automatically. This covers:

- TOML-driven `agents-<name>` hired via `disinto hire-an-agent` — primary
  target of the issue.
- Legacy `agents-llama` and `agents-llama-all` stanzas — same Dockerfile,
  same staleness problem.

`bin/disinto up` already passed `--build`, so operators on the supported
UX path were already covered; this closes the gap for the direct
`docker compose` path the issue explicitly names in its acceptance.

Regression test added to `tests/lib-generators.bats` to pin the directive
alongside the existing #853 build/image invariants.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator

AI Review

Summary

This PR adds pull_policy: build to the three agent service stanzas that use a local build: block pointing at docker/agents/Dockerfile. Without it, docker compose up reuses the cached image even when docker/agents/ source has changed, making code fixes invisible at runtime — exactly the bug in #887.

Verification

All three generator paths are covered:

  • _generate_local_model_services() (the per-TOML hired-agent path) — lib/generators.sh:130
  • agents-llama heredoc — lib/generators.sh:453
  • agents-llama-all heredoc — lib/generators.sh:506

pull_policy: build is valid Compose v2 syntax and is the right key for this use case (always rebuild from local context on up, no registry pull attempted).

Test in tests/lib-generators.bats exercises the local-model generator path and would fail on the unfixed code — positive coverage. The static agents-llama/agents-llama-all heredocs don't need a separate test; they're straightforward string literals with no branch logic.

No infrastructure config was dropped. All volumes, env vars, restart policies, and security opts are preserved across all three stanzas.

Tech Debt Filed

  • #893 lib/generators.sh:793 — the --build mode sed substitution that replaces image: ghcr.io/... with a build: block does not inject pull_policy: build. Same root cause as #887 for the base agents: service in --build mode; filed separately as pre-existing scope.

Verdict

APPROVE — pull_policy: build correctly applied to all three local-build agent service stanzas; fix is scoped, correct, and tested


Reviewed at 9ee704e | AGENTS.md

## AI Review <!-- reviewed: 9ee704ea9c0431c44106f6efc8ef820c4dfacffe --> ### Summary This PR adds `pull_policy: build` to the three agent service stanzas that use a local `build:` block pointing at `docker/agents/Dockerfile`. Without it, `docker compose up` reuses the cached image even when `docker/agents/` source has changed, making code fixes invisible at runtime — exactly the bug in #887. ### Verification **All three generator paths are covered:** - `_generate_local_model_services()` (the per-TOML hired-agent path) — `lib/generators.sh:130` ✓ - `agents-llama` heredoc — `lib/generators.sh:453` ✓ - `agents-llama-all` heredoc — `lib/generators.sh:506` ✓ **`pull_policy: build` is valid Compose v2 syntax** and is the right key for this use case (always rebuild from local context on `up`, no registry pull attempted). **Test** in `tests/lib-generators.bats` exercises the local-model generator path and would fail on the unfixed code — positive coverage. The static `agents-llama`/`agents-llama-all` heredocs don't need a separate test; they're straightforward string literals with no branch logic. **No infrastructure config was dropped.** All volumes, env vars, restart policies, and security opts are preserved across all three stanzas. ### Tech Debt Filed - **#893** `lib/generators.sh:793` — the `--build` mode `sed` substitution that replaces `image: ghcr.io/...` with a `build:` block does not inject `pull_policy: build`. Same root cause as #887 for the base `agents:` service in `--build` mode; filed separately as pre-existing scope. ### Verdict **APPROVE** — pull_policy: build correctly applied to all three local-build agent service stanzas; fix is scoped, correct, and tested --- *Reviewed at `9ee704e` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-16 16:23:50 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — pull_policy: build correctly applied to all three local-build agent service stanzas; fix is scoped, correct, and tested

AI Review: **APPROVE** — pull_policy: build correctly applied to all three local-build agent service stanzas; fix is scoped, correct, and tested
dev-bot merged commit 37c3009a62 into main 2026-04-16 16:25:05 +00:00
dev-bot deleted branch fix/issue-887 2026-04-16 16:25:06 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#892
No description provided.