Repository navigation
AWF: inherit the router healthcheck from the router image instead of running Python #10346
Description
Part of github/gh-aw-firewall#10261
(step 4 of 7). No prerequisite changes are needed. Merge this before shipping any
router image that removes Python.
Summary
AWF's compose service for the router spells out a Python healthcheck command. That ties AWF
to the router image's runtime. Once the Go image ships without Python, the
check would fail. The api-proxy waits for service_healthy, so every AWF run with model
routing turned on would then fail to start.
Remove the command, and let the container inherit the HEALTHCHECK that the image already
defines. Keep AWF's timing settings.
Background
-
buildRouterServiceinsrc/services/router-service.tssets
healthcheck.test: ROUTER_HEALTHCHECK_TEST. That's aCMDthat runspython -cwith
urllib.requestagainsthttp://localhost:8737/healthz. -
The same healthcheck sets
interval: 2s,timeout: 3s,retries: 15and
start_period: 10s. -
tests/integration/model-routing.test.tsimportsROUTER_HEALTHCHECK_TESTfor its own
compose file, andsrc/compose-generator.test.tsasserts the healthcheck. -
The supported built-in and legacy router images define a
HEALTHCHECK:- the AWF-built image from
containers/router/Dockerfile, since
PR #10037; - the legacy
ghcr.io/githubnext/gh-aw-routerimage, which the integration test uses
by default.
Both run the same Python
urllibcheck with interval 5s, timeout 2s, start period 2s
and 12 retries. After the Go image cut-over, the image'sHEALTHCHECKruns
gh-aw-router healthcheck. - the AWF-built image from
-
Docker fills in a missing command from the image.
- If the compose file sets only the timing fields, Compose sends a healthcheck with an
empty command (ToMobyHealthCheckin docker/compose). - The daemon then merges in the image's config: an empty command takes the image's
HEALTHCHECKcommand, and unset durations take the image's values (merge()in
mobydaemon/commit.go).
AWF's timings still apply.
- If the compose file sets only the timing fields, Compose sends a healthcheck with an
Scope
- In
src/services/router-service.ts:- remove
testfrom the router healthcheck, and keep the four timing fields as they
are; - remove the
ROUTER_HEALTHCHECK_TESTexport.
- remove
- In
src/types/docker.ts, make the compose service type'shealthcheck.testoptional,
and say that leaving it out uses the image'sHEALTHCHECKcommand. - Update
src/compose-generator.test.ts. It should assert that the router healthcheck has
notestfield and that the timings are unchanged. - Update
tests/integration/model-routing.test.tsso that its compose file leaves out
testtoo. - Documentation:
- State that custom router images must define a
HEALTHCHECK. Without one, Compose
reports that the router has no healthcheck and the api-proxy never starts. - Put this in the router README section about running the image, and in whichever AWF
doc describes image overrides.
- State that custom router images must define a
Out of scope
- Router image or implementation changes. Only the custom-image note in
containers/router/README.mdis in scope here; the image cut-over is separate. - Changing the healthcheck timings or the api-proxy's
depends_oncondition.
Acceptance criteria
- The generated compose file has a router healthcheck with only
interval,timeout,
retriesandstart_period. -
ROUTER_HEALTHCHECK_TESTno longer exists, and nothing in the repository references
it. - Unit tests and the model-routing integration test pass against the current Python
image.docker inspecton the running router shows the image's command with AWF's
timings. - The documentation says that custom router images must define a
HEALTHCHECK.
Validation
npm test -- compose-generatornpm run test:integration -- --runInBand model-routing.test.ts, run locally with Docker,
because thetest-model-routingworkflow runs only onmain.- On the router started by that test, run
docker inspect --format '{{json .Config.Healthcheck}}' <router container>. It should
show the image's command together with interval 2s, timeout 3s, retries 15 and start
period 10s.
Files likely touched
src/services/router-service.tssrc/types/docker.tssrc/compose-generator.test.tstests/integration/model-routing.test.tscontainers/router/README.md, and the AWF doc on image overrides if there is one
Activity
rabeckett commentedon Oct 20, 2026
Not planned: AWF keeps owning the router healthcheck command, like its other services. The cut-over to the Go image (step 5 of #10261) will change the command to the Go router's
healthchecksubcommand alongside the image swap. See #10348.