Repository navigation
Leave the conversation out of an exported page - #5715
Merged
Merged
Conversation
An export goes to people who shouldn't see the conversation with the agent, and the decision on #4070 is that none of it is in the file. An export used to embed the page's whole reading and turn the thread surface off, so a recipient couldn't read the discussion on the page while anyone reading the file's source could. An export's reading now folds from the part of the log that changes the page: actions and reports on page widgets, their undos, and stamps, with each changelog blanked and each event's session removed. The capture takes no process facts, so the agent's live activity, session name and working directory stay out, and it holds only the data sources the page's markup binds, since a widget in a message can bind one. Media named only by a message was never captured. Threads, obligations, queues, to-dos, the plan, activity and history are all readings of that log, so none of them has a message to carry, and an event kind `_page_log` doesn't name stays out. Widgets keep the state the user recorded, and an undone choice stays undone. This rejects both other readings of the issue, as the `exporting.py` header records: keeping the threads embedded with their surface off is the leak, and showing them read-only shows the discussion to the same people. With no threads to hide, the runtime loses `threadAvailable`, and the thread pass runs offline over an empty list as it does on any page with no threads. A widget's thread seat used to draw a composer in an export that could send nothing, so `threadBox` now returns null there. `_module_urls` no longer reads message markup, so a widget only a message names brings no module, and `export_document` no longer blanks `others`, since a capture with no process holds no neighbours.
threadBox returns null on an exported page since the export strip, as module-annotations.md says; the registry's $keys text, which the site's key reference is generated from, still named only thread markup and quoted content.
# Conflicts: # browser/registry.json
leaf-agent
approved these changes
Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An export goes to people who shouldn't see the conversation with the agent, and the decision on #4070 is that none of it is in the file. An export used to embed the page's whole reading and turn the thread surface off, so a recipient couldn't read the discussion on the page, but anyone reading the file's source could.
What an export holds
An export's reading now folds from the part of the log that changes the page (
_page_loginexporting.py): actions and reports on page widgets, their undos, and stamps. Each stamp's changelog is blanked, and each event'ssessionis removed. The capture takes no process facts (capture_page_snapshotwithprocess=False), so the agent's live activity, session name and working directory stay out. The file holds only the data sources the page's markup binds (_page_data), since a widget in a message can bind one. Media named only by a message was never captured.Threads, obligations, queues, to-dos, the plan, activity and history are all readings of that log, so none of them has a message to carry, and an event kind
_page_logdoesn't name stays out. Widgets keep the state the user recorded, and an undone choice stays undone.Rejected designs
This rejects both other readings of #4070, as the
exporting.pyheader records. Keeping the threads embedded with their surface off is the leak this change closes. Showing them read-only, as the issue suggested, puts the discussion in front of the same people.What the runtime loses
With no threads to hide, the runtime loses
threadAvailable(leaf.js,application.js,thread/presentation.js), and the thread pass runs offline over an empty list, as it does on any page with no threads. A widget's thread seat used to draw a composer in an export that could send nothing, sothreadBoxnow returns null there. Thex-thread-seattext in the registry's$keys, which the site's key reference is generated from, andmodule-annotations.mdboth say so._module_urlsno longer reads message markup, so a widget that only a message names brings no module.export_documentno longer blanksothers, since a capture with no process holds no neighboring pages.serving-pages.md,docs/how-it-works.htmland the help forleaf page exportsay what the file holds and leaves out.Tests
test_an_export_holds_the_page_and_nothing_of_the_conversationplants a word in each part of the conversation: a comment and the passage it quotes, an attachment, a reply carrying a widget and the data that widget binds, a pick on that widget, a thread title, a to-do and its status, a plan, the agent's live activity, both changelogs, and the session's working directory. It checks that each word is in the live reading, then finds none of them in the exported file or its decoded resources. The page's own data stays, the recorded choice stands, and the undone one stays undone. The offline browser test now also checks that a thread on a seated widget, and the box to start one, are absent from the export.Run on the merge with main (
9a7a55412):uv run pytest tests/model/test_render_export.py tests/model/test_module_url_delivery.py: 90 passedtests/browser/test_render_export.pyby node id, the two tests this changes plustest_interactive_export_with_an_obligation_reaches_application_presentation,test_an_export_runs_what_its_served_page_runsandtest_an_export_s_preview_takes_escape_before_the_dialog_around_it: 6 passedpnpm run test:runtime: 898 passedpnpm run check: passedpre-commit run --fileson the changed files: passedCloses #4070