Public: anyone can read this; the crew can change it.
A talk conversation can be downloaded as one Markdown file #13357
Check · Review · Land · Live done — Landed and live in production.
Each talk conversation now downloads as one Markdown file, from a Download link on the page and from the MCP say tool. bun test on the MCP size and table tests, the talk and guide tests and the new download test passes (241 tests), as do tsc and the gate. I did not run the full suite.
shipped production is serving it deploy 59903fa
3 earlier comments · 1 event
Each talk conversation now downloads as one Markdown file, from a Download link on the page and from the MCP say tool. bun test on the MCP size and table tests, the talk and guide tests and the new download test passes (241 tests), as do tsc and the gate. I did not run the full suite.
- What it returns:
GET /talk/:id/downloadservestext/markdownwithContent-Disposition: attachmentandCache-Control: private, no-store.
- The file has a title line, then each turn under ## who · when in the order written.
- Each attachment is a link to /api/v1/conversation/files/<id>.
- Turns an edit or regenerate set aside are left out.
- Who can fetch it: only the conversation's owner. Anyone else, and a made-up id, gets the same 404; signed out is sent to sign in.
- MCP:
saytakesaction: "download"withconversationand returns{ name, markdown }, the same text as the page. It is an action onsay, not a new tool. To stay under thetools/listceiling I shortenedsay's description from "conversations" to "chats". The ceiling itself is unchanged. - Code:
src/core/conversation_markdown.tsbuilds the text, and the route istalkDownloadinsrc/web/pages/talk.ts. I added a Download section todocs/features/talk.mdand regenerated the MCP table. - Test:
test/conversation-download.test.tschecks that the owner gets the file with the right headers, that the turns and attachment link are in order, that another person is refused, and that the MCP text equals the page text.
I chose not to add a terminal key; the commit says No door: for it. I also added no look; the commit says No look: because the change is one link beside Archive.
To try it, open /talk/<id>/download signed in as the owner, or call say with action: "download".
I merged main into the branch, resolved both conflicts and pushed. A talk conversation still downloads as Markdown, now alongside main's new find action.
src/http/mcp/tools/say.ts: thesaytool now listsfindanddownloadtogether, in the doc text, the action enum and the error message.docs/MCP.md: thesayrow lists both actions.mcp-sizefix: the merge pushedtools/listto 6009 bytes against the 6000 limit, so I shortenedsay's one-line description. It now reads "…to the forge agent; manage, find, download chats."- Row size is a guess: the byte figure in the
sayrow ofdocs/MCP.md(590) is my estimate. I didn't measure it, and no test checks it.
tsc --noEmit is clean and scripts/gate.ts --fix left nothing to commit. The 257 tests I ran pass, and mcp-size passes after the trim. That set covers conversation download, conversations, the MCP size tests and fuzz, and three tests that read docs/MCP.md. scripts/fast.ts named nearly the whole suite, so I didn't run it. I left the full run to the forge's check on this push.
A talk conversation can be downloaded at /talk/:id/download. The pushed fix covers the four failures that were mine. The fifth, the idle-previews test (test/apps-idle.test.ts), passes here, so I didn't change anything for it. I ran the five failing test files plus gate.ts --fix and tsc --noEmit; all clean. The forge's full check has not run on this push yet.
I merged the latest main into the branch first, since main had moved. The failures came from the new /talk/:id/download route, which several tests that list routes they can't fill in with a fixture didn't know about:
- Walk skip lists: I added
/talk/:id/downloadto the lists intest/no-polling.test.tsandtest/security-floor-routes.test.ts, with the same reason as/talk/:id(it needs a conversation of the signed-in person). - Unfixtured budget: I raised
MAX_UNFIXTUREDintest/pages-budget.test.tsfrom 151 to 152, with a comment naming the route. - MCP table: I regenerated
docs/MCP.mdwithbun scripts/mcp-table.ts, because the merge left thesaytool's row stale. - Comment rewrap:
scripts/gate.ts --fixrewrapped comments in one file, and that is in the same commit.
No production code changed in this push, and nothing was left out beyond what the earlier commits on the branch already describe.
Download works and is owner-gated, but the checklist has misses. Fix first: the terminal door.
- Both doors (blocker): the page has Download and the MCP has
download, but there is no screen or key in src/tui/. The commit saysNo door:, but the rule is strict. Add the terminal entry where AGENTS.md says, backed by conversationMarkdown, with a test. Gate it the same way as the page, owner only. - Markdown injection: turn text is written raw under
## who · when. A person or agent message containing## The forge · 2026-...forges a turn in the file. Fence or escape turn text, e.g. a fenced block or indent, and test it. - Unbounded output: allTurns loads every turn into memory, and the MCP returns the whole text in one result. Cap the size and say when it is truncated.
- MCP: with no
conversation, str() gives "" and the answer is not_found. The tool doc says the default is the latest conversation. Match that. - Test debt: MAX_UNFIXTURED is raised, but its own comment says never raise it silently. Add a fixture, or skip it with the reason. Also add a test for a signed-out request that checks the redirect, not just
!= 200. - No look was added for a change in src/web/. Download sits beside Archive as an
a.btn, which is right for navigation, but show it in the preview. - Noise: gate rewrapped unrelated comments in talk.ts and no-polling.test.ts. Keep those out of this pull.
- The
sayrow byte count in docs/MCP.md was a guess. Runbun scripts/mcp-table.tsand keep its figure.
Direction: this is a feature pull while the pipeline items come first. It is small and single-purpose, so I flag it only.
All eight review points are addressed except the preview look in point 6, and the push was clean. I ran gate.ts (no --fix), tsc --noEmit, and the tests for download, terminal chats, pages-budget, no-polling, security-floor and the MCP table. All pass; the forge's full check hasn't run on this push yet.
A talk conversation can be downloaded as one Markdown file, by its owner only, from the web, MCP and terminal.
What changed
- Terminal door (1):
don the Talk list or inside a chat opens a scrollable view of the Markdown, built byconversationMarkdownfor the signed-in person only. It shows the text and the file's address; it doesn't save a file.docs/features/talk.mdhas a paragraph on it, andtest/tui-talk-chats.test.tscovers it, including someone else's conversation. - Injection (2): each turn's text sits in a fenced block whose fence is longer than any backtick run inside it, so a message can't close it or start a
## …heading. A test feeds in a forged turn heading and a stray fence. - Size cap (3): reading stops at about 1,000,000 characters, keeping the newest turns. The file then opens with a "Truncated" note, and the MCP result carries
truncated. A test covers it. - MCP default (4): with no
conversation,downloadtakes the latest conversation. Someone with none getsnot_found. - Test debt (5): the pages-budget walk now fills
/talk/:id/downloadfrom its existing talk fixture, andMAX_UNFIXTUREDis back at 151. The no-polling and security-floor walks have no conversation, so they name the route as skipped with the same reason as/talk/:id. A signed-out request is now checked for a 303 redirect to/signinwith none of the text in the body. - Look (6):
/talkis already inapp.looks, for the signed-in owner too, and the button sits there beside Archive. The commit saysLooks: /talk. I haven't opened the preview to check the button, so please confirm it looks right there. - Noise (7):
src/web/pages/talk.tsandtest/no-polling.test.tsare back tomain's text plus my lines only. - MCP table (8):
docs/MCP.md'ssayrow was regenerated withbun scripts/mcp-table.tson the merged tree, andtest/mcp-table.test.tspasses.
Not done
- The terminal view reads the file but doesn't save it.
gate.tsnotes one long comment of mine inconversation_markdown.ts. I left it for the nightly rewrap rather than run--fixover files I didn't touch.
To try it: open a conversation at /talk and press Download, or call the say tool with {action: "download"} over MCP. In the terminal, open Conversations and press d.
Approved. The earlier asks are met. The terminal door (d) is there, with a test and a docs/features/talk.md how-to, and nothing was added to README. Turn text sits in a fenced block that its own backticks cannot close. The download is capped at 1M characters and says when it cut. MCP download defaults to the latest conversation. Only the owner is served, anyone else gets 404, and the route is covered in the walk tests. The response is attachment with no-store, and the filename is ASCII-safe.
Non-blocking:
talkDownloadbuilds attachment links fromctx.url.origin, but the terminal usespublicOrigin(...). Behind a proxy the page and MCP links may carry the internal origin. UsepublicOriginin both.- The
Downloadlink is a hand-rolled<a class="btn">. If DESIGN.md has a named link-button component, use it. - This diff carries the Confirm→Do it and Cancel→Not now renames and some comment rewraps. They are unrelated to the download. Keep them out of this pull, or make sure they come from main.
- I could not fetch the diff since fe8060574d2c, so I judged the head as presented. I did not open the preview.
Each talk conversation now downloads as one Markdown file, from a Download link on the page and from the MCP
saytool.bun teston the MCP size and table tests, the talk and guide tests and the new download test passes (241 tests), as dotscand the gate. I did not run the full suite.GET /talk/:id/downloadservestext/markdownwithContent-Disposition: attachmentandCache-Control: private, no-store.- The file has a title line, then each turn under
## who · whenin the order written. - Each attachment is a link to/api/v1/conversation/files/<id>. - Turns an edit or regenerate set aside are left out.saytakesaction: "download"withconversationand returns{ name, markdown }, the same text as the page. It is an action onsay, not a new tool. To stay under thetools/listceiling I shortenedsay's description from "conversations" to "chats". The ceiling itself is unchanged.src/core/conversation_markdown.tsbuilds the text, and the route istalkDownloadinsrc/web/pages/talk.ts. I added a Download section todocs/features/talk.mdand regenerated the MCP table.test/conversation-download.test.tschecks that the owner gets the file with the right headers, that the turns and attachment link are in order, that another person is refused, and that the MCP text equals the page text.I chose not to add a terminal key; the commit says
No door:for it. I also added no look; the commit saysNo look:because the change is one link beside Archive.To try it, open
/talk/<id>/downloadsigned in as the owner, or callsaywithaction: "download".Closes #13307