Skip to content

feat: local runner health probe - #93

Merged
5uck1ess merged 12 commits into
mainfrom
feat/local-runner-health-probe
Apr 17, 2026
Merged

feat: local runner health probe#93
5uck1ess merged 12 commits into
mainfrom
feat/local-runner-health-probe

Conversation

@5uck1ess

Copy link
Copy Markdown
Owner

Summary

Adds devkit-engine probe-local subcommand that verifies any OpenAI-compatible local inference endpoint (llama-server, llama-swap, Ollama, vLLM, SGLang, LM Studio, LocalAI). Reports reachability, latency, and whether the configured DEVKIT_LOCAL_MODEL is present in the server's /v1/models response. Exit 0 on healthy, 1 otherwise. --json flag emits structured output.

Hooked into /devkit:health so the probe runs automatically when DEVKIT_LOCAL_ENABLED=1. README now documents the full DEVKIT_LOCAL_* env-var surface with default ports for 7 inference stacks and copy-paste examples.

Zero behavior change for existing cloud-tier workflows.

Changes

  • New src/cmd/probe_local.go + probe_local_test.go (~450 lines): ProbeConfig / ProbeResult types, pure runProbe(ctx, cfg) function, formatHuman / formatJSON formatters, Cobra command with --json flag and PersistentPreRunE override (probe doesn't need git repo / DB).
  • Exported runners.LocalEnabled/Endpoint/Model/APIKey/Timeout helpers (previously package-private) for reuse.
  • skills/health/SKILL.md gains a "Local Runner" block.
  • README adds "Local models (optional)" section.
  • ROADMAP.md + CLAUDE.md updated by doc-check step.

Test plan

  • make test — 369/369 pass across 6 packages
  • make checkgo vet clean, gofmt -l empty
  • Smoke-test: DEVKIT_LOCAL_ENABLED unset → "disabled" message, exit 0
  • Smoke-test: reachable endpoint with matching model → "reachable: yes", "model match: OK", exit 0
  • Smoke-test: --json flag → valid JSON with correct fields, exit 0
  • Unit tests cover: disabled, happy path, model missing, 401 unauthorized, 404 not-found, timeout, bad JSON

Limits (documented in README)

  • Fast tier only — local models have higher tool-call error rates; cloud tiers still handle tri-review / architecture / security.
  • No function-calling through this runner (plain /v1/chat/completions).
  • No streaming.

- return sentinel error instead of os.Exit(1) in Cobra RunE so the
  MCP server isn't killed if probe-local is ever invoked as a tool;
  SilenceUsage/SilenceErrors suppress Cobra's default post-error output
- swap http.DefaultClient for a scoped &http.Client{Timeout} to match
  runners/local.go and close the post-connect hang gap that
  context.WithTimeout alone doesn't cover
- add TestRunProbe_ServerError for the previously-uncovered 5xx
  default-hint branch
@5uck1ess
5uck1ess force-pushed the feat/local-runner-health-probe branch from b9c71b2 to cf1791a Compare April 17, 2026 20:59
@5uck1ess
5uck1ess merged commit f1fd921 into main Apr 17, 2026
6 checks passed
@5uck1ess
5uck1ess deleted the feat/local-runner-health-probe branch April 17, 2026 21:02
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