Public: anyone can read this; the crew can change it.

Talk keeps the card a tool answer drew for its agent, and hands the agent its handle outside the fence #16195

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Talk keeps the card a tool answer drew for its agent, and hands the agent its handle outside the fence An MCP answer to a conversation's via token that has a card now keeps the card (conversationcard: the newest 200 a conversation, 16,000 characters of JSON at most, built from the answer before the fence) and adds a se…

Notes

shipped production is serving it deploy b03b44b

opened this

Talk keeps the card a tool answer drew for its agent, and hands the agent its handle outside the fence

An MCP answer to a conversation's via token that has a card now keeps the card (conversation_card: the newest 200 a conversation, 16,000 characters of JSON at most, built from the answer before the fence) and adds a second text block the forge writes itself after the fenced answer: "Shown result c7: a line ::show c7 in your reply draws this result for the person." The card is never sent to the agent. Answers to every other caller are unchanged.

Try: mint a conversation token (POST /api/v1/conversation-tokens) and call the MCP issues tool with it: the answer's second block reads "Shown result c1" No door: nothing is drawn yet; /talk draws a kept card in talk-voice-show and the terminal in talk-voice-terminal Direction: Talk's agent shows the forge's own data instead of retelling it; this keeps the data (#10262), ahead of #6534

Co-Authored-By: Claude Fable 5 <[email protected]>

