Repository navigation
fix(demo): make ui rebuilds, and every build target stamps the image - #83
Merged
Merged
Conversation
`make ui` served a three-day-old container and said nothing about it. Its first line asked "is anything answering on :7005?", and on a yes printed "Service already up." and went straight to opening the browser. A stale container answers that check exactly as well as a current one, so the target happily opened Studio on an image built before the framework change you had just made β and, in the case that found this, before `0.0.4` was even cut. The container reported `agentship-service: 0.0.3` while the checkout beside it was on `0.0.4` with a rebranded Studio. The image bakes the framework in at build time, from the sibling `../agentship` checkout. So "is something listening?" was never the question worth asking. "Is it running what is in the checkout?" is, and the only honest way to answer it is to build. `ui` now always does. Measured cost when nothing changed: the build is ~1s because every layer is cached, compose recreates the container in ~4s because the stamp makes the image new, and the service takes ~11s to answer /healthz. So 15-30s to open Studio, against 0s before. That is the trade, and it is the right way round: the old behaviour cost nothing and was wrong. `make docker-restart` still reuses the image for anyone iterating on agents rather than on the framework. Separately, the build stamp only reached the image from one of the four targets that build it. `docker-up` passed `AGENTSHIP_BUILD`; `docker-build`, `docker-reload` and `docker-build-clean` did not, so `ARG AGENTSHIP_BUILD=dev` won and /healthz reported `build: dev`. That stamp exists so you can tell which build is answering without shelling into the container, so a reload silently discarding it defeated the one check that would have caught this. It is now a make variable, evaluated once per invocation so every target in a run agrees, and passed by all four. `ui` also prints the build it ended up serving, so the answer is on screen rather than one curl away. Verified by driving the thing it was getting wrong: injected a marker into the sibling checkout's studio.html, confirmed the running service did not serve it (`marker=0`, `build=dev`), ran `make ui`, and confirmed it did (`marker=1`, `build=20261015-055709`). The previous target would have printed "Service already up." and served `marker=0`. Checkout restored afterwards, and the rebuilt image re-verified clean: marker gone, brand palette intact.
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.
What changed, and why
make uiserved a three-day-old container and said nothing about it.Its first line asked "is anything answering on :7005?", and on a yes printed
Service already up.and went straight to opening the browser:A stale container answers that check exactly as well as a current one. So the target happily opened Studio on an image built before the framework change you had just made β in the case that found this, before
0.0.4was even cut. The container reportedagentship-service: 0.0.3and the old Studio branding, while the checkout beside it was on0.0.4with the rebranded one. Nothing on screen suggested the UI was out of date; it looked like the branding change had simply not worked.The image bakes the framework in at build time, from the sibling
../agentshipcheckout (context: ..,COPY agentship/packages/). So "is something listening?" was never the question worth asking. "Is it running what is in the checkout?" is, and the only honest way to answer it is to build.uinow always builds.Separately, the build stamp only reached the image from one of the four targets that build it.
docker-uppassedAGENTSHIP_BUILD;docker-build,docker-reloadanddocker-build-cleandid not, soARG AGENTSHIP_BUILD=devwon and/healthzreportedbuild: dev. That stamp exists precisely so you can tell which build is answering without shelling into the container β a reload silently discarding it defeated the one check that would have caught this. It is now a make variable evaluated once per invocation (:=, so every target in a run agrees) and passed by all four.uialso now prints the build it ended up serving, so the answer is on screen rather than onecurlaway.How it was verified
I drove the exact thing the target was getting wrong, rather than reading the diff. Injected a marker into the sibling checkout's
studio.html, then:make uidevmake ui20261015-055709The previous target would have printed
Service already up.and servedmarker=0. The checkout was restored afterwards (git statusclean), and the rebuilt image re-verified: marker gone, brand palette intact (A685EEΓ3).Also checked:
make -n uiparses, exit0.make -n docker-up|docker-build|docker-reload|docker-build-cleaneach showAGENTSHIP_BUILD=20261015-055637.make helpstill lists every target with its description β the## name:grep is unaffected.Timings, measured rather than guessed, on a no-op run:
docker compose builddocker compose up -d(recreates: new stamp β new image)/healthzanswersSo 15-30s to open Studio, against 0s before.
Anything deliberately left undone
make docker-restartstill reuses the image.make ui, even when nothing changed, because the stamp is a timestamp, so the final layer always differs. Deriving it from the sibling checkout's content (git rev + dirty state, or a tree hash) would make an unchanged run a true no-op while still rebuilding on a real change, and would make the stamp identify what is running rather than when it was built. That is a bigger change than the bug warrants, so it is noted in the Makefile comment rather than done here.pytestover the demo agents; the staleness bug lives in Make and Docker orchestration, which CI does not exercise.test-dockercomes closest β it asserts the running container serves β but it takes whatever is already up, so it would not have caught this either.originisAgent-Ship/agent-shipand the demo is thev1-demobranch, sorequirements-dev.txtpinningagentship-service==0.0.4is not what the container installs β the Dockerfile builds from the sibling checkout. Worth a comment there, since the pin reads as authoritative and is not.