Skip to content

fix: adopt estate health envelope kit, fix blank BUILD_TIME - #83

Merged
vreshch merged 1 commit into
masterfrom
feature/health-kit
Aug 9, 2026
Merged

fix: adopt estate health envelope kit, fix blank BUILD_TIME#83
vreshch merged 1 commit into
masterfrom
feature/health-kit

Conversation

@vreshch

@vreshch vreshch commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

Adopts @agentage/observability@0.8.0 (subpath /health) for landing's /health
route per ~/vaults/agentage/specs/health-endpoints.md (P2e). Fixes three live
defects visible in prod's current response:

  • buildTime: ""null. process.env.BUILD_TIME ?? null passed the empty
    string through; the kit's || null does not.
  • commit was the full 40-char sha → now the 7-char short form (H12); the
    full sha now lives in version.
  • version / startedAt / uptimeSeconds were missing entirely → now present.

service stays agentage-landing via the kit's OTEL_SERVICE_NAME default
(already set to agentage-landing in docker-compose.yml for tracing) - no
rename needed in the route itself, no service argument passed.

Root cause of the blank BUILD_TIME

deploy.yml's image build only ever passed COMMIT_SHA as a build-arg. The
Dockerfile's ARG BUILD_TIME="" default was therefore baked into every image,
which is why prod has shipped buildTime: "" since day one. Fixed by generating
a UTC timestamp in a vars step and passing it as BUILD_TIME, matching the
pattern already used in auth/dashboard/admin/api-gateway/web.

Changes

  • packages/landing/package.json - bump @agentage/observability ^0.6.1 -> ^0.8.0
    (already a dependency, used for OTEL bootstrap via the /next subpath)
  • packages/landing/src/app/health/route.ts - replace the hand-rolled response
    with healthResponse() from @agentage/observability/health
  • packages/landing/src/app/health/route.test.ts - new unit test asserting the
    v1 envelope shape (7-char commit, null buildTime on a blank env var, service
    name, version/startedAt/uptimeSeconds)
  • .github/workflows/deploy.yml - generate + pass BUILD_TIME as a build-arg

No dependency checks added, per the spec's Next.js profile (SSR shell, no
downstream probes). Dockerfile HEALTHCHECK unchanged, verified still passes.

Test plan

  • npm run verify green (type-check, lint, format, unit tests, real next build)
    - /health shows as ƒ (Dynamic) in the build output, confirming no prerender
  • docker build --target runner --build-arg COMMIT_SHA=testsha1234567890 (blank
    BUILD_TIME) -> ran container -> curl /health -> buildTime: null,
    commit: "testsha", version: "testsha1234567890"
  • Re-ran with OTEL_SERVICE_NAME=agentage-landing (matches prod compose) ->
    service: "agentage-landing"
  • Re-built with BUILD_TIME set -> got a real ISO 8601 UTC timestamp, confirming
    the deploy.yml fix produces the right value
  • Dockerfile HEALTHCHECK (wget -q --spider http://localhost:3000/health)
    still reports healthy

Not deployed - draft only, per repo convention (deploy.yml ships both dev+prod on
push to master).

Replace the hand-rolled 4-field /health response with
@agentage/observability/health: adds version/startedAt/uptimeSeconds,
shortens commit to 7 chars (full sha moves to version), and fixes
buildTime "" -> null. service now resolves from OTEL_SERVICE_NAME
(already agentage-landing in docker-compose.yml).

Root cause of the "" buildTime in prod: deploy.yml only ever passed
COMMIT_SHA as a build-arg, so the Dockerfile's ARG BUILD_TIME=""
default was baked into every image. Deploy now generates and passes
BUILD_TIME too.
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

CI - Verify PASSED

Commit: 8c33e03871093a5c36cec9de90f7445a16aef3ce · Branch: feature/health-kit

  • ✅ Type check
  • ✅ Lint
  • ✅ Format check
  • ✅ Unit tests
  • ✅ Build
  • ✅ Landing e2e

🔗 View workflow run

@vreshch
vreshch marked this pull request as ready for review August 9, 2026 14:35
@vreshch
vreshch merged commit 84ec182 into master Aug 9, 2026
1 check passed
@vreshch
vreshch deleted the feature/health-kit branch August 9, 2026 20:49
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