Runtime configuration
Kheish exposes live runtime controls through the daemon CLI and HTTP API.What can change live
Without restarting the daemon, you can change:- the daemon default route
- the learning automation policy
- the permission mode
- the recovered run-memory policy
- tool runtime limits
- the system prompt settings
- the daemon-wide hook configuration
- the debug capture level
Common commands
runtime set-model accepts either a bare model name or a route-aware selector in the form <route_id>/<model>. The CLI normalizes that selector before calling the HTTP API.
runtime get includes config.revision, config.updated_at_ms, config.persisted, config.history_len, config.history_limit, and the state-root path of runtime-config.json.
Durable revisions and rollback
Runtime mutations for the daemon default route/model, permission mode, learning automation policy, recovered run-memory policy, tool runtime limits, system prompt, hooks, and debug level are serialized through one durable runtime-config transaction. Successful mutations append a new revision toruntime-config.json; daemon restart restores the last revision before accepting work.
Mutation requests can include expected_revision. When supplied, the daemon rejects stale writers with 409 and runtime/runtime_revision_conflict.
Runtime mutations also gate route pinning and runtime reads while the commit phase applies and persists the new revision. A run either pins the previous durable route or the next durable route; it should not observe a partially applied runtime mutation.
Rollback creates a new revision from an older snapshot:
rollback revision that records the restored target revision.
The daemon retains at most config.history_limit historical revisions plus the current revision. Older historical revisions are pruned, so only revisions still returned by runtime revisions can be rollback targets.
Runtime summary surfaces redact hook executor bodies, including historical hook snapshots in runtime revisions. Use runtime hooks get for the current raw hook settings when you need to audit or edit hook commands.
Tool runtime limits
Tool limits bound the wrapper around every tool call:- JSON input bytes per call
- JSON output bytes per call
- full result-envelope bytes per call, including
context_updatesand hook contexts - timeout per call
- parallel calls per batch
- calls per tool-use turn
- cumulative output and full-envelope bytes per tool-use turn
- maximum sandbox profile allowed by the runtime
Learning automation policy
The daemon-owned learning worker is configured through runtime policy:./target/debug/kheish-daemon runtime learning-policy get./target/debug/kheish-daemon runtime learning-policy set --file learning-policy.json
- whether the daemon captures
run_summarycandidates automatically - whether the daemon captures semantic
fact/preference/decisioncandidates from completed runs - whether candidates stay manual, run in
shadow, or can publish automatically - which candidates match
manual_review,reject,publish_provisional, orpublish_active - whether API-origin candidates may auto-publish with the active tier
- which named rules are temporarily quarantined
- whether the model-backed judge is enabled, and which optional route override it uses
- the daemon replaces the full learning policy on
set - send
modeexplicitly when mutating policy - use
--expected-revisionwhen automating policy changes publish_activeis still gated by daemon-owned verification- automatically published learnings are only prompt-visible after verification
- the judge is bounded by the deterministic policy envelope; it does not write directly to the learning store
Operational semantics
These settings are daemon-wide. They affect future execution on that daemon, but they do not retroactively change the pinned route, model, debug capture level, or tool-limit snapshot of an already active tool batch. On a mixed-provider daemon,runtime set-model should be read as changing the daemon fallback route rather than forcing every session onto one provider immediately.
Recommended practice
After any runtime mutation, verify the current state withruntime get. Treat live reconfiguration as an operational change with production impact, especially when permissions, hooks, or debug capture are involved.