Expand description
Append-only, local invocation + HTTP request log (log.jsonl).
Every omni-dev invocation appends one kind: "invocation" line; every
outbound HTTP request made by one of the integration clients appends one
kind: "http" line correlated to it by a shared invocation_id. The log
is local-machine state written under the platform state/data directory
(0700 dir / 0600 file, the same posture as crate::daemon::paths).
Design invariants:
- Best effort.
recordswallows every error (logging only attracing::debug); a logging failure can never change the program’s exit code. HonorsOMNI_DEV_LOG_DISABLE=1for an absolute opt-out. - No secrets. Auth headers/tokens are never written; only a non-secret
auth_principalidentity is kept. Headers are redacted centrally (redact_headers) and request/response bodies are opt-in viaOMNI_DEV_LOG_BODIES=1. - Forward compatible. A single
LogRecordis used for both writing and reading: every field is#[serde(default)], and every optional field isskip_serializing_if, so a newer reader never chokes on an older line and an older reader never chokes on a newer one — the same forward-rolling contract the daemon wire types use.
Structs§
- Http
Extra - Optional, non-secret extras for an HTTP record. Bodies/headers are gated and
redacted centrally in
record_http_with, so callers may pass them freely. - Invocation
Outcome - The outcome of an invocation, recorded once after
cli.execute()returns. - LogRecord
- One line of the log. Used for both writing and reading; every field is
#[serde(default)](tolerant reads) and every optional field isskip_serializing_if(compact, forward-compatible writes). - Request
LogContext - The per-invocation context every record is stamped with.
Enums§
- Record
Kind - Which kind of record a line holds. Unknown future kinds deserialize to
RecordKind::Unknownrather than failing the read. - Source
- What drove an invocation. Unknown future sources deserialize to
Source::Unknown.
Statics§
- CTX
- Per-task context override, set around each MCP tool dispatch.
Functions§
- bodies_
enabled - Whether request/response bodies may be recorded (
OMNI_DEV_LOG_BODIES=1). - current_
context - Resolves the active context: task-local override first, then the process-global default, then a synthesized fallback.
- disabled
- Whether logging is disabled entirely (
OMNI_DEV_LOG_DISABLE=1). - headers_
enabled - Whether (redacted) headers may be recorded (
OMNI_DEV_LOG_HEADERS=1). - log_
file_ path - Resolves the log file path:
OMNI_DEV_LOG_FILEoverride, elsestate_dir(falling back todata_dir) joined withomni-dev/log.jsonl. - new_id
- A time-sortable id: 13-digit zero-padded epoch-millis, a dash, then 16 hex.
- record
- Appends one record. Best effort: every error is swallowed (logged at
tracing::debug) so logging can never affect the caller’s exit code. - record_
http - Appends one
kind: "http"record with method/url/status/elapsed/error. - record_
http_ with - Appends one
kind: "http"record with extra, non-secret fields. - record_
invocation - Appends one
kind: "invocation"record from the active context. - redact_
headers - Replaces sensitive header values with
REDACTED, passing others through. - set_
global - Installs the process-global context. The first call wins (the CLI/daemon shell sets it once, very early); later calls are ignored.