Skip to content

🤖 feat: present subagent reports in chat#3742

Open
ammar-agent wants to merge 2 commits into
mainfrom
feat/subagent-report-presentation
Open

🤖 feat: present subagent reports in chat#3742
ammar-agent wants to merge 2 commits into
mainfrom
feat/subagent-report-presentation

Conversation

@ammar-agent

Copy link
Copy Markdown
Collaborator

Summary

Present sub-agent progress and completion reports as first-class transcript content instead of exposing the model-facing <mux_subagent_report> protocol envelope. This is a follow-on to #3714.

Background

Incremental agent_report updates now wake the parent and are intentionally UI-visible. Before this change, those synthetic messages appeared as dimmed user bubbles with an AUTO badge and raw XML tags, which obscured the actual findings and made status hard to scan.

Implementation

  • Parse exact backend-authored synthetic report envelopes while leaving malformed or user-authored lookalikes on the normal escaped message path.
  • Render report title, agent type, incremental/completed state, and markdown findings in a full-width transcript card.
  • Keep optional structured workflow output behind a compact disclosure with bounded JSON scrolling.
  • Copy the visible report findings rather than the internal envelope.
  • Preserve legacy reports without an explicit status as completed reports.
  • Truncate long child-side agent_report tool titles so status remains visible at narrow widths.
  • Add full-app desktop and pinned-phone Storybook stories covering incremental, completed legacy, and structured-output states.

Validation

  • bun test src/browser/features/Messages/MessageRenderer.test.tsx — 15 passed
  • bun test src/browser/features/Tools/AgentReportToolCall.test.tsx — 3 passed
  • make static-check
  • make storybook-build
  • Visually inspected the full-app stories at 1440px desktop and 390px phone widths; the phone story is pinned to the Pixel phone viewport in both themes.

Risks

The parser intentionally recognizes only the exact synthetic envelope emitted by TaskService. Unknown or malformed payloads self-heal by falling back to the existing generic synthetic-message renderer, avoiding blank or untrusted special-case UI.

Pains

The Storybook test-runner can exceed its 30-second smoke timeout while cold-starting a full desktop App story before story assertions begin. The desktop and phone stories are therefore visual-only Pixel contracts, while parser and rendering behavior is covered by colocated unit tests.


Generated with mux • Model: openai:gpt-5.6-sol • Thinking: xhigh • Cost: $124.37

Render trusted synthetic subagent report envelopes as readable transcript cards with semantic progress state, markdown, structured-output disclosure, and mobile-safe layout.

Add behavioral coverage plus full-app desktop and pinned-phone Storybook stories.

_Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$124.37`_

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=124.37 -->
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the dedicated synthetic subagent report presentation, fallback behavior, and responsive Storybook coverage.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b4df24cf3

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/features/Messages/SubagentReportMessageContent.tsx Outdated
Comment thread src/browser/features/Messages/SubagentReportMessageContent.tsx Outdated
Anchor report markdown parsing at the protocol field terminator so examples containing report tags remain intact, and normalize valid multiline titles for display.

_Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$124.37`_

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=124.37 -->
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Addressed both Codex findings in c26a6d1c5:

  • PRRT_kwDOPxxmWM6ScPpZ: report markdown now uses the final protocol terminator, so fenced examples containing </report_markdown> remain intact; added regression coverage.
  • PRRT_kwDOPxxmWM6ScPpf: titles are parsed across newlines and normalized to a single display line; added regression coverage.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the parser hardening for protocol-looking markdown delimiters and multiline titles.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: c26a6d1c5a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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