posit-dev / posit-dev/shinychat
Merge adjacent tool loops when suppressed thinking is the only separator
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 139
- Forks
- 28
- Avg merge
- 23h 44m
- Merged PRs (30d)
- 50
Description
Problem
show_thinking_after_s can suppress a short thinking block, but the hidden block still splits the surrounding tool calls into separate .shiny-chat-tool-loop elements.
The CSS now removes the visual gap between adjacent loops, but the separate loop boundaries still change tool grouping. Equivalent visible transcripts can therefore render differently:
- Two calls to the same tool in one loop are grouped together.
- Two calls to the same tool separated only by suppressed thinking appear in separate groups.
- Tool calls in adjacent loops with no rendered assistant thinking or text can also remain separate.
The rendered grouping should follow the content that the user can see, not a hidden thinking boundary.
Desired behavior
When thinking is suppressed, join the tool loops on either side before grouping and rendering them. More generally, coalesce adjacent tool loops when no rendered assistant thinking or content separates them.
Keep separate tool loops when visible thinking or assistant content appears between them.
Acceptance criteria
- Suppressed thinking does not split adjacent tool loops.
- Repeated calls to the same tool group the same way whether they originated in one loop or in loops separated only by suppressed thinking.
- Adjacent tool loops with no rendered assistant thinking or text are coalesced.
- Visible thinking keeps the surrounding tool loops separate.
- Visible assistant content keeps the surrounding tool loops separate.
- Tests cover thinking below and above the
show_thinking_after_sthreshold.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the tool-loop grouping and rendering entry point, then find the existing tests for show_thinking_after_s. Run those tests first and extend coverage so suppressed thinking and absent rendered content coalesce loops, while visible thinking or assistant content keeps them separate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100