wpeng77/dsh-llm-trace

Captures the raw HTTP request and response bodies behind each model call and shows the wire payload in a per-session LLM Trace tab.

Fills the gap the durable session log cannot: the session log shows the provider-neutral request the loop assembled, while this shows the exact JSON POSTed and the exact bytes returned. Each session gets an LLM Trace tab beside Chat, and it is session-scoped — the host attributes each captured fetch to the call that caused it, so another session's or a subagent's traffic never appears in this tab. The view is built to stay usable on multi-megabyte bodies: a single bottom-up pass gives every node its compact serialized size so the root figure equals the body exactly, only expanded nodes render, and a container past 500 children emits a more row instead of materializing the rest. Capture is bounded, not sampled — a prefix is kept, the exchange is marked truncated at the configured limit, and the branch is cancelled so a tee buffer cannot grow without bound. Sizes are measured rather than estimated, and a body that fails to parse falls back to raw with a note rather than rendering as broken JSON.

Development & Runtime ★ 0
View on GitHub ↗

Install

dsh plugin --profile web add dsh-llm-trace

The README's Install block; a GitHub form (dsh plugin --profile web add github:wpeng77/dsh-llm-trace) is documented beside it. There is no build step — plain ESM, no bundler output, no install-time script — so nothing has to be approved at install. Then start the Web UI with dsh web.

Compatibility

It works by wrapping globalThis.fetch, which is the only seam that can see the wire payload: the llm/stream waterfall hands listeners a provider-neutral GenerateOptions and a StreamChunk iterable, and the actual JSON is built below that, inside the adapter. Two consequences are documented rather than glossed: a fetch reference cached before the plugin activates is not observed (the shipped dsh-llm-pi-ai builds its client per request, so it is covered), and the wrapper is restored synchronously on disposal so a live profile reload cannot leave a stale one installed. Only URLs matching the configured capture path take the capture branch; every other call is forwarded untouched.

Details

Alternatives

tancheng33/dsh-spill-s3 · Tang-mm95/dsh-single-instance-guard · wulun811/dsh-plugin-vet

More plugins in Development & Runtime

Browse more in Development & Runtime

Guides for Development & Runtime plugins