Skip to content

Add Docker Runtime observations and public read API - #15

Closed
sam2tom wants to merge 8 commits into
mainfrom
codex/runtime-observability-docker
Closed

sam2tom wants to merge 8 commits into
mainfrom
codex/runtime-observability-docker

Conversation

@sam2tom

@sam2tom sam2tom commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • add provider-neutral Runtime observation identity, resolver, source, validation, and status semantics
  • add read-only Docker Inspect plus one-shot Stats collection for CPU, memory, allocation age, and compute uptime
  • add tenant-scoped current Runtime observation list and Session retrieval endpoints
  • expose strict packages/agents-client discriminated types, projection, pagination validation, and generated OpenAPI
  • add a Core Web Runtime monitoring dashboard with exact Session/observation joins, resource coverage, reported token usage, identity details, and honest unavailable/unsupported states
  • add bounded 30-second refresh with jitter, hidden-page pause, visible-page resync, a 15-second read budget, and stale-complete-snapshot retention
  • document Dashboard composition, token-usage joins, future providers, history boundaries, and idle-policy separation

Issue

Implements #19.

Boundaries

  • no database migration or PostgreSQL time-series table
  • no token duplication, lifecycle action, history endpoint, or synthetic CPU percentage
  • no Kubernetes, E2B, or self-hosted telemetry source in this phase
  • provider-native identifiers, raw errors, credentials, paths, and labels do not cross the public boundary
  • Web consumes only the public contract through packages/agents-client

Verification

  • dedicated PostgreSQL-backed Go and Agents API checks passed locally
  • agents-client: 248 tests
  • Core Web: typecheck, 59 test files / 578 tests, production build
  • Playwright acceptance: 73 passed
  • Core doctor, Claude SDK adapter/runtime, SQLC, Go Core, and MiniMax harness checks passed
  • independent blind review found two P2 issues; both were fixed and the second review returned no findings

The final macOS-only executor step in make check remains blocked by the pre-existing Linux-specific OFlags::PATH and st_dev type baseline in packages/codex-executor; this change does not modify that package. Linux CI remains authoritative for that target.

The pre-update Agents API CI failure was the existing official-client Agent reference assertion (Expected BadRequestError); Core-check passed on the prior head. Fresh checks run on this commit.

@sam2tom sam2tom changed the title Add Docker runtime observability foundation Add Docker Runtime observations and public read API Sep 22, 2026
@sam2tom

sam2tom commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

Remote Ubuntu validation completed against commit 45ff7f7caa4453ee9cae0650f133a558bb6cf014 using an isolated Agents API (18091) and dedicated PostgreSQL (15432). The existing service on 8091 was not modified.

Validated through the public HTTP contract:

  • GET /healthz passed.
  • An environment:none Session returned status=unsupported, reason=runtime_mode_not_observable, and explicit null CPU/memory.
  • An idle openai_hosted Session provisioned a real Docker Runtime and returned status=observed, provider_type=docker, non-null Environment/allocation identity, CPU usage/capacity, memory usage/limit, and valid allocation/start/observation/resolution timestamp ordering.
  • GET /v1/agents/runtime-observations returned both Session contexts with their independent statuses.
  • Deleting the hosted Session reclaimed its provider-owned container and both volumes; provider-scoped readback found zero retained test containers or volumes.

The isolated API and database remain running for follow-up inspection. Current CI has core-check passing. The agents-api / sessions failure remains the already documented official-client Expected BadRequestError assertion and is not introduced by this runtime-observation change.

@sam2tom

sam2tom commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #30, which preserves this PR’s Docker/API/Dashboard work and adds the microsandbox observation source in the single combined iteration requested.

@sam2tom sam2tom closed this Sep 22, 2026
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