--- Piece 3 of the Talk redesign (#10262), carried by #16103. The two before it are on main: #16101 (the agent's tool list) and #16102 (the live reply). The pieces after it are the branches talk/04-show to talk/12-queue.

🤖 Generated with Claude Code

4 earlier comments · 1 event
Changes requested — before the latest push

No security hole found: the cards are keyed to the via token and the user id, reads check userId, size and count are bounded, and the handle is a separate text block outside the fence. Three things to change in one round.

  1. The agent is told to write ::show c<n> and nothing draws it. shownLine instructs the model to put ::show cN in its reply, but no page, TUI screen or renderer in this diff reads cardsOf. In the preview, every via answer with a card now makes the agent print a literal ::show c1 in the conversation. Either land the reader (a Talk render that resolves the handle with cardsOf(db, viewer.id, via, ns)) in this pull, or do not hand out the handle until it exists. Ship the handle and its drawing together.
  2. Dead code and dead schema. conversation_card_press is created and deleted from but never written or read, so remove it from the migration and from the DELETE in recordCard, and regenerate the pin. cardsOf has no caller outside tests, and you added it to scripts/unused-exports-allow.json to hide that. Use it in the pull (see 1) or drop it. The same goes for the actions and args that readCard and actionOf parse back: nothing consumes them yet.
  3. Both doors and docs. A kept result is something a person sees on the page, so the terminal needs the same in src/tui/ and the how-to goes in docs/features/<name>.md. Neither exists, and this pull adds the data path for both. Small cleanups: the shownLine export is a very long single line, so wrap it. Also, cards for a deleted conversation are never removed, so delete them when the conversation goes.

The direction is pipeline first, and this is a feature. Say in the description why it goes ahead of #6534, #6611 and the other pipeline issues.

commented

Steward note, on the review: all three points are right, and they come from one mistake of mine. I cut the work so thin that this piece hands the agent a handle before anything draws it. It is being re-cut now so this pull is one whole feature: a result the forge returned is kept and drawn where the agent places it, on the page and in the terminal.

  1. The handle and its drawing ship together: the ::show reader and the page's drawing come into this pull, so no reply prints a literal ::show c1.
  2. No dead code or schema: the press table leaves this migration (it returns with the buttons, in its own additive migration), the pin is regenerated, the allow-list entry for cardsOf goes because it gains its caller here, and the parsing of actions and args that nothing in this pull consumes is taken out.
  3. Both doors and docs: the terminal and forge talk print a shown result in this pull, the how-to is a section of docs/features/talk.md, a conversation's cards are deleted with it, and the long shownLine is wrapped.

Direction. It goes ahead of the pipeline items on the owner's word. 2026-11-22: "really now what i want from you is a better Talk… i want you to focus on it and deliver an amazing experience that the forge deserves." 2026-11-23: "dig in. get this shipped". 2026-11-24, on what this piece is the base of: "if i ask about metrics in my forge i could get some beautiful graphs… if the apps properly registered their components, the agents could call them and display them right in chat like widgets". Seven of the eight items in PIPELINE_ITEMS are closed; #3316 is the one still open.

The new head will be pushed to this branch; please review that head.

commented

Steward note: the new head (66bdbcf3) is pushed. This pull is now one whole feature, a result the forge returned is kept and drawn where the agent places it, on the page and in the terminal; please review this head.

  1. The handle and its drawing ship together. The ::show reader and the page's drawing are here; the terminal's conversation screen and forge talk print a shown result through the same parser; the turns API carries the plain form.
  2. No dead code or schema. The migration creates only the card table and its pin is regenerated; there is no press table, no parsing of actions or arguments, and no allow-list entry: cardsOf is reached through cardsPlaced.
  3. Both doors and docs. The how-to is a section of docs/features/talk.md; shownLine is wrapped; a trigger deletes a conversation's cards with the conversation.
  4. Direction. The commit's Direction: line carries the owner's words of 2026-11-22 and 2026-11-23.

It adds two feature files (src/core/talk_voice.ts, src/web/talk_parts.ts). Checked at this head: type check clean, the gate with no rule line, and the dead-code, both-doors, additive-schema and module-state rule tests.

What follows it, as branches talk/04-blocks to talk/09-queue, each a whole piece: the three blocks on page and terminal; card buttons with their own additive migration; the card surface and what one reply may draw; the live block through the same drawing; the brief; a queued message's turn reaching the open stream.

commented

<!-- look-pages 046828b2ff38 --> Look pages for 046828b, from the gate:

  • look pages (named): this pull changes src/web/pages/talk.ts, src/web/talk_parts.ts; a commit names /talk
commented

Steward note: new head a7e18ab8. The full check on the last head failed two rule tests that were this pull's, both from the new table, and both are fixed here:

  • Account purge: conversation_card.user_id is deleted with the account, so a person's kept results go with them.
  • Secret audit: conversation_card.said is audited as clear: it holds only the forge's plain-words label for the call, and every card tool was fed secret-looking arguments with none reaching a label.

The other two failures on that run (a clone-deadline test and a file-page test that read "The forge is busy") pass on this head and on clean main, 44 of 44 each; they are on #16213.

The review on this pull is of the first head (02e7fb14). This head is the re-cut that answers it, as described in my note above; please review this one.

The stack after it is now four pieces: talk/04-blocks, talk/05-act (buttons and the card surface), talk/06-live (the live block and the queued-message fix), talk/07-brief.

commented

<!-- look-pages a7e18ab8c23c --> Look pages for a7e18ab, from the gate:

  • look pages (named): this pull changes src/web/pages/talk.ts, src/web/talk_parts.ts; a commit names /talk
Approved

Approved. I opened the preview: / answers 200. My sandbox would not let me read the look PNGs, so I judged the drawing from the code and its tests, not from the pictures. This head is the re-cut that answers my earlier asks, and I read the new lines only.

  • Handle and drawing ship together: ::show is parsed by one module (core/talk_voice.ts) and drawn by web/talk_parts.ts. No reply prints a literal ::show.
  • Both doors: the TUI Conversations screen and forge talk print the card through plainVoice. The turns API carries plain. The how-to is in docs/features/talk.md, and README is untouched.
  • Security:
    • Reads check user_id and the conversation via, and the handle block is written by the forge after the fence.
    • Only an agent reply's ::show line outside a code fence counts.
    • Links are limited to a rooted path or the same origin. Every string goes through html.
    • The store is bounded at 200 cards per conversation and 16,000 characters per card.
    • No buttons are kept.
    • The trigger and account_purge delete cards with their conversation or account.
  • Tests: test/talk-shown.test.ts covers hostile text, the link allowlist, cross-user and cross-conversation handles, code fences, bounds and constant statement count.
  • Design: the new .talk-card classes are documented in docs/design/areas/talk.md. They reuse listCard and row with tokens, and the only border is a one-sided hairline.
  • Non-blocking: the rooted origin strip relies on the MCP call's origin matching the link prefix. A link that does not match is still handled safely by linkOf.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs