Skip to content

fix(demo): make ui rebuilds, and every build target stamps the image - #83

Merged
harshuljain13 merged 1 commit into
v1-demofrom
fix/ui-serves-stale-build
Oct 18, 2026
Merged

harshuljain13 merged 1 commit into
v1-demofrom
fix/ui-serves-stale-build

Conversation

@harshuljain13

Copy link
Copy Markdown
Collaborator

Base is v1-demo, not main. The demo lives on that long-lived branch; main is the framework and has a different tree entirely.

What changed, and why

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:

ui:
	@if curl -fsS --max-time 2 http://localhost:7005/healthz >/dev/null 2>&1; then \
		echo "Service already up."; \

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.4 was even cut. The container reported agentship-service: 0.0.3 and the old Studio branding, while the checkout beside it was on 0.0.4 with 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 ../agentship checkout (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. ui now always builds.

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 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.

ui also now prints the build it ended up serving, so the answer is on screen rather than one curl away.

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:

build stamp marker served
before make ui dev 0 β€” not served
after make ui 20261015-055709 1 β€” served

The previous target would have printed Service already up. and served marker=0. The checkout was restored afterwards (git status clean), and the rebuilt image re-verified: marker gone, brand palette intact (A685EE Γ—3).

Also checked:

  • make -n ui parses, exit 0.
  • All four build targets emit the stamp: make -n docker-up|docker-build|docker-reload|docker-build-clean each show AGENTSHIP_BUILD=20261015-055637.
  • make help still lists every target with its description β€” the ## name: grep is unaffected.

Timings, measured rather than guessed, on a no-op run:

step cost
cached docker compose build ~1s
docker compose up -d (recreates: new stamp β†’ new image) ~4s
service boot until /healthz answers ~11s

So 15-30s to open Studio, against 0s before.

Anything deliberately left undone

  • That 15-30s is a real regression in speed, and it is deliberate. The old path cost nothing and was wrong. If it becomes annoying while iterating on agents rather than the framework, make docker-restart still reuses the image.
  • The container is recreated on every 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.
  • No test covers this. The suite is pytest over the demo agents; the staleness bug lives in Make and Docker orchestration, which CI does not exercise. test-docker comes closest β€” it asserts the running container serves β€” but it takes whatever is already up, so it would not have caught this either.
  • Unrelated, found while confirming where this repo pushes: this checkout's origin is Agent-Ship/agent-ship and the demo is the v1-demo branch, so requirements-dev.txt pinning agentship-service==0.0.4 is 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.

`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.
@harshuljain13
harshuljain13 requested a review from Parv17k October 18, 2026 11:52
@harshuljain13 harshuljain13 self-assigned this Oct 18, 2026
@harshuljain13 harshuljain13 added the area:demo The demo repository label Oct 18, 2026
@harshuljain13 harshuljain13 added this to the 0.1.0 milestone Oct 18, 2026
@harshuljain13
harshuljain13 merged commit aa30add into v1-demo Oct 18, 2026
1 check passed
@harshuljain13
harshuljain13 deleted the fix/ui-serves-stale-build branch October 18, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:demo The demo repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant