gemini-cli - ✅(Solved) Fix feat(core): implement automatic response continuation for truncated responses [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#26157Fetched 2026-04-30 06:45:13
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
commented ×2cross-referenced ×1labeled ×1mentioned ×1

Fix Action

Fixed

PR fix notes

PR #26159: feat(core): implement continuation auto-recovery

Description (problem / solution / changelog)

Fixes #26157

Changed files

  • packages/core/src/agent/event-translator.ts (modified, +30/-16)
  • packages/core/src/agent/legacy-agent-session.test.ts (modified, +155/-0)
  • packages/core/src/agent/legacy-agent-session.ts (modified, +36/-3)
  • packages/core/src/agent/types.ts (modified, +4/-0)
RAW_BUFFERClick to expand / collapse

Legacy agent sessions should automatically detect responses truncated by token limits (finishReason: MAX_TOKENS) and prompt the model to continue, maintaining full conversation context.

extent analysis

TL;DR

Modify the legacy agent sessions to handle finishReason: MAX_TOKENS and prompt the model to continue the conversation.

Guidance

  • Check the current implementation of legacy agent sessions to see how they handle response truncation due to token limits.
  • Investigate the finishReason: MAX_TOKENS condition and determine how to detect it in the legacy agent sessions.
  • Consider adding a retry mechanism or a continuation prompt to maintain the full conversation context when a response is truncated.
  • Review the conversation context management to ensure it can handle continued conversations without losing context.

Notes

The exact implementation details are not provided, so the guidance is focused on the general approach to handling truncated responses.

Recommendation

Apply workaround: Modify the legacy agent sessions to handle truncated responses and continue the conversation, as upgrading to a fixed version is not mentioned in the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING