Files
openclaw/src
Andrii 5392fa0dfa cache trace mvp
Added a standalone cache tracing module and wired it into the embedded
runner so you can capture message flow and the exact context sent to
  Anthropic in a separate JSONL file.

  What changed

  - New tracing module: src/agents/cache-trace.ts (self‑contained,
env‑gated, writes JSONL, computes per‑message digests).
  - Hook points in src/agents/pi-embedded-runner/run/attempt.ts: logs
stage snapshots (loaded/sanitized/limited/prompt/stream/after) and wraps
the
    stream fn to record the real context.messages at send time.

  How to enable

  - CLAWDBOT_CACHE_TRACE=1 enables tracing.
  - CLAWDBOT_CACHE_TRACE_FILE=~/.clawdbot/logs/cache-trace.jsonl
overrides output (default is
$CLAWDBOT_STATE_DIR/logs/cache-trace.jsonl).
  - Optional filters:
      - CLAWDBOT_CACHE_TRACE_MESSAGES=0 to omit full messages (still
logs digests).
      - CLAWDBOT_CACHE_TRACE_PROMPT=0 to omit prompt text.
      - CLAWDBOT_CACHE_TRACE_SYSTEM=0 to omit system prompt.

  What you’ll see

  - One JSON object per line with stage, messagesDigest, per‑message
messageFingerprints, and the actual messages if enabled.
  - The most important line is stage: "stream:context" — that is the
exact payload pi‑mono is sending. If this diverges from earlier stages,
you’ve
    found the mutation point.
2026-01-21 10:23:30 +00:00
..
2026-01-18 08:54:00 +00:00
2026-01-21 10:23:30 +00:00
2026-01-21 01:33:31 +00:00
2026-01-21 01:14:24 +00:00
2026-01-21 01:58:47 +00:00
2026-01-21 05:34:53 +00:00
2026-01-21 03:47:50 +00:00
2026-01-18 08:45:29 +00:00
2026-01-18 19:34:21 +00:00
2026-01-20 13:52:59 +00:00
2026-01-21 00:19:53 +00:00
2026-01-19 23:41:06 +00:00
2026-01-21 01:58:47 +00:00
2026-01-18 19:34:21 +00:00
2026-01-18 03:55:14 +00:00
2026-01-18 16:11:43 +00:00