Motivation
memory_load events tell us which channels the agent saw and their hashes, but not the exact bytes the model received on each turn. For debugging surprising behavior — especially the kind that ships in the Altered Craft article — being able to read back the literal prompt + tool schemas + interleaved tool results is invaluable.
Proposal
Behind an env flag (e.g. TILTH_PROMPT_DUMP=1), write the rendered request to sessions/<id>/prompts/<task_id>-iter<N>.md (or .json) before each client.chat() call. Include the system prompt, the user prompt, tool schemas, and the conversation history at the moment of the call.
events.jsonl would carry a path reference in the model_call payload (e.g. prompt_dump: "prompts/T-001-iter3.md") so consumers can navigate from the event to the exact request.
Trade-offs
- Cost: a few KB to ~20KB per iteration. A 20-iteration task ≈ 400KB; a multi-task session could push into the MB range. Mitigations: gzip on write, or only enable on demand via the env flag (default off).
- Privacy: prompts can include workspace contents (file reads, diffs). Gating behind a flag keeps this opt-in.
- Bloat to events.jsonl: none — the event only stores a path, not the prompt itself.
Default behavior
Off. This is a debugger feature; reach for it when chasing a specific question. Production runs should not pay the disk cost by default.
Acceptance criteria
Context
Spun out of an observability pass that added memory_load and hook_run events plus OTel-shaped trace/span IDs. See conversation around the addition of `tilth/summary.json` aggregation for related work.
Motivation
memory_loadevents tell us which channels the agent saw and their hashes, but not the exact bytes the model received on each turn. For debugging surprising behavior — especially the kind that ships in the Altered Craft article — being able to read back the literal prompt + tool schemas + interleaved tool results is invaluable.Proposal
Behind an env flag (e.g.
TILTH_PROMPT_DUMP=1), write the rendered request tosessions/<id>/prompts/<task_id>-iter<N>.md(or.json) before eachclient.chat()call. Include the system prompt, the user prompt, tool schemas, and the conversation history at the moment of the call.events.jsonlwould carry a path reference in themodel_callpayload (e.g.prompt_dump: "prompts/T-001-iter3.md") so consumers can navigate from the event to the exact request.Trade-offs
Default behavior
Off. This is a debugger feature; reach for it when chasing a specific question. Production runs should not pay the disk cost by default.
Acceptance criteria
TILTH_PROMPT_DUMP=1enables prompt dumps; default is offsessions/<id>/prompts/with one file perclient.chat()callmodel_callevent payload references the dump path when writtenContext
Spun out of an observability pass that added
memory_loadandhook_runevents plus OTel-shaped trace/span IDs. See conversation around the addition of `tilth/summary.json` aggregation for related work.