fix(cli): memoize useHistory() return to avoid unnecessary re-renders#3547
Conversation
| @@ -0,0 +1 @@ | |||
| Subproject commit 4b9d30f7953273e567a18eb819f4eddd45fcc877 | |||
There was a problem hiding this comment.
[Critical] This PR adds a top-level claude-code gitlink (mode 160000) without a corresponding .gitmodules entry. Consumers cannot initialize or update it as a normal submodule because Git has no URL/path mapping, and the external repository reference appears unrelated to the useHistory() memoization change.
| Subproject commit 4b9d30f7953273e567a18eb819f4eddd45fcc877 |
— gpt-5.5 via Qwen Code /review
There was a problem hiding this comment.
Good catch — thanks. The claude-code gitlink was an accidental stray from a local reference directory; it has nothing to do with the useHistory() memoization fix. Dropped it via git rm --cached claude-code and force-pushed (8446cf8ac...9f2b3c01e), so the PR now only touches packages/cli/src/ui/hooks/useHistoryManager.ts.
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅ — gpt-5.5 via Qwen Code /review
Backport: gemini-cli#10820 — memoize useHistory() return
Motivation
Originated from QwenLM/qwen-code#3530: on 0.15.0, typing
/modelrepeatedly throwsMaximum update depth exceeded.While investigating, we found that upstream Gemini CLI had already fixed the same instability at the hook boundary ~6 months earlier. This repo missed the fix because the
Sync upstream Gemini-CLI v0.8.2 (#838)synced against a v0.8.2 tag cut from a commit that did not include it. This change backports it.Upstream PR Reference
google-gemini/gemini-cli#10820 —
Fix hooks to avoid unnecessary re-renderscd354aebe