Repository navigation
desk-web: the to-human message tool's messages land and stream in the session view - #94
Merged
Merged
Conversation
…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)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
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 throughmcp__maws__messageormcp__to-human__message(input{text}, resultsent) instead of a<message>span. The project log records such a message askind: "message"withsrc= the call's tool-use id. A span'ssrcis<row uuid>#<span>.What changes
1. A push for a tool message lands on its row (
views/project/landed-message.ts). The landing read everymessagesrc 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, andcallRowmaps a message tool's call torowId.toHuman(id), theto_humanrow MAWS draws for it. A span still lands throughjumpToMessage, 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, newdepth/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:toolUseId, from thetoolchunk and from the snapshot block'sid;to_humanrow, its text read from the partial JSON as far as it has come;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
views/project/landed-message.ts(push landing and the channel's jump into the session)depth/view/streaming-rows.ts,depth/stream/layer.ts(live streaming rows)conversation/landing.ts(eventLanding)messagesrc through asmessage, which (1) resolves. Doc comment and a test that pins the tool-use src caseviews/project/SessionView.tsx,ChannelView.tsxdepth/view/live-marks.tsconversation/stream.ts(the log-built channel, when the machine is offline or serves no transcript)messageevent by itstext, whatever its srcapps/desk-hub/src/objects/project.ts(the push, ~l.420)kind: "message"without reading the srcsw/notice.ts{writer, seq}, never the src or the textderive.tstoHumanRow,reportRows,ToHumanMessageRow)Tests
landed-message.test.ts:callRowmaps both message tools toto-human:<id>.landed-message.hook.test.ts, against MAWS's real store: amessagelanding reaches a span's text row, and each tool's accepted call reaches itsto_humanrow. The existing ask and question cases are unchanged.conversation/landing.test.ts:eventLandingpasses a tool-use src through as a message.message-input.test.ts: every cut of a realistic input with escapes,\uescapes and a surrogate pair reads as a beginning of the message. Also covered: whitespace, a first key that is nottext, and every truncated tail.streaming-rows.test.ts,report-stream.test.ts: the liveto_humanrow, 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.acceptance.spec.ts): a landing on a tool message opens at itsto-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-webis GREEN on 562a60d, run 39544900242.Review:
doperpowers:reviewer-mediumreviewed 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)