What happened?
The /export HTML output silently drops any custom message whose display flag is false. That flag is documented as a TUI-only toggle (packages/coding-agent/docs/session-format.md: display: boolean; // Show in TUI) — its only job is to reduce noise in the live terminal. But the export template (packages/coding-agent/src/core/export-html/template.js, inside renderEntry) keys the custom-message branch on entry.display, so anything injected into the model's context with display:false never appears in the exported file.
Custom messages always participate in LLM context (per the pi.sendMessage() docs). So the export can hand you a conversation that omits text which was actually sent to the model — a record that looks complete but isn't.
Example — the pi-llm-wiki extension:
With the extension active, before_agent_start runs wiki_recall every turn and injects the results as a hidden tail message (customType: "wiki-recall-context", display: false) to keep the system-prompt cache prefix stable. The agent reads that context and reasons over it — it can tell you "the recalled wiki pages aren't relevant to this project." But when you /export the session and open the HTML, the recall block is gone. There's no way to confirm what the agent saw, or whether it was truly irrelevant. The session notice ("LLM Wiki active — recall runs each turn") does show up (it's display:true), but it describes the feature; it carries none of the recalled content.
Steps to reproduce
- Load an extension that injects a
display:false custom message into context (pi-llm-wiki, which auto-recalls each turn, works).
- Send a message and let the agent respond.
/export the session and open the HTML in a browser.
- The injected context block is absent from the export even though it was part of the model's prompt.
Expected behavior
The export is a durable record of everything communicated to the LLM, so it should render every custom message regardless of display. Messages hidden from the live TUI should still appear, clearly labelled as auto-injected context (so you can tell they were added, not spoken by the user or agent).
This is a core-export behavior, not an extension: any extension using display:false for context rather than TUI noise is affected. The pi-llm-wiki case is just where it becomes visible.
Proposed fix (already implemented against this checkout): render all custom messages in the export and style TUI-hidden ones distinctly with an "injected into model context" label. See the diff on template.js / template.css. Version 0.84.4.
What happened?
The
/exportHTML output silently drops any custom message whosedisplayflag isfalse. That flag is documented as a TUI-only toggle (packages/coding-agent/docs/session-format.md:display: boolean; // Show in TUI) — its only job is to reduce noise in the live terminal. But the export template (packages/coding-agent/src/core/export-html/template.js, insiderenderEntry) keys the custom-message branch onentry.display, so anything injected into the model's context withdisplay:falsenever appears in the exported file.Custom messages always participate in LLM context (per the
pi.sendMessage()docs). So the export can hand you a conversation that omits text which was actually sent to the model — a record that looks complete but isn't.Example — the
pi-llm-wikiextension:With the extension active,
before_agent_startrunswiki_recallevery turn and injects the results as a hidden tail message (customType: "wiki-recall-context",display: false) to keep the system-prompt cache prefix stable. The agent reads that context and reasons over it — it can tell you "the recalled wiki pages aren't relevant to this project." But when you/exportthe session and open the HTML, the recall block is gone. There's no way to confirm what the agent saw, or whether it was truly irrelevant. The session notice ("LLM Wiki active — recall runs each turn") does show up (it'sdisplay:true), but it describes the feature; it carries none of the recalled content.Steps to reproduce
display:falsecustom message into context (pi-llm-wiki, which auto-recalls each turn, works)./exportthe session and open the HTML in a browser.Expected behavior
The export is a durable record of everything communicated to the LLM, so it should render every custom message regardless of
display. Messages hidden from the live TUI should still appear, clearly labelled as auto-injected context (so you can tell they were added, not spoken by the user or agent).This is a core-export behavior, not an extension: any extension using
display:falsefor context rather than TUI noise is affected. The pi-llm-wiki case is just where it becomes visible.Proposed fix (already implemented against this checkout): render all custom messages in the export and style TUI-hidden ones distinctly with an "injected into model context" label. See the diff on
template.js/template.css. Version 0.84.4.