A lightweight event logging system for multi-agent orchestration. Unlike box (addressed messages between agents), vent captures unaddressed system events for observability and debugging.
Box is mail: sender → recipient, with subjects and threading. Vent is a stream: "this happened" with no recipient.
Use vent for:
- System events (phase transitions, timeouts, circuit breakers)
- Agent lifecycle (started, stopped, stuck detection)
- Performance data (timing, costs, resource usage)
- Debugging breadcrumbs ("about to call API", "received 3 results")
Don't use vent for:
- Agent-to-agent communication (use
box) - Things that are already captured in
boxmessages
vent init # Create .vent store
# Emit events
vent emit orchestrator "agents launched"
vent emit opus "starting code review"
vent emit orchestrator "phase transition" --data '{"from": "review", "to": "discussion"}'
vent emit monitor "agent stuck" --level warn --data '{"agent": "gpt", "idle_seconds": 120}'
# Query events
vent tail # Watch events in real-time
vent tail --source opus # Filter by source
vent list # Recent events (last 100)
vent list --since 5m # Events from last 5 minutes
vent list --source orchestrator # Filter by source
vent list --level warn # Filter by level
# Search
vent search "stuck" # Full-text search
vent search "phase" --source orchestratorEvent:
id: string (evt_ULID)
source: string # Who/what emitted this event
message: string # Human-readable description
level: "debug" | "info" | "warn" | "error" # Default: info
data: json? # Optional structured data
created_at: ISO8601
Walk up for .vent/ directory or use VENT_STORE env var.
events.jsonl— Append-only source of truth (git-friendly).events.db— A rebuildable SQLite + FTS5 index derived from the JSONL. Delete it and the nextventinvocation will rebuild it from scratch.
On startup, SQLite is caught up from the JSONL if they've drifted (same pattern as tix and box). The JSONL is authoritative; the db is a cache.
vent is designed so many processes on the same machine can emit into the same store at the same time without corrupting the JSONL or losing events. The test suite includes a load-bearing multi-process test (8 concurrent shells × 25 emits each, then full DB rebuild from JSONL) that asserts this.
- JSONL append is atomic per record. Each
emitopensevents.jsonlwithO_APPEND | O_CREAT | O_WRONLYand performs a singlewrite()for the whole record. POSIX guarantees that on a regular file opened withO_APPEND, eachwrite()atomically seeks to end-of-file and writes, as long as the payload fits inPIPE_BUF(4096 bytes on Linux and macOS).ventcaps records at 4096 bytes; anything larger fails with exit code 7 (RecordTooLarge) rather than risk a torn write. - SQLite is serialized by WAL +
busy_timeout. Each process opens its own connection in WAL mode with a 30-second busy timeout, andemitdoes a bounded exponential backoff retry onSQLITE_BUSYfor the odd checkpoint race on a fresh store. - ULIDs are pid-seeded. The ULID generator mixes the pid into its seed so several forked writers in the same millisecond don't collide on the primary key.
- The SQLite file is not load-bearing. If you delete
events.dbafter a crash or a weird interleave, the nextStore.openrebuilds everything from the JSONL, including--datapayloads.
Do not share a .vent store across machines over a network filesystem (NFS, SMB, SSHFS, iCloud Drive, Dropbox, Google Drive, etc.). It will corrupt eventually.
O_APPENDatomicity is not guaranteed on network filesystems. Two machines appending can interleave or lose bytes.- SQLite WAL mode explicitly does not work over network filesystems — the
-wal/-shmfiles rely on shared-memory semantics that network fs don't provide. See sqlite.org/wal.html.events.dbwill corrupt.
If you need two machines to observe the same event stream, run one .vent store per machine and ship events between them out-of-band (e.g., another process that tails one JSONL and replays lines into the other). vent itself is intentionally a single-machine tool.
vent list # Human-readable (default)
vent list --json # Machine-readable JSON
vent list --jsonl # Streaming JSONLHuman-readable format:
10:01:15 [info] orchestrator: agents launched
10:02:33 [info] opus: starting code review
10:02:46 [info] orchestrator: phase transition {"from": "review", "to": "discussion"}
10:05:12 [warn] monitor: agent stuck {"agent": "gpt", "idle_seconds": 120}
vent emit orchestrator "starting review session" --data "{\"pr\": \"$PR_NUM\"}"
# ... launch agents ...
vent emit orchestrator "agents launched" --data "{\"agents\": [\"opus\", \"gpt\", \"gemini\"]}"
# Monitor loop
while true; do
if stuck_detected; then
vent emit monitor "agent stuck" --level warn --data "{\"agent\": \"$agent\"}"
fi
sleep 15
done# In agent prompt: "Use vent emit to record significant actions"
vent emit opus "found 3 potential issues"
vent emit opus "reading file" --data '{"path": "src/auth.ts"}'
vent emit opus "submitting verdict" --data '{"verdict": "MERGE"}'# What happened in the last 10 minutes?
vent list --since 10m
# What did the orchestrator do?
vent list --source orchestrator
# Any warnings or errors?
vent list --level warn
vent list --level error
# Search for specific issues
vent search "timeout"
vent search "circuit breaker"# Get timeline of events
vent list --since 30m --json > events.json
# Get messages from same period
box list --since 30m --json > messages.json
# Merge and analyze (or use the TUI viewer)VENT_STORE- Path to .vent directory (default: walk up from cwd)
Scripts can match on these stable codes:
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Generic / uncategorized error |
| 2 | Usage error (bad flags, missing args) |
| 3 | Store not found — run vent init |
| 4 | Event not found |
| 5 | Ambiguous event id prefix |
| 6 | --data is not valid JSON |
| 7 | Record exceeds the 4096-byte atomic-append cap |
| 8 | Database busy (retry) |
Box has sender/recipient semantics. Events like "timeout occurred" or "circuit breaker triggered" don't have a natural recipient. Forcing them into box's model muddies the abstraction.
You could, but:
- No persistence across sessions
- No structured data
- No querying/filtering
- No correlation with other events
vent is the agent-facing tool for emitting and querying events. The TUI viewer (separate tool) provides a human-facing dashboard that merges vent events, box messages, and tix tickets into a unified timeline.
Requires Zig 0.16 (the new std.Io APIs). Zig 0.15 will not compile.
cd ~/src/hack/vent
zig build -Doptimize=ReleaseFastBinary placed in ./zig-out/bin/vent.
Run the test suite (library tests + a multi-process concurrency test that shells out to the installed binary):
zig build testvent is part of sprawl, a collection of composable tools for multi-agent orchestration.
| Tool | Description |
|---|---|
| tix | Lightweight issue tracker |
| box | Mailbox messaging for agent-to-agent communication |
| hold | Block until a condition is met |
| mon | TUI monitor for humans |
MIT