Skip to content

feat: show a delivered session message's body, with its header and guidance folded - #3052

Merged
spacedragon merged 1 commit into
mainfrom
dev/yulong/session-message-display
Oct 15, 2026
Merged

spacedragon merged 1 commit into
mainfrom
dev/yulong/session-message-display

Conversation

@spacedragon

Copy link
Copy Markdown
Contributor

Why

When one session sends another a message (an agent call, a reply, a task's input, or a task's round report), the console showed the model's whole input as the message. A task report in webchat read like this:

[Message msg-…] Report from your task (session …):
[task finished] Task webchat:a2a:…:subsession:… finished this round of work. Its final output, delivered on its behalf:

<the actual result>

To give it more work in the same context, call sendMessage with {"action":"messageTask","taskId":"…","message":"..."}.

Speak to the people here in the language they use, even when this report is in another.

The header and the guidance are for the model, not for the person reading.

What changed

Daemon (collab/session-message.ts, collab/coordinator.ts, daemon.ts, assistant/{tasks,patrol}.ts)

  • Every session-message builder now produces three things instead of one string:
    • text: the readable part. For a call, reply or task input that is its body; for a task report, the task's final output or its one-line status.
    • turnBody.prompt: the rendered message, unchanged. The model reads it first everywhere: first delivery (session-manager), replay and context refresh (transcriptPromptText), and steering. Inbox replay carries turnBody too.
    • turnBody.sessionMessage: the header facts plus the guidance verbatim as notes.
  • renderInput becomes sessionInput.
  • Task round reports carry a shown part beside their text: the output, or the status line, plus the framing and the messageTask call. On a later session of the place, the hint swap applies to the folded note as well. Rows written before this change fall back to showing the whole text.
  • A wake paired with a visible platform post (transcriptTs) is left exactly as it was. It lands on that post's row, whose text and replay stay the post's own.

Protocol

  • New SessionMessageTurnFacts on UserTurnBody.sessionMessage: id, kind, source agent, label and session, inReplyTo, replyRequested, startsTask, and notes.

Web

  • parseUserTurnBody validates the new fact, failing closed like the others.
  • The transcript step carries it. The bubble gets a one-line caption, such as "Reply from reviewer" or "Report from a background task". Under "more", the UserTurnDetails fold shows the sender, session, message id, the message it answers, whether it awaits a reply, and "Guidance the agent received". The prompt itself is still never shown.
  • This applies both to agent bubbles and to the user-side bubble used for an agent the page doesn't list. Webchat renders through the same view.
  • en and zh-CN strings are added.

Side effects, all toward the body: session titles no longer start with [Message msg-…]. Recall excerpts, memory dream input, and the context post a webchat peer receives now carry the body instead of another session's header and reply instructions.

Docs: send-message-guide.md §9.5 records the split.

Verification

  • Typecheck is clean for protocol, daemon, web and control plane. Eslint and prettier are clean.
  • The full web suite passes locally (365 files, 3806 tests). Protocol tests pass (752).
  • These daemon suites pass: sendMessage, collab, assistant, webchat and session-manager (24 files).
  • Existing assertions about what the model receives now read turnBody.prompt ?? text, through a modelText helper. They still pin the exact rendered prompt.
  • New tests:
    • session-message-display.test.ts: the split, notes, and a report with and without output.
    • daemon-message-agent: the call's display and facts, and the paired-post exemption.
    • subsession-continuation: task input facts, and a report's shown status with its folded notes.
    • Web: the parser, the fold, and a SessionDetailView page test where the caption and body show, the prompt never does, and the fold reveals the facts and guidance.

🤖 Generated with Claude Code · Claude Opus 5.5

…idance folded

A message one session sends another (an agent call, a reply, a task's
input or round report) reached the console as the whole model input: the
`[Message msg-…] Reply from … to your message …:` header, the body, and
the guidance meant for the model, such as the replyToSession call, a
report's framing and messageTask call, and the language note. Webchat and
the session page showed all of it as the message.

The daemon now keeps the readable part as the transcript row's `text` and
the rendered message as `UserTurnBody.prompt`, which every model-facing
read already prefers, so the model's input is unchanged. A new
`UserTurnBody.sessionMessage` fact carries the header (id, kind, source
agent and session, the message answered, whether a reply is owed) and the
guidance verbatim as `notes`. A task report shows the task's final output,
or its one-line status, and folds the framing. A wake paired with a
visible platform post keeps that post's row as it was.

The console captions such a bubble with its sender and folds the facts
and notes under "more". Session titles, recall excerpts, and the context a
webchat peer receives now carry the body instead of another session's
header and reply instructions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@agentconnect-md-test agentconnect-md-test Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed revision fbb1531. No blocking findings.

The display split preserves the rendered model prompt through initial delivery, inbox persistence, replay, and context refresh. Paired visible posts retain their existing behavior, and the console handles both agent and user-side message bubbles.

Validation: diff check passed. I could not run tests locally because this checkout has no installed dependencies or pnpm; CI is still pending.

sent by review-bot (Codex · gpt-6-astra) · open in session

@spacedragon
spacedragon merged commit d6a233a into main Oct 15, 2026
13 checks passed
@spacedragon
spacedragon deleted the dev/yulong/session-message-display branch October 15, 2026 08:20
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