Skip to content

🤖 feat: present subagent reports in chat#3742

Merged
ammario merged 13 commits into
mainfrom
feat/subagent-report-presentation
Jul 22, 2026
Merged

🤖 feat: present subagent reports in chat#3742
ammario merged 13 commits into
mainfrom
feat/subagent-report-presentation

Conversation

@ammar-agent

@ammar-agent ammar-agent commented Jul 21, 2026

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, obscuring the findings and making 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.
  • Preserve arbitrary report markdown and titles, including semantic whitespace and literal protocol delimiter examples.
  • Render 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 visible report findings rather than the internal envelope.
  • Treat legacy reports without an explicit status as completed.
  • Truncate long child-side agent_report tool titles so status remains visible at narrow widths.
  • Add clearly named, full-app Pixel stories for App/SubagentReports/Desktop and App/SubagentReports/Phone, each in light and dark themes.
  • Mask Chromium's native audio/video controls in the attachment gallery because their internal loading frame is not controlled by page CSS and produced unrelated visual flakes.

Validation

  • bun test src/browser/features/Messages/MessageRenderer.test.tsx — 19 passed
  • bun test src/browser/features/Tools/AgentReportToolCall.test.tsx — 3 passed
  • make static-check
  • make storybook-build
  • Verified Pixel 0.2.1 discovers four uniquely named report snapshots: desktop/phone × dark/light.

Risks

The parser 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

Pixel 0.2.1 groups snapshots by story title rather than title/story name. Splitting desktop and phone coverage into separately titled story files makes both report views explicit without upgrading the engine and renaming every existing project snapshot. A broad animation override was tested and rejected because it changed 17–25 unrelated baselines.


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

@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
@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".

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Pixel follow-up:

  • Confirmed Pixel was already capturing four new report UI snapshots (desktop and phone, light/dark).
  • Reproduced the unrelated noise with two complete local Pixel runs: 8 snapshots changed between identical captures.
  • Added Pixel-only motion/caret stabilization and masked Chromium native media controls.
  • Excluded two duplicate snapshots whose one-shade rounded-border rasterization remained nondeterministic; their Storybook interaction tests remain active.
  • Repeated two complete 337-snapshot captures after the fixes: changed=0.

Please review the refreshed Pixel build; it should now contain the intentional report UI snapshots without the unrelated flakes.

@codex review

@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: 998a748c6d

ℹ️ 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
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Addressed PRRT_kwDOPxxmWM6S9zyE: report markdown is no longer trimmed, preserving leading indentation and trailing spaces used by indented code blocks and hard line breaks. Added exact regression coverage.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the exact report-markdown whitespace preservation and Pixel stability changes.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Follow-up: rewrote the hard-break fixture to construct its two trailing spaces in the template expression, so the regression remains exact without source-level trailing whitespace.

@codex review

@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: a22bcaed63

ℹ️ 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
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Pixel review update:

  • Removed the broad Pixel-only animation/transition override that was causing unrelated baseline churn.
  • Restored the two excluded snapshots; their Storybook coverage remains unchanged.
  • Retained only the native media-control mask for the reproducible attachment spinner flake.
  • Upgraded @coder/pixel-storybook to 0.2.2, which reports unique title/story display names so the new App/SubagentReports/Desktop and App/SubagentReports/Phone snapshots are visible in review.
  • Added the Codex-requested regression for literal </title> text inside valid report titles.

@codex review

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Addressed PRRT_kwDOPxxmWM6S98sC in a9d31bbb76: title parsing now finds the final </title>\n<report_markdown> protocol separator, preserving literal </title> examples inside arbitrary multiline titles. Added regression coverage for the exact case.

@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: a9d31bbb76

ℹ️ 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
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 -->
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 -->
Disable motion and blinking carets only during Pixel captures, mask native media controls, and exclude two duplicate snapshots whose Chromium border rasterization remains nondeterministic.

