Skip to content

desk-web: the to-human message tool's messages land and stream in the session view - #94

Merged
SSFSKIM merged 2 commits into
masterfrom
desk-message-tool
Oct 21, 2026
Merged

SSFSKIM merged 2 commits into
masterfrom
desk-message-tool

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

The desk's side of the to-human message tool (doperpowers' spec docs/doperpowers/specs/2026-10-20-to-human-message-tool-design.md, its cross-repo contract; MAWS's side is P4-R7, 82a0967). A session can send its human a message through mcp__maws__message or mcp__to-human__message (input {text}, result sent) instead of a <message> span. The project log records such a message as kind: "message" with src = the call's tool-use id. A span's src is <row uuid>#<span>.

What changes

1. A push for a tool message lands on its row (views/project/landed-message.ts). The landing read every message src as a span. A tool-use id names no row, so the view paged through the whole history and then said the row was not in the transcript. Now a message src that names no span of a held row is read as a call, and callRow maps a message tool's call to rowId.toHuman(id), the to_human row MAWS draws for it. A span still lands through jumpToMessage, and an ask or question still lands on its own row. The notification's landing and the channel's jump into the session view share this path (ChannelView → eventLanding → SessionView → useLandOnMessage).

2. A tool message draws while its input streams (depth/stream/layer.ts, depth/view/streaming-rows.ts, new depth/view/message-input.ts). This is the contract's optional desk item (2). A <message> span draws in the session view while the model writes it. A tool message drew nothing until its call's row landed, and the engine writes that row only when the whole response ends. So a message sent before a long command appeared only after the command's input had streamed too. Now:

  • the streaming layer keeps each tool block's toolUseId, from the tool chunk and from the snapshot block's id;
  • a message tool's streaming input is drawn as a pending to_human row, its text read from the partial JSON as far as it has come;
  • the reader leaves out an escape or a surrogate pair that was cut in half;
  • a copy that a resync cut to its last 65,536 characters reads as none, since the start of the text is lost. The message then appears when its row lands.

The live row marks its turn in the report the way the landed row does, and it is gone, with no double, once the call's row lands.

Desk paths checked

Path Verdict
views/project/landed-message.ts (push landing and the channel's jump into the session) Changed (1)
depth/view/streaming-rows.ts, depth/stream/layer.ts (live streaming rows) Changed (2)
conversation/landing.ts (eventLanding) No code change: it already passes any message src through as message, which (1) resolves. Doc comment and a test that pins the tool-use src case
views/project/SessionView.tsx, ChannelView.tsx No code change: they hand the src to the landing. Doc comments only
depth/view/live-marks.ts Not needed: it closes open marks in streaming text, and a tool's text carries no marks to close
conversation/stream.ts (the log-built channel, when the machine is offline or serves no transcript) Covered: it draws a message event by its text, whatever its src
apps/desk-hub/src/objects/project.ts (the push, ~l.420) Covered: it pushes on kind: "message" without reading the src
sw/notice.ts Covered: the notice carries {writer, seq}, never the src or the text
The session and channel views' drawing of a landed call, the report fold, the subagent pane Covered by MAWS's renderer (P4-R7: derive.ts toHumanRow, reportRows, ToHumanMessageRow)

Tests

  • landed-message.test.ts: callRow maps both message tools to to-human:<id>.
  • landed-message.hook.test.ts, against MAWS's real store: a message landing reaches a span's text row, and each tool's accepted call reaches its to_human row. The existing ask and question cases are unchanged.
  • conversation/landing.test.ts: eventLanding passes a tool-use src through as a message.
  • message-input.test.ts: every cut of a realistic input with escapes, \u escapes and a surrogate pair reads as a beginning of the message. Also covered: whitespace, a first key that is not text, and every truncated tail.
  • streaming-rows.test.ts, report-stream.test.ts: the live to_human row, and MAWS's projection folding its turn with the message in view.
  • layer.test.ts: the tool's id is kept from a chunk and from a snapshot.
  • e2e (acceptance.spec.ts): a landing on a tool message opens at its to-human: row, marked; the message streams, then settles to its row, drawn once.

Before the change, the three new unit cases and both new e2e cases fail, and the span case passes.

Gate: scripts/ci-gate.sh --gates static,unit,e2e:desk-web is GREEN on 562a60d, run 39544900242.

Review: doperpowers:reviewer-medium reviewed 82a0967..562a60d and called it correct, with no material findings. It also found no other desk path that assumes a span-shaped src.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)

…all's row

The log's `message` event for a message tool's call (mcp__maws__message, mcp__to-human__message) carries the call's
tool-use id as its `src`, not a span's `<row uuid>#<span>` (doperpowers' to-human message tool spec, its cross-repo
contract). The landing read every message's src as a span, so a push for such a message paged through the session's
whole history and said its row was not in the transcript. A message's src that names no span of a held row now names
the call, and `callRow` maps a message tool's call to the `to_human` row MAWS draws for it (P4-R7's
`rowId.toHuman`); a span and an ask land where they did.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
… view

A `<message>` span draws in the session view while the model writes it (the streaming layer's text blocks, bridged into
the turn's report). A message sent through a message tool (mcp__maws__message, mcp__to-human__message) drew nothing
until its call's row landed, which the engine writes only once the whole response ends: a message followed by a long
command appeared only after that command's input had streamed too. The streaming layer now keeps a tool call's id, and
a message tool's streaming input is drawn as the `to_human` row MAWS draws for the landed call (P4-R7), its text read
from the partial JSON as far as it has come (`message-input.ts`: an escape or a surrogate pair cut in half is left out;
a copy a resync cut to its tail reads as none). The row marks its turn in the report as the landed one does, and is
gone, with no double, once the call's row lands.

e2e: the landing on a message tool's message (the previous commit) and this drawing, in the DC9 acceptance suite.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T04:50:18.524274Z 562a60d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SSFSKIM
SSFSKIM merged commit 8afe47e into master Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant