Skip to content

Add Claude CLI runtime and Kanban auth preflight - #31461

Closed
stefan-wisbric wants to merge 4 commits into
NousResearch:mainfrom
stefan-wisbric:fix/claude-cli-runtime-current-preflight
Closed

Add Claude CLI runtime and Kanban auth preflight#31461
stefan-wisbric wants to merge 4 commits into
NousResearch:mainfrom
stefan-wisbric:fix/claude-cli-runtime-current-preflight

Conversation

@stefan-wisbric

@stefan-wisbric stefan-wisbric commented May 24, 2026

Copy link
Copy Markdown

Summary

  • add a Claude CLI runtime path so Hermes profiles can use Claude Code subscription auth
  • preflight Claude CLI-backed Kanban assignees before claiming ready or review tasks, including a tiny inference smoke test to catch stale subscription tokens that still pass auth status
  • leave tasks retryable and emit a spawn_preflight_failed event when Claude CLI auth is logged out or unhealthy
  • route code-review handoffs through review child tasks instead of sticky-blocking implementation tasks
  • skip force-loaded worker skills that are not installed in the target profile so review dispatch does not crash on missing sdlc-review

Why

Claude CLI auth is managed by Claude Code, separately from Hermes provider auth and Codex app-server auth. When the local Claude CLI token goes stale, Kanban workers currently claim the task and then block it with a 401 external-runtime-prose failure. Also, implementation workers were instructed to block with review-required, which can deadlock graphs where a review child waits for the implementation parent. This keeps unhealthy Claude CLI profiles unclaimed, makes review children the explicit gate, and avoids worker startup crashes from missing profile-local skills.

Verification

  • /Users/stefans/git/hermes-agent/venv/bin/python -m ruff check agent/prompt_builder.py tools/kanban_tools.py hermes_cli/kanban_db.py tests/tools/test_kanban_tools.py tests/hermes_cli/test_kanban_core_functionality.py tests/hermes_cli/test_kanban_db.py
  • /Users/stefans/git/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_kanban_core_functionality.py::test_default_spawn_skips_unavailable_per_task_skills tests/hermes_cli/test_kanban_core_functionality.py::test_default_spawn_appends_per_task_skills tests/hermes_cli/test_kanban_core_functionality.py::test_default_spawn_dedupes_kanban_worker_from_task_skills tests/hermes_cli/test_kanban_db.py::test_claude_cli_auth_preflight_parses_logged_out_json tests/hermes_cli/test_kanban_db.py::test_claude_cli_auth_preflight_smoke_catches_invalid_credentials tests/hermes_cli/test_kanban_db.py::test_claude_cli_auth_preflight_smoke_passes_when_inference_works tests/tools/test_kanban_tools.py tests/hermes_cli/test_kanban_blocked_sticky.py tests/hermes_cli/test_kanban_db.py tests/agent/transports/test_claude_cli_session.py tests/run_agent/test_claude_cli_integration.py tests/hermes_cli/test_status.py -q
  • Host check: claude auth status reports loggedIn true / claude.ai / max, while claude -p smoke currently returns 401; this PR now catches that before claiming Kanban work

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard labels May 24, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Supersedes #27787 (same Claude CLI runtime feature, with additional Kanban auth preflight). Same core file changes plus kanban_db.py additions.

Stefan Scharlott added 3 commits May 25, 2026 08:00
Add an opt-in claude_cli runtime that routes whole Hermes turns through the local Claude Code CLI without requiring Anthropic API or OAuth credentials.

Document provider: claude-cli, model.claude_runtime: cli, and HERMES_CLAUDE_CLI_* configuration, and cover runtime resolution, status output, Kanban worker MCP wiring, and the prose-only Kanban fallback with tests.
Check Claude CLI profile runtime health before claiming ready or review tasks. If the CLI is logged out or otherwise unavailable, leave the task in its current column, emit a spawn_preflight_failed event, and report the skip in DispatchResult so the dispatcher can retry automatically after auth is fixed.
Stop telling workers to sticky-block implementation tasks for code review. Review-required block attempts now return an actionable tool error that tells the worker to create or use a review child and complete the implementation handoff, avoiding dependency deadlocks where review children wait on blocked parents.
@stefan-wisbric
stefan-wisbric force-pushed the fix/claude-cli-runtime-current-preflight branch from 772b1ed to f469057 Compare May 24, 2026 20:00
Make Claude CLI profile preflight run a tiny inference smoke test so stale subscription credentials are caught before a task is claimed. Also skip force-loaded per-task skills that do not resolve in the worker profile, preventing review dispatch from crashing when sdlc-review is absent.
@stefan-wisbric

Copy link
Copy Markdown
Author

Closing for now. The Claude CLI subscription runtime is maintained on our fork (https://github.com/stefan-wisbric/hermes-agent). We've since moved the auth preflight out of Hermes core into a thin external wrapper so it survives upgrades, so this PR's in-core preflight no longer matches our setup. Glad to re-propose a current, reconciled version if upstream is interested in a logged-in-Claude-CLI runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants