Skip to main content
When a user reports a problem, the incident bundle is the artifact you hand to an engineer. It’s a self-contained directory with the full session history, redacted at export time, ready to share over a secure channel. There are two ways to export a bundle:
  1. Operator (CLI): comis trace export <sessionId> from a terminal on the host.
  2. End-user / owner (slash command): /export-trajectory in 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:
This returns all sessions with errors in the last 10 minutes. If the user can give you their messageId (shown in delivery confirmations), a direct lookup is faster:
See Trace CLI for the full subcommand reference.

Step 2 — Export the bundle

The pipeline reads the session file, reconstructs the branch, merges and sorts events, applies 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:
The directory is created with mode 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 in manifest.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 through platform-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:
Long-decimal-ID redaction (\b\d{9,}\b) is intentionally aggressive — it catches Telegram chat IDs but also legitimate counters and timestamps. This is the design tradeoff: more aggressive at the export boundary, lighter at runtime. Do not rely on counters or sequence numbers surviving redaction in exported bundles.

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

Privacy noticeBundle contents reflect the raw session and runtime trajectory at export time. Redaction applies platform-aware patterns (Telegram chat IDs, JWTs, AWS keys, URL userinfo, basic-auth, cookie headers, emails), substitutes paths, and omits identified PII fields — but redaction is heuristic. Always treat exported bundles as containing sensitive content; share only with authorized engineers, prefer DM/secure channels, and delete after triage.

/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:
  1. The bot exports the most recent session associated with that DM.
  2. The bundle path is returned inline in the DM thread.

In a Telegram group

When the owner types /export-trajectory in a group chat:
  1. The bot replies in the group: "Bundle sent to owner DM."
  2. The bot sends the bundle path to the owner’s personal DM.
  3. 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.
Owner gate is enforced at the slash-command handler. A non-owner invocation is rejected with an Access denied: /export-trajectory is owner-only. reply in the same chat — the command name export-trajectory is in KNOWN_COMMANDS so the text never reaches the LLM, but the handler answers the denial rather than staying silent.

comis trace export CLI Reference

Arguments

Output

Human-readable (default):
JSON mode (--json):
JSON mode is useful for scripting:

Exit Codes


Bundle Inspection Worked Example

A complete diagnostic walkthrough using only the bundle directory and jq:
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.

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.