google-gemini / google-gemini/gemini-cli

refactor(cli): decouple useGeminiStream from lookahead logic for parallel agents

Open
#28,258 1 comment 0 reactions 0 assignees View on GitHub
area/extensions effort/large kind/bug priority/p2 status/bot-triaged
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.