Expand description
/debug support dump: rendered TUI lines plus session messages, written to
{agent}/pi-debug.log.
Ports the observable shape of handleDebugCommand in the TypeScript
modes/interactive/interactive-mode.ts: an ISO timestamp, terminal size,
the fully rendered lines with their visible widths, and the agent messages
as JSONL. Two additions over the reference, both required by the rewrite:
- Redaction. The dump is written to the user’s disk and frequently
shared for support, so credential-shaped substrings (bearer tokens,
Authorizationheaders,sk-style keys, JSONapi_keyfields, andx-api-keyheaders) are masked before the file is written. Image data and ordinary text are preserved. - Atomic write. The file is written to a sibling temporary path and renamed into place, so a crash mid-write never leaves a half dump.
Structs§
- Debug
Dump Input - Input captured for a debug dump.
Functions§
- redact_
secrets - Mask credential-shaped substrings in
text. - render_
debug_ dump - Render a debug dump to its full text form, with secrets redacted.
- write_
debug_ dump - Render and atomically write a dump to the host debug log path.
- write_
debug_ dump_ atomically - Write
contenttopathatomically (temp file + rename). - write_
debug_ dump_ with - Render and atomically write a dump to the path resolved from
agent_dir.