google-gemini / google-gemini/gemini-cli
refactor(cli): decouple ToolGroupMessage from internal type guards and payload structures
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
### What happened?
The ToolGroupMessage UI component currently relies heavily on specific type guards (e.g., isFileDiff) and inspecting raw object shapes (summary, payload) to determine if a compact tool has a dense payload:
See [ToolGroupMessage.tsx](https://github.com/google-gemini/gemini-cli/blob/main/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx#L79-L81).
### What did you expect to happen?
Usage of type guards makes this UI class too aware of internals. This logic should be delegated to the result object itself (e.g., providing an explicit metadata property like hasDensePayload: true) or moved to a dedicated formatting/adapter layer so the UI component remains decoupled from how individual payloads are shaped internally.
### Client information
N/A - Tech Debt Cleanup
Contributor guide
Research direction
Start with packages/cli/src/ui/components/messages/ToolGroupMessage.tsx, especially lines 79-81, and trace how the component uses isFileDiff, summary, and payload to detect dense compact-tool output. The work is complete when this UI component no longer depends on those internal guards or raw payload shapes while preserving the existing dense-payload behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100