microsoft / microsoft/amplifier
[app-cli] Default `raw: true` injection makes full LLM payload logging the out-of-box behavior — events.jsonl grows unboundedly (97% of bytes measured)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 261
- Avg merge
- 3h 28m
- Merged PRs (30d)
- 13
Description
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 #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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with amplifier-app-cli/runtime/config.py::_ensure_raw_defaults() and compare its behavior with the provider defaults and the foundation bundle's raw settings. Read the hooks-logging README and the referenced session-storage knowledge file to understand supported event consumers and stale guidance. Done means the default or retention approach is decided, implemented consistently across the noted configuration paths, and the opt-out or resulting behavior is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, observability
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100