Skip to content

feat(worker): add daemon worker health endpoint#16

Merged
Abdulmuiz44 merged 1 commit into
mainfrom
feat/native-runtime-adapter
May 27, 2026
Merged

feat(worker): add daemon worker health endpoint#16
Abdulmuiz44 merged 1 commit into
mainfrom
feat/native-runtime-adapter

Conversation

@Abdulmuiz44
Copy link
Copy Markdown
Collaborator

  • 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>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Abdulmuiz44 Abdulmuiz44 merged commit e150ae8 into main May 27, 2026
1 check passed
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