hermes-kanban-capacity
Worker capacity control, resource-pool capacity observability, and read-only token usage observability for Hermes Agent Kanban.
hermes-kanban-capacity is a single, self-contained plugin for unmodified Hermes Agent (≥ v0.23.5). It gives operators a live dashboard to monitor and tune Kanban worker concurrency, resource-pool capacity views with an honest enforcement status, and a zero-LLM-turn /kanban-usage command plus agent tool for accurate token usage reporting. It extends Hermes strictly through public plugin surfaces — no runtime patching of Core.
No external dependencies, no credentials, no telemetry, and no build step — the dashboard UI ships pre-built.

Why use it
Running multiple Kanban workers across local and cloud models raises three operational questions:
- How busy is the fleet right now, and what is waiting? See live running counts, claimable queue backlog (
ready+review), and per-profile / per-pool utilization in one tab. - Are my concurrency caps actually in effect? Keep saved config values, effective runtime values, and Gateway restart requirements strictly separate — never guess whether an edit took effect or mistake an unset cap for unlimited.
- How many tokens did Kanban workers actually use? Check confirmed token totals by profile, model, and board with zero LLM turns, without fabricating numbers when usage is unobserved.
Features
1. Capacity Dashboard (kanban-capacity tab)
Mounted at /hermes-kanban-capacity (API: /api/plugins/hermes-kanban-capacity/limits), the dashboard provides a usage-first view of your Kanban worker fleet:
- Global & per-profile utilization — Live running-worker gauges across all boards on the host, plus a Waiting backlog count (
ready+reviewcards competing for the spawn budget; non-dispatchabletodo/triagecards are excluded). - Honest saved-vs.-effective status — Core boot-loaded settings show Saved plus a Restart required marker: no public Core seam exposes the live boot state, and the dashboard never fabricates an effective value from saved YAML. When the dispatcher lock holder's boot-loaded
kanbansection is provably identical to the saved one — matched against Core's last-known-good config copies, since the file's own mtime is meaningless (Core rewrites it at boot) — the row instead reports Effective = Saved with no restart claim (fail-closed on any doubt). The Effective unavailable chip appears only where it carries information — on pool rows whose enforcement is unverified — instead of repeating the uncertainty on every restart-gated row. Whenkanban.max_in_progressis unset, the UI displays Core's memory-derived default (default_when_unset) so Unset never reads as unlimited. - Pool capacity & enforcement badge — Displays per-pool running usage split by backend (
localvs.cloud) alongside an observed enforcement badge (verified/degraded/disabled/unverified) read from live gateway boot markers. - Whitelist-guarded settings editor — Edit supported concurrency caps, dispatcher timing settings, and existing pool capacities directly from the UI. Every write is strictly validated, applied atomically via Hermes Core's canonical config writer, leaves unrelated config sections untouched, and never preempts running workers.
- Localized & responsive — Built-in English, Korean, Chinese, and Japanese (
en/ko/zh/ja) UI with a mobile-friendly single-column layout.

