feat(worker): add daemon worker health endpoint#16
Conversation
Abdulmuiz44
commented
May 27, 2026
- Adds GET /api/workers/health to codra-daemon.\n- Exposes safe worker capability metadata for future remote worker/controller flows.\n- Keeps endpoint unauthenticated but safe: no secrets, env vars, workspace paths, or provider keys.\n- Reports daemon id, version, host OS/arch, uptime, supported runtime kinds, workspace mode, protocol version, and capability flags.\n- Adds integration test for health response.\n- Validation passed:\n - cargo fmt -p codra-daemon\n - cargo check -p codra-daemon\n - cargo check -p codra-runtime\n - cargo test -p codra-runtime\n - cargo check -p codra-core\n - cargo test -p codra-core
Add GET /api/workers/health — an unauthenticated endpoint that lets
a Codra controller probe whether a remote daemon is alive, inspect
its identity, platform info, and declared capabilities.
The endpoint sits outside the auth middleware so remote controllers
can discover workers without a pre-shared token. The response
payload is safe for LAN exposure: no secrets, env vars, filesystem
paths, or tokens.
Response fields:
- status, daemon_id, version, hostname, os, arch, uptime_seconds
- supported_runtime_kinds, available_runtimes, workspace_mode
- remote_worker_protocol_version
- capabilities: { task_execution, event_streaming,
approval_forwarding, remote_pairing, mdns_discovery }
Real: status, daemon_id, version, hostname, os, arch, uptime_seconds,
task_execution (true — daemon already executes tasks),
event_streaming (true — SSE/polling exists)
Placeholder: approval_forwarding, remote_pairing, mdns_discovery (all false)
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 046d124abb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let app = Router::new() | ||
| .route("/health", get(health)) | ||
| .nest("/api", api_routes) | ||
| .nest("/api", worker_routes.nest("/", api_routes)) |
There was a problem hiding this comment.
Use merge instead of nesting at the root
With the locked axum 0.7.9 dependency, Router::nest explicitly panics when path == "/" (Nesting at the root is no longer supported. Use merge instead.), so constructing the daemon router will panic on every startup before binding the listener. This means neither /api/workers/health nor any existing API route can be served; combine the public and auth-gated routers with merge before nesting under /api instead.
Useful? React with 👍 / 👎.