google-gemini / google-gemini/gemini-cli
refactor(cli): decouple useGeminiStream from lookahead logic for parallel agents
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
### What happened?
The useGeminiStream hook currently implements a tactical UI lookahead fix to prevent parallel agents from tearing visually when they finish at slightly different times.
See [useGeminiStream.ts](https://github.com/google-gemini/gemini-cli/blob/main/packages/cli/src/ui/hooks/useGeminiStream.ts#L454-L459).
### What did you expect to happen?
Architecturally, useGeminiStream should not be responsible for stitching together semantic batches using timing/refs.
packages/core should be refactored to emit structured ToolBatch or Turn objects. The UI layer should simply render those semantic boundaries without having to implement complex lookahead logic to identify contiguous agents in the same batch.
### Client information
N/A - Architectural Refactoring
Contributor guide
Research direction
Start with packages/cli/src/ui/hooks/useGeminiStream.ts, especially the lookahead logic at lines 454-459, and trace how packages/core currently represents parallel-agent output. Determine the structured ToolBatch or Turn boundaries needed from core. Done means the UI renders those semantic boundaries without timing/ref-based lookahead logic for contiguous agents.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, cli
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100