2. Worker-Pool Capacity Semantics (admission.py)
Stock Hermes Core does not read kanban.worker_resources, and this plugin ships no runtime Core patching (Hermes Plugin Catalog rule: no core override — issue #36). admission.py provides the shared, pure membership and usage semantics the dashboard renders with:
- Separate budgets for local hardware and cloud APIs — Assign profiles to pools using assignee glob patterns and a backend selector (
local,cloud, orany).[local]pools describe host RAM/GPU budgets;[cloud]pools describe API quota and cost budgets. - Dynamic backend classification — Classifies each profile from its active
model.base_urlandmodel.provider(re-evaluated when config changes). Providers the host declares as local-transport cloud bridges (plugins.entries.hermes-kanban-capacity.settings.bridge_providers) are classified ascloudeven when their endpoint is loopback; every other loopback/private endpoint and every unreadable profile config fails closed intolocalpools so scarce hardware is not overrun. - Cross-board usage counts — Counts running tasks across every board DB on the host with the same membership rules an admission adapter applies, so the displayed split matches what enforcement would see.
- Enforcement is delegated, observation is honest — Actually deferring claims at the pool boundary requires an optional host-side admission adapter installed outside this plugin. The dashboard reports enforcement (
verified/degraded/disabled/unverified) only from live adapter boot markers verified via/proc/<pid>/stat(starttimematching defeats PID reuse); pooleffectivevalues are published only when a live verified adapter is observed (see docs/ENFORCEMENT_MARKER.md). With no adapter, enforcement readsunverified— never "off by design", never "enforced".
3. Zero-LLM-Turn /kanban-usage Command
A direct gateway slash command that renders Kanban worker token usage straight from the handler with zero model turns:
/kanban-usage # runs since the last reset (watermark)
/kanban-usage --full # full history across all boards
/kanban-usage my-board --json # machine-readable JSON for one board
/kanban-usage --reset # move the watermark to now (explicit user action)
- Watermark filtering, never deletion — The watermark lives at
<HERMES_HOME>/plugin-data/kanban-usage/usage-baseline.json, survives plugin upgrades and removals, and filters views without modifying Kanban history. - Explicit coverage semantics — Processed tokens are grouped by profile,
provider/model, and board asread(full context consumed per model call, cache included) andwrite(generated output) — the only magnitude comparable across providers that split cache differently. Model rows add a cache-hit share, renderedunknownwhenever the provider reports no cache split or the row is a bridge estimate. Runs without attributable tokens are labeled unobserved with explicit missingness reasons (such asworker_session_id_missing,session_not_found, orduplicate_worker_session) — unknown usage is never reported as zero.
Example output from a seeded two-board home:
**📊 Kanban token usage**
all boards · full history
queried 11-29 11:00
**Processed tokens 12,466,000**
read 12,190,000 · write 276,000
runs 7 · observed 6 · unobserved 1
**⚠️ Partial aggregation: unobserved usage is not zero.**
Unobserved reason: worker session id missing 1
**👤 By profile · ranked by read tokens**
→ **kanban-main**
read 8,830,000 · write 190,000 · runs 3
→ **scout**
read 3,360,000 · write 86,000 · runs 1
4. kanban_usage_summary Tool & usage-report Skill
Exposes the same in-process, bounded read-only usage engine (local_usage.py, schema kanban-usage-read-v3) to agent sessions:
- Requires
read_only: trueand supports optionalboard,since, anduntil(YYYY-MM-DDor epoch seconds) filters without ever moving the/kanban-usagewatermark. - Enforces strict read caps (boards, runs per board, payload size) and fails visibly rather than returning silent partial totals.
- Reads usage exclusively from Hermes Core state (Kanban
task_runsjoined to profilestate.db) with no plugin-to-plugin file coupling; model rows for host-declared bridge providers (thebridge_providersplugin setting) are adapter-local estimates and render with an(estimate)marker.
Install
Requires Hermes Agent ≥ v0.23.5 (CI is tested against tag v0.23.5).
hermes plugins install rhgo1749/hermes-kanban-capacity
Answer y when prompted to enable (or run hermes plugins enable hermes-kanban-capacity), then restart the gateway so the plugin surfaces load.
Upgrade with hermes plugins update hermes-kanban-capacity and remove with hermes plugins remove hermes-kanban-capacity. See docs/INSTALL.md for pinning, rollback, and migration notes.
Configurable settings
All writes from the dashboard are restricted to this explicit whitelist:
| Setting key | What it controls | Min | When changes apply |
|---|---|---|---|
kanban.max_in_progress | Host-wide concurrent worker cap — running workers on every board on the host count against it (when unset, Core applies its memory-derived default) | 1 | Gateway restart |
kanban.max_in_progress_per_profile | Max concurrent workers for a single profile | 1 | Gateway restart |
kanban.max_spawn | Live per-board concurrency cap — workers one board may run at the same time; already-running workers count against it. Not a per-tick batch size | 1 | Gateway restart |
kanban.dispatch_interval_seconds | Seconds between dispatcher wakeups (Core default: 60) | 1 | Gateway restart |
kanban.failure_limit | Consecutive non-success attempts before a task circuit breaker trips (Core default: 2) | 1 | Gateway restart |
kanban.dispatch_stale_timeout_seconds | Seconds without heartbeat before a running task is reclaimed; 0 disables stale detection (Core default: 14400) | 0 | Gateway restart |
kanban.worker_resources.<pool>.capacity | Concurrent worker budget for an existing configured pool | 1 | Only while a live verified host-side adapter is observed; otherwise unknown |
Example pool configuration (config.yaml)
Pool names, backends, and assignee globs are defined in config.yaml; the dashboard edits capacity for existing pools:
kanban:
max_in_progress: 16
max_in_progress_per_profile: 4
worker_resources:
local-llm:
capacity: 2
backend: local
assignees:
- "worker-*"
cloud-llm:
capacity: 8
backend: cloud
assignees:
- "worker-*"
Data access & disclosure
For transparency before installing:
- Read access: Opens Kanban SQLite databases (
kanban.db,kanban/boards/*/kanban.db) and profile session databases (profiles/*/state.db) in read-only mode (mode=ro), reads Hermes/profileconfig.yamlfiles (plusbackups/config/config.yaml.good.*,gateway.pid,gateway_state.json, andplugin-data/kanban-pool-admission/instances/*.jsonmarkers), and on Linux reads/proc/<pid>/stat,/proc/locks, and/proc/uptimeto verify live enforcement markers and match the dispatcher lock holder's boot config (never/proc/<pid>/environ). - Write access:
config.yaml— only whitelistedkanban.*keys on explicit dashboard saves, through Hermes Core's canonical config writer.<HERMES_HOME>/plugin-data/kanban-usage/usage-baseline.json— only on explicit/kanban-usage --reset.
- What it never does: No runtime patching, wrapping, or rebinding of Hermes Core functions (enforcement of
kanban.worker_resourcesis delegated to an optional host-side adapter — see docs/ENFORCEMENT_MARKER.md); no outbound network calls, no telemetry or analytics, no stored credentials, no shell command execution, no background daemon processes, and no preemption or direct mutation of Kanban task state.
Documentation & layout
| Path | Description |
|---|---|
plugin.yaml, __init__.py | Plugin manifest and registration (/kanban-usage, kanban_usage_summary, usage-report) |
admission.py | Pure kanban.worker_resources membership + usage semantics (read-only; consumed by the dashboard — no Core patching) |
commands.py, local_usage.py | Zero-LLM /kanban-usage handler and bounded read-only usage engine |
dashboard/ | Capacity dashboard tab (manifest.json, plugin_api.py, pre-built dist/) |
skills/usage-report/ | Agent skill contract for read-only usage reporting |
docs/ | Install & lifecycle, usage read contract, enforcement marker contract, screenshots |
tests/ | Auto-discovered pytest suite (including pool-membership semantics and the stock-loader no-core-override probe) and jsdom React UI regression suite |
Runtime identity contracts and engineering invariants are documented in AGENTS.md.
Validation
CI runs the pytest suite against a pinned stock Hermes checkout (v0.23.5), the jsdom dashboard render suite, and a stock-loader registration probe — with no live credentials and no production side effects:
PYTHONPATH=/path/to/hermes-agent pytest -q
DASH_REQUIRE_ROOT=<core>/web/package.json node tests/test_capacity_dashboard_ui.js
README from the reviewed commit 17fa385; it updates when the author re-pins.

rhgo1749