- Operator (CLI):
comis trace export <sessionId>from a terminal on the host. - End-user / owner (slash command):
/export-trajectoryin a Telegram DM with the bot (or in a group — the bundle path is DM’d to the owner, never posted to the group).
The
comis CLI is not installed on PATH by default. Use node packages/cli/dist/cli.js trace ...
for all invocations below. If you’ve created a shell alias (e.g. alias comis='node packages/cli/dist/cli.js'),
the shorter form works too.The incident bundle is per-session — one session’s full trajectory. For a host-scoped
snapshot of the whole daemon (health checks, cross-session fleet digest, config posture) in one
paste-ready offline directory, use
comis support-bundle. Its
--session / --deep flags embed this per-session bundle — the explain digest, and with
--deep the trace bundle — inside the host bundle, so a single support-bundle --deep --session <id>
hands an engineer both the daemon-wide posture and the one session’s raw trajectory.Operator Workflow
Four steps from complaint to engineer handoff.Step 1 — Find the session
A user reports an issue. Use the trace CLI to find the messageId or sessionId. The--since and
--where flags scan the session index by time window and failure state:
Step 2 — Export the bundle
platform-aware-v1 redaction, and writes the 8-file bundle directory.
Step 3 — Inspect the bundle (optional)
Step 4 — Share with engineer
Compress and transmit via a secure channel (DM or encrypted transfer). Delete the local copy after triage:Bundle Directory Shape
Each export produces a single directory containing exactly 8 files. The directory path is:0o700 (owner-only access). Every file inside is written with
mode 0o600.
Round-trip property:
events.jsonl alone reconstructs the chronological turn timeline. The
other files provide supporting context (model config, prompt fragments, tool definitions) and are
not required for primary diagnosis.
Hard Limits
The bundle pipeline enforces four hard limits. Exceeding a limit does not crash the pipeline — it records a structured warning inmanifest.json or returns a typed error.
Bundle export never crashes on malformed data. All errors are returned via the
Result<T, E>
pattern and emitted as structured warnings in manifest.json. If a section can’t be read, the
pipeline writes partial output and records a warning rather than aborting.Redaction Policy
All bundle output passes throughplatform-aware-v1 redaction at export time. This is the policy
id pinned in manifest.json under the redaction.policy field. You can verify it was applied:
13 Value-Shape Patterns
The redactor applies 13 value-shape regex patterns to every string leaf in the bundle:Path Substitutions
Absolute paths in the bundle are replaced with placeholder tokens (longest-match wins):
The substitution is longest-first: if
$STATE_DIR is nested inside $HOME, the $STATE_DIR
token wins. This makes bundle paths portable and prevents home-directory enumeration.
Privacy Notice
/export-trajectory Slash Command
The /export-trajectory slash command gives the daemon owner a way to trigger a bundle export
from within Telegram itself, without needing terminal access.
Owner gate: Only the configured daemon owner can invoke this command. A non-owner invocation is
answered with Access denied: /export-trajectory is owner-only. in the same chat — the command name
export-trajectory is in KNOWN_COMMANDS, so the text never reaches the LLM, but the handler still
replies rather than staying silent.
In a Telegram DM
When the owner types/export-trajectory in a direct message with the bot:
- The bot exports the most recent session associated with that DM.
- The bundle path is returned inline in the DM thread.
In a Telegram group
When the owner types/export-trajectory in a group chat:
- The bot replies in the group:
"Bundle sent to owner DM." - The bot sends the bundle path to the owner’s personal DM.
- The bundle path never appears in the group thread. This is an enforced invariant — the
bundle path is routed exclusively to the owner’s DM, not to
deliverToChannel.
comis trace export CLI Reference
Arguments
Output
Human-readable (default):--json):
Exit Codes
Bundle Inspection Worked Example
A complete diagnostic walkthrough using only the bundle directory andjq:
events.jsonl alone reconstructs the chronological turn timeline. The other files are supporting
context — not required for primary diagnosis, but useful for understanding the model configuration
and exact tool definitions active during the session.
Related Pages
Trace CLI
All 5
comis trace subcommands — messageId, traceId, tail, since/where, export.Observability
Bridge mapping, lifecycle envelopes, INFO promotions, and the dedup detector.
Logging
Log levels, field dictionary, and log rotation policy.
Daemon
The process that runs all of this — startup, shutdown, and configuration.
Support Bundle
The host-scoped sibling — a paste-ready diagnostic bundle (health checks, fleet digest, config posture) that embeds this per-session bundle with
--deep --session.