Skip to content

feat(coding-agent): allow thinking renderers to replace blocks#4669

Open
shoucandanghehe wants to merge 1 commit into
can1357:mainfrom
shoucandanghehe:feature/thinking-render-replace-clean
Open

feat(coding-agent): allow thinking renderers to replace blocks#4669
shoucandanghehe wants to merge 1 commit into
can1357:mainfrom
shoucandanghehe:feature/thinking-render-replace-clean

Conversation

@shoucandanghehe

Copy link
Copy Markdown
Contributor

Summary

Rerolls the assistant thinking renderer replacement API for #1728 against current main.

Thinking renderers now support:

  • Component: legacy append behavior below the default thinking Markdown.
  • { type: "append", component }: explicit append behavior.
  • { type: "replace", component }: suppresses the default thinking Markdown for that thinking block and renders the replacement component instead.

Details

  • Passes parent assistant metadata and provider thinking content metadata to renderers so async/stateful renderers can build stable keys without colliding across transcript history.
  • Keeps legacy component returns compatible by detecting TUI components before structured result objects.
  • Uses first-replacement-wins when multiple renderers try to replace the same thinking block, while preserving append renderers after replacements.
  • Preserves requestRender() semantics for both mounted async components and late undefined -> append/replace renderer output.
  • Keeps replacement-capable visible thinking blocks in the repaintable live region so late async replacement cannot leave stale raw thinking rows in native scrollback.
  • Updates extension docs and the coding-agent changelog.

Verification

bun test packages/coding-agent/test/modes/components/transcript-container.test.ts packages/coding-agent/test/modes/components/assistant-message-mermaid.test.ts
bun --cwd=packages/coding-agent run check:types
bun --cwd=packages/coding-agent run check:docs

Results:

  • 60 pass, 0 fail, 182 expect() calls
  • check:types passed
  • check:docs passed (Docs index fresh for 121 docs)

Closes #1728.

Previous stale PR: #2340.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@github-actions github-actions Bot added the vouched Passed the vouch gate label Jul 6, 2026
@roboomp roboomp added agent Agent runtime planning and orchestration feat review:p2 triaged tui Terminal UI rendering and display ux User experience improvements labels Jul 6, 2026

@roboomp roboomp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

P2: coherent implementation of the #1728 extension API shape, but it expands a public rendering contract, so this still needs the maintainer’s explicit merge call.

One should-fix: the packages/coding-agent/CHANGELOG.md entry is under released 15.11.3 instead of ## [Unreleased].

Verified locally: focused component tests passed (60 pass), bun --cwd=packages/coding-agent run check:types passed, and check:docs passed. Thanks for rerolling this against current main.

Comment thread packages/coding-agent/CHANGELOG.md Outdated
@shoucandanghehe shoucandanghehe force-pushed the feature/thinking-render-replace-clean branch from 0cff7d7 to 5882cdb Compare July 6, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Agent runtime planning and orchestration feat review:p2 triaged tui Terminal UI rendering and display ux User experience improvements vouched Passed the vouch gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow assistant thinking renderers to replace the default block

2 participants