fix(cli): stop slash completion render loop#3533
Merged
Merged
Conversation
yiliang114
approved these changes
Apr 22, 2026
wenshao
approved these changes
Apr 23, 2026
wenshao
left a comment
Collaborator
There was a problem hiding this comment.
No issues found. LGTM! ✅ — gpt-5.4 via Qwen Code /review
TaimoorSiddiquiOfficial
pushed a commit
to TaimoorSiddiquiOfficial/HopCode
that referenced
this pull request
Apr 23, 2026
Port upstream QwenLM/qwen-code improvements to HopCode: fix(core): scope StreamingToolCallParser per stream (QwenLM#3516) - Add ConverterStreamContext interface with per-stream StreamingToolCallParser - Add createStreamContext() factory on OpenAIContentConverter - convertOpenAIChunkToGemini() now takes ctx as explicit arg - Drop shared streamingToolCallParser instance field and resetStreamingToolCalls() - ContentGenerationPipeline creates one context per stream entry - Update all tests to use createStreamContext() API - Fixes concurrent subagent streams corrupting each other (NO_RESPONSE_TEXT) feat(cli): combine elapsed + timeout in shell time indicator (QwenLM#3512) - formatters: add FormatDurationOptions with hideTrailingZeros option - ToolElapsedTime: accept optional timeoutMs; render (elapsed · timeout N) - ToolMessage: extract timeoutMs from AnsiOutputDisplay, feed to ToolElapsedTime - CompactToolGroupDisplay: add getShellTimeoutMs() helper, thread timeoutMs - AnsiOutput: drop timeoutMs from ShellStatsBarProps (now inline in elapsed) fix(cli): stabilize resume callback deps (QwenLM#3533) - Destructure historyManager into clearItems/loadHistory stable refs - Use hasHistoryManager boolean guard in useCallback dep array chore: bump version 0.14.41 -> 0.15.1 across all packages Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TaimoorSiddiquiOfficial
pushed a commit
to TaimoorSiddiquiOfficial/HopCode
that referenced
this pull request
Apr 23, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chiga0
pushed a commit
that referenced
this pull request
Apr 24, 2026
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Stabilize the
useResumeCommand()callback dependencies so slash-command argument completion no longer re-runs on every render. This fixes the interactive CLI crash where typing/modelcould get stuck on "Loading suggestions..." and repeatedly throwMaximum update depth exceeded.Screenshots / Video Demo
N/A — no permanent UI change. This PR fixes an interactive re-render loop in slash-command completion.
Dive Deeper
User-visible behavior
In the interactive CLI, typing a slash command that enters argument completion mode could trigger an infinite render loop. A concrete reproduction was:
/modelLoading suggestions...Maximum update depth exceededThis was easiest to hit when the command's
completion()returnednullor an empty array, because the completion flow kept re-running while also writing completion state back into React.Root cause
The loop was not caused by
modelCommanditself. The actual instability came fromuseResumeCommand().useResumeCommand()memoizedhandleResume()with the entirehistoryManagerobject in its dependency list.useHistory()returns a fresh object each render, even though its methods are individually stable. That meant:handleResume()got recreated every renderslashCommandActionsinAppContainerchanged every render because it depends onhandleResumecommandContextinslashCommandProcessorchanged every render because it depends onactionsuseSlashCompletion()treatscommandContextas an effect dependency, so argument completion re-fired every renderSo
/modelmerely exposed the bug because it enters slash argument completion and itscompletion()path was invoked over and over.Fix
This PR removes the unstable object dependency from
useResumeCommand():hasHistoryManageras a boolean guardclearItemsandloadHistoryfromhistoryManagerhistoryManagerobjectThis keeps
handleResume()referentially stable across normal renders, which in turn keepsslashCommandActions,commandContext, and slash completion stable.Reviewer Test Plan
/modeland then a space.Maximum update depth exceeded./resumestill works and restores prior session history.Good extra cases:
/model --/model --fastTesting Matrix
Linked issues / bugs
Related to the interactive slash-command completion render loop triggered by
/modelwhen command argument completion returned no suggestions.