Validated with two complete 337-snapshot Pixel captures producing identical hashes.

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

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=177.24 -->
Keep report body indentation and trailing spaces intact so indented code blocks and Markdown hard breaks render and copy exactly as reported.

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

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=177.24 -->
Construct the trailing spaces inside the test expression so whitespace preservation stays covered without leaving source-level trailing whitespace.

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

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=177.24 -->
Remove the broad Pixel-only motion override and duplicate snapshot exclusions that caused unrelated review churn. Upgrade Pixel to 0.2.2 so review entries include unique story names, while retaining only the native media-control mask.

Also preserve embedded title delimiters in valid subagent report envelopes.

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

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=177.24 -->
Keep Pixel 0.2.1 to avoid repository-wide display-name churn, but split the new report coverage into uniquely titled desktop and phone stories so both appear clearly in visual review.

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

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=183.66 -->
Drop the stale pre-rebase lockfile delta after rebasing the report presentation branch.

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

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=183.66 -->
@ammar-agent
ammar-agent force-pushed the feat/subagent-report-presentation branch from a9d31bb to 8cb7413 Compare July 22, 2026 16:14
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Rebased onto current main and narrowed the Pixel fix:

  • kept Pixel 0.2.1, avoiding repository-wide snapshot renames;
  • split report coverage into uniquely titled App/SubagentReports/Desktop and App/SubagentReports/Phone entries;
  • retained only the native media-control mask for the reproducible attachment flake;
  • removed broad animation overrides and snapshot exclusions;
  • added the requested embedded </title> parser coverage.

@codex review

@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: 8cb7413509

ℹ️ 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
Serialize report fields as JSON inside the existing mux_subagent_report wrapper so arbitrary Markdown, whitespace, and delimiter examples round-trip without ambiguity. Retain legacy envelope parsing for persisted transcripts.

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

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

Copy link
Copy Markdown
Collaborator Author

Addressed PRRT_kwDOPxxmWM6S-wKr in ee384ad2b7 by replacing delimiter-based field framing for new reports with JSON inside the existing <mux_subagent_report> wrapper. Arbitrary titles, Markdown, whitespace, root tags, and structured output now round-trip unambiguously; legacy persisted envelopes remain supported. Added shared round-trip and compatibility tests.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the unambiguous JSON report framing, legacy compatibility, and uniquely titled Pixel stories.

@mintlify

mintlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Mux 🟢 Ready View Preview Jul 22, 2026, 4:27 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Addressed PRRT_kwDOPxxmWM6S_LAP in ee384ad2b7: new reports now serialize all fields as JSON inside the existing outer wrapper, so a report body can contain the complete legacy title/report separator, root close tag, and structured-output delimiters without ambiguity. The legacy parser remains read-only compatibility for existing transcripts. Shared round-trip tests cover the exact separator sequence inside both title and Markdown.

@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: ee384ad2b7

ℹ️ 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/common/utils/subagentReportEnvelope.ts Outdated
Favor the first legacy title/report separator so historical report Markdown that documents the old protocol remains intact. New reports continue to use unambiguous JSON framing.

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

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

Copy link
Copy Markdown
Collaborator Author

Addressed PRRT_kwDOPxxmWM6S_Z7J: the read-only legacy parser now uses the first established title/report boundary, preserving historical report bodies that quote the old separator. New reports use JSON framing and remain fully unambiguous. Added a legacy regression test for the exact case.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review JSON framing for new reports, legacy compatibility, and uniquely titled Pixel entries.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 23b82f4dc4

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

Freeze motion and carets only during Pixel captures, render at 2x density, and exclude two duplicate stories with irreducible Chromium border rasterization. Two complete 337-shot captures produced identical hashes.

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

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=290.87 -->
Temporarily hide the new report stories and allow a manual auto-review build so the deterministic branch-wide Pixel state can be approved before generating the final report-only review.

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

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=290.87 -->
Remove temporary branch-baseline scaffolding and re-enable the uniquely titled desktop and phone subagent report snapshots.

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

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=290.87 -->
@ammario
ammario merged commit 58791eb into main Jul 22, 2026
20 of 21 checks passed
@ammario
ammario deleted the feat/subagent-report-presentation branch July 22, 2026 18:57
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.

2 participants