hev kit harness
hev kit is an optional agent harness built into hev for front-of-house
work: coordinating dispatches, peers, the board and traces. It runs a lean Go
agent loop in a terminal UI, through Club Kit hosted inference,
OpenRouter directly, your OpenAI/Codex ChatGPT
subscription, or a combination of them.
Back-of-house coding still runs on claude, codex and agy through
hev dispatch. The design is in RFC 0029.
hev login # Club Kit unified hev_ key (or OPENROUTER_API_KEY / codex login)
hev kit # interactive TUI
hev kit --model openai/gpt-5 # start on a specific model
hev kit --model scope/work/openai/gpt-5 # start on a configured [[foh.key_scopes]] entry
hev kit --model codex/gpt-5.4 # start on your Codex subscription
hev kit --once "what is running on oven?" # one turn, then exit
hev kit --show-mascot # print the mascot and exit
YOLO by default
Tools run without asking first. Put isolation in the host, workspace, admission and gates, not in approval prompts. Every tool call is still bounded:
bashtimes out after 2 minutes by default. The model can ask for up to 10 minutes.hev_*calls time out after 60 seconds.- A tool result sent back to the model is capped at 32 KiB.
globandgrepstop at fixed limits on results and files walked.
Tool subprocesses strip OPENROUTER_API_KEY, HEV_API_KEY, and HEVLAYER_API_KEY.
Providers
| Provider | Badge | Model IDs | Sign-in |
|---|---|---|---|
| Club Kit hosted inference (unscoped) | [OR] $3.00/$15.00 | vendor slugs, such as google/gemini-4-neon | HEV_API_KEY, [foh].api_key_ref (hev_/hvl_), or [kit].key (hev login) |
| Club Kit scoped inference | [club-kit-scoped] $3.00/$15.00 | scope/<name>/<model>, such as scope/work/openai/gpt-5 | [[foh.key_scopes]] (exclusive scoped mode) |
Direct openrouter | [OR] $3.00/$15.00 | vendor slugs, such as google/gemini-4-neon | OPENROUTER_API_KEY or [foh].api_key_ref (sk-or-...) |
codex-sub | [codex-sub] sub | codex/NAME, such as codex/gpt-6-astra | your Codex ChatGPT login (codex login) |
You need at least one. When [[foh.key_scopes]] is not set, configured
unscoped providers (openrouter / unscoped Club Kit and codex-sub) share the
same picker. Configuring one or more [[foh.key_scopes]] entries puts hev kit
into exclusive scoped mode, where only scope/<name>/<model> targets are
registered in the router and /model picker (neither unscoped providers nor
codex-sub are registered while [[foh.key_scopes]] is present).
Unscoped credential resolution and Club Kit routing
When [[foh.key_scopes]] is not configured, hev kit resolves its API key in
this order:
OPENROUTER_API_KEY— selects direct OpenRouter mode (https://openrouter.ai/api/v1).HEV_API_KEY.[foh].api_key_ref— resolved through hev secrets, shadowing[kit].key.[kit].key— written byhev login, consulted when[foh].api_key_refis unset.
Routing and safety rules for the resolved key:
- When
HEV_API_KEY,[foh].api_key_ref, or[kit].keyresolves to ahev_(or legacyhvl_) key andOPENROUTER_API_KEYis unset,hev kitroutes/chat/completionsand/modelsto<kit_api>/v1/inference(https://required except on loopback, HTTP redirects refused, model catalog cached at~/.hev/cache/club-kit-models.json).HEV_KIT_SERVICEoverrides[kit].apionly whenHEV_API_KEYsupplied the key. hev kitnever sendshev_,hvl_, orhk_tokens toopenrouter.ai(including whenHEV_FOH_BASE_URLor[foh].base_urlis set).- Legacy
hk_keys: An explicithk_key inHEV_API_KEY,OPENROUTER_API_KEY, or[foh].api_key_reffails closed with guidance to runhev login. A stale implicit[kit].key = "hk_..."emits a secret-free warning and falls back tocodex-subwhen a Codex ChatGPT login is present (or returns thehev loginupgrade error if no provider is available).
See Club Kit keys, budgets and hosted inference for key entitlements, org budgets, and lifecycle behavior.
Codex subscription (codex-sub)
hev kit reuses the ChatGPT login the Codex CLI saved. It reads auth.json
from the first of:
[foh.codex].home;CODEX_HOME;- the active workspace’s codex profile (
HEV_WORKSPACE, see workspaces); ~/.codex.
The codex/... models show up only when that file has a usable ChatGPT
login. An auth.json that holds only an API key doesn’t count. An expired
access token is refreshed once with the stored refresh token, and the new
tokens are written back to auth.json so the Codex CLI keeps working. If the
login can’t be used, the turn ends with an error that tells you to run
codex login, and hev kit keeps running.
The default models are gpt-6-astra, gpt-5.4 and gpt-5.3-codex.
[foh.codex].models replaces the list.
Claude subscriptions are never used
Subscription providers are added only where the provider’s terms allow it.
Today the only one is OpenAI/Codex ChatGPT. hev kit never reads or uses
Anthropic/Claude OAuth subscription credentials, and it refuses:
- a Codex home inside
.claudeorCLAUDE_CONFIG_DIR; - an auth file that holds a Claude login;
codex/claude-*model names.
Claude models in hev kit go through OpenRouter (or another
OpenAI-compatible gateway) with an API key. Use your Claude subscription in
Claude Code.
Flags
| Flag | Meaning |
|---|---|
--model ID | Start on this model: an OpenRouter/Club Kit slug, scope/<name>/<model>, or codex/NAME. |
--prompt PATH | Append this file to the system prompt. |
--once MESSAGE | Run one turn without the TUI. Text goes to stdout and tool activity to stderr. |
--show-mascot | Print the mascot and exit 0. |
--no-color | Use the ASCII rendering and plain styles. |
When --model isn’t given, hev kit uses HEV_FOH_MODEL, then
[foh].model, then your first favorite whose provider is set up, then
anthropic/claude-sonnet-5.5. With no OpenRouter or Club Kit key, it starts on
the first codex/ model instead. When [[foh.key_scopes]] is configured, set
[foh].model = "scope/<name>/<model>" or pass --model scope/<name>/<model>,
because unscoped slugs (including the default anthropic/claude-sonnet-5.5) are
rejected in exclusive scoped mode.
Configuration
All settings are optional. They go in ~/.hev/config.toml, or in the file
named by HEV_CONFIG:
[foh]
model = "anthropic/claude-sonnet-5.5"
# base_url = "https://openrouter.ai/api/v1" # or HEV_FOH_BASE_URL
api_key_ref = "op://example/openrouter/credential" # or secret://openrouter (or a hev_ key ref)
system_prompt = "~/.config/hev/foh-team.md" # inline text or a path
[foh.codex]
models = ["gpt-6-astra", "gpt-5.4", "gpt-5.3-codex"] # shown as codex/NAME
# enabled = true # list codex/ models even without a login; false hides them
# home = "~/.codex" # Codex home holding auth.json (default: CODEX_HOME, workspace profile, ~/.codex)
# base_url = "https://chatgpt.com/backend-api/codex" # or HEV_FOH_CODEX_BASE_URL
HEV_FOH_BASE_URL and [foh].base_url override the endpoint for both direct
OpenRouter and unscoped Club Kit modes (defaulting to
https://openrouter.ai/api/v1 for sk-or-... keys and <kit_api>/v1/inference
for hev_/hvl_ keys). Never point HEV_FOH_BASE_URL or [foh].base_url at
openrouter.ai when using a hev_ or hvl_ credential — hev kit fails
closed to prevent sending Club Kit/Layer keys to OpenRouter.
Unscoped credentials are resolved in order from OPENROUTER_API_KEY (direct
OpenRouter mode), then HEV_API_KEY, then [foh].api_key_ref (which shadows
[kit].key and is resolved through hev secrets), and finally
[kit].key (written by hev login, consulted when api_key_ref is unset).
Keys never appear in error messages or session files, and neither do Codex
access, refresh or id tokens or the ChatGPT-Account-Id.
Scoped multi-account and workspace inference
When you work across more than one Club Kit account or organization from the
same machine, opt into named inference scopes with [[foh.key_scopes]] in
~/.hev/config.toml. You can configure 1 to 8 scopes; every scope must
have a distinct name, a distinct (account, workspace) pair, and a distinct
api_key_ref. Unknown fields inside [[foh.key_scopes]] are rejected.
[[foh.key_scopes]] is exclusive: when one or more scopes are configured,
hev kit builds a scoped-only router (club-kit-scoped) containing only
scope/<name>/<model> targets. Neither unscoped Club Kit / OpenRouter nor
codex-sub is registered in the router or /model picker while
[[foh.key_scopes]] is present, and any unscoped slug or codex/... model
(including the default anthropic/claude-sonnet-5.5 if [foh].model and
--model are both unset) fails with
"select a configured account and workspace via scope/<name>/<model>".
[[foh.key_scopes]]
name = "work" # ^[a-z][a-z0-9-]{0,31}$
account = "user_01example" # matches GET /v1/whoami author.id
workspace = "org_01example" # matches GET /v1/whoami team.id
api_key_ref = "op://Work/club-kit-hev/credential" # resolved per request via hev secrets
Selecting a scope
- In
~/.hev/config.toml, set[foh].model = "scope/<name>/<model>"(for examplemodel = "scope/work/openai/gpt-5") sohev kitstarts on a valid scoped target. - On the CLI, pass
--model scope/<name>/<model>(for example--model scope/work/openai/gpt-5). - In the TUI, run
/model scope/<name>/<model>or pick<model> (<name>)in the/modelpicker.
Scoped selection deliberately ignores process-level HEV_API_KEY and
OPENROUTER_API_KEY as well as generic HEV_FOH_BASE_URL and [foh].base_url
overrides. On every request, hev kit resolves api_key_ref fresh through
hev secrets — so rotating the hev_ key stored behind
api_key_ref takes effect live without restarting hev kit — and verifies
GET /v1/whoami (author.id == account && team.id == workspace) before
calling /v1/inference.
Pacing, deadlines, cancellation and fail-closed isolation
- Per-resolution wait (
135s): Scoped credential resolution waits up to 135 seconds (scopeResolveTimeout) in FIFO order for an available slot in the existing 5-read rolling-minutehev secretscaller allowance. This accommodates shared-caller contention where an active turn has already charged reads and the last of eight cold callers requires a third rolling-minute window. - Interactive
/modelpicker deadline (165s): The interactive picker grants up to 165 seconds overall for scoped entries to cover up to135scredential resolution +10s/v1/whoamiscope verification +20s/v1/inference/modelscatalog fetch. - Cancellation and timeout: Parent context cancellation (
Ctrl+C) stops the wait immediately ("Club Kit credential resolution canceled"). Deadline exhaustion reports an explicit scoped credential timeout ("timed out resolving a Club Kit credential for the selected scope") rather than misclassifying the failure as an invalid key. - Fail-closed isolation (zero fallback): Hourly or daily
hev secretscaller budget exhaustion, aGET /v1/whoamiauthor.id/team.idmismatch, key revocation (401), org budget exhaustion (402), or org suspension (403) fail closed immediately for that scope.hev kitnever falls back to unscoped[kit].key,HEV_API_KEY,OPENROUTER_API_KEY, or another configured scope, while leaving sibling scopes’ catalogs and turns usable. - Reference cold-start envelope: Under default secrets policy, uncontended
workloads (8 cold CLI calls sharing one parent, an 8-scope catalog fetch, or
an 8-step turn) complete in ~60 seconds across two rolling windows, while a
contended 3+8 shared-caller workload completes within three rolling windows
under the
135sbound.
Clean rollback from scoped mode
Because [[foh.key_scopes]] is exclusive, unscoped slugs and codex/...
models are rejected while any scope remains configured. To return to unscoped
[kit].key / HEV_API_KEY, direct OPENROUTER_API_KEY, or codex-sub,
remove (or comment out) [[foh.key_scopes]] in ~/.hev/config.toml (and clear
any scope/... value in [foh].model) and restart hev kit. Rolling back a
client never revokes sibling keys or mutates org OpenRouter budgets.
Model picker
To open the picker, press Ctrl+M or type /model. Most terminals send the
same byte for Ctrl+M and Enter, so Enter on an empty prompt also opens it.
- Type to fuzzy-search IDs, names and providers across every active provider (or
<model> (<name>)entries when[[foh.key_scopes]]is configured). - Use the arrow keys or
Ctrl+N/Ctrl+Pto move. - Press Enter to switch.
- Press
Ctrl+Fto star or unstar a model. You can also press Tab to focus the list and thenf. - Esc closes the picker.
Each row shows the ID, the context window (such as 200k) and a
provider/cost badge: [codex-sub] sub for a subscription model,
[OR] $3.00/$15.00 for unscoped OpenRouter or Club Kit models, or
[club-kit-scoped] $3.00/$15.00 for scoped [[foh.key_scopes]] entries
(showing prompt/completion price per million tokens). Subscription models list
first. Starred models from either provider sort above the rest and are saved to
~/.hev/foh-favorites.json.
A switch takes effect on the next request and keeps the conversation, even
across providers. For example, turn 1 can run on codex/gpt-6-astra and
turn 2 on google/gemini-4-neon, with the same history and tool results. The
transcript shows a badge such as ⇄ model a → b, and it adds
(codex-sub → openrouter) when the provider changes. /model ID (including
/model scope/<name>/<model>) switches without opening the picker.
The direct OpenRouter catalog is cached at ~/.hev/cache/openrouter-models.json
and the Club Kit catalog at ~/.hev/cache/club-kit-models.json for 24 hours.
Scoped picker entries get up to 165s overall to resolve credentials, verify
/v1/whoami, and fetch /v1/inference/models. When an upstream catalog cannot
be reached, unscoped mode uses the stale cache, or a small built-in list if
there is no cache.
System prompt
The prompt is assembled from these parts, in order:
- kit’s built-in FOH instructions;
AGENTS.mdandMISSION.mdin the current directory;~/.config/hev/foh-prompt.md;[foh].system_prompt;- the
--promptfile; - a live header: host, cwd, workspace, model and kit version.
/prompt shows which parts were used and the full text. /reload rebuilds
the prompt after you edit any of those files, without leaving the thread.
Tools
| Tool | Actions |
|---|---|
hev_dispatch | ls, show NAME, hosts, send (a full order, or name, repo and body plus optional host, base, harness, model) |
hev_peers | ls, read TARGET, send TARGET MESSAGE |
hev_board | search QUERY, read ID, post (board, title, body) |
hev_traces | search QUERY, stats |
hev_status | workspace and cluster overview (hev --json) |
read_file, glob, grep, bash, edit_file | local work in the current directory |
The hev_* tools appear in the transcript as bordered cards with the tool,
action, a one-line summary and up to six lines of the result. Ctrl+O
expands every card. Generic tools appear as one dim line with a short preview
of the output.
Steering
While a turn is running, anything you type and send is a steer. It arrives
after the current tool call finishes. Tool calls the model had queued behind
it are skipped, and the model sees your message before it continues.
Ctrl+C cancels the turn, and Ctrl+C again when idle quits.
Slash commands
/model [SLUG], /prompt, /reload, /clear (start a new thread), /help,
/quit.
Session traces
Each session writes redacted JSONL to ~/.hev/foh/sessions/<ulid>.jsonl.
HEV_FOH_SESSIONS_DIR changes the directory. A record holds the turn number,
its type (user, assistant, tool, steer, model_switch, error), the
provider and exact model that served it, any tool calls and the token
usage. A model_switch also records from and from_provider. API keys
(including hev_, hvl_, hk_, and sk-or- credentials; see
archive redaction), OAuth tokens, bearer headers and
the ChatGPT account ID are removed before a record is written. kit keeps the
newest 500 sessions and caps each file at 64 MiB. Phase 1 doesn’t add these
sessions to the trace archive.
Mascot
The splash header shows the mascot next to the version, working directory,
workspace, active model and shortcuts. The color version uses half-blocks
with 24-bit color, and transparent pixels never paint a background. Terminals
narrower than 90 columns get a 20×10 version. With NO_COLOR, TERM=dumb or
--no-color, an ASCII version with no escape sequences is shown instead.