Skip to content

[app-cli] Default raw: true injection makes full LLM payload logging the out-of-box behavior — events.jsonl grows unboundedly (97% of bytes measured) #332

Description

@danshapiro

Summary

amplifier-app-cli runtime/config.py _ensure_raw_defaults() (~lines 404-405) unconditionally injects raw: true into any provider config that doesn't explicitly set it:

# Inject raw: true as the default unless explicitly set.
if "raw" not in config:
    config["raw"] = True

The docstring describes this as "a sensible default for observability." The effect: the providers' own raw: False default (e.g. provider-anthropic __init__.py:499) is effectively unreachable in a normal launch. With raw: true, every llm:request event written to events.jsonl carries the full accumulated conversation payload, so per-session log size grows quadratically with turn count.

The foundation bundle also independently ships session: raw: true (bundle.md:45) and raw: true in its provider sub-bundles (providers/anthropic-*.yaml, openai-*.yaml), so the convention is enabled from two directions.

Measured impact (one real machine, heavy but ordinary interactive use)

  • 23.8 GB of events.jsonl across 2,892 session files; individual files reach 1.1 GB
  • 13.8 GB written in a single 2-day window
  • Byte composition of one 71 MB events.jsonl: llm:request = 69 MB (97%) across just 82 lines, averaging ~840 KB with single lines up to 1.0 MB
  • The load-bearing observability events (prompt:submit/prompt:complete/session:*/tool:*) are tiny lines totaling ~3% of bytes

Why it matters

  • No retention story pairs with the default: hooks-logging is a pure append-only writer with no rotation/size-cap option (filed separately), and the context-intelligence bundle writes an unconditional second copy of the stream (filed separately).
  • Downstream consumers that tail events.jsonl — a legitimate, documented usage per the hooks-logging README, and the integration surface [app-cli] Document events.jsonl (amplifier.log schema) as a stable, versioned integration surface #315 asks to stabilize — must wade through ~1 MB lines that are 97% payload noise. This contributed to real OOM crashes in a consumer terminal-multiplexer app that tails these files for session activity tracking.

Ask

Reconsider the default (off, or opt-in), or pair the default with a retention story. At minimum, document the opt-out: an explicit raw: false in provider config is respected by the injector.

Related doc staleness

amplifier-foundation context/agents/session-storage-knowledge.md still describes the removed three-tier debug/raw_debug verbosity system — _ensure_raw_defaults() itself strips those stale flags (config.py:401-402). This misled automated investigation of the current behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions