Skip to content

fix(memory): address code review feedback for auto-memory recall#3866

Merged
wenshao merged 5 commits into
QwenLM:mainfrom
B-A-M-N:fix/auto-memory-recall-fast-model-only
May 7, 2026
Merged

fix(memory): address code review feedback for auto-memory recall#3866
wenshao merged 5 commits into
QwenLM:mainfrom
B-A-M-N:fix/auto-memory-recall-fast-model-only

Conversation

@B-A-M-N

@B-A-M-N B-A-M-N commented May 6, 2026

Copy link
Copy Markdown
Contributor

Surgical fixes for auto-memory recall:

  • Reduced side-query timeout to 1s.
  • Switched to vi.resetAllMocks() in tests.
  • Confirmed fast model routing.

The model-driven relevance selector (selectRelevantAutoMemoryDocumentsByModel)
currently uses the main session model for its LLM call. Since this is a
background side-query that runs in parallel with the user's main request,
route it to config.getFastModel() instead — consistent with sessionRecap,
sessionTitle, toolUseSummary, and forkedAgent which all prefer the fast
model for background work.

When no fast model is configured, getFastModel() returns undefined and
runSideQuery falls back to config.getModel(), so behavior is unchanged
for users without a fast model set.

Co-Authored-By: Claude <noreply@anthropic.com>
@B-A-M-N B-A-M-N force-pushed the fix/auto-memory-recall-fast-model-only branch from eee67f1 to 4387f95 Compare May 6, 2026 23:32
* @param p - The path to expand.
* @returns The expanded path.
*/
export function expandHomeDir(p: string): string {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] This adds expandHomeDir() as a new exported core helper, but the existing CLI implementation in packages/cli/src/ui/commands/directoryCommand.tsx is still the only production call site. That leaves the new export unused while the same path-expansion behavior now exists in two places, so future changes to ~ or %userprofile% handling can drift and the API intent is unclear.

Either remove this new helper if it is not needed for the memory-recall fix, or complete the extraction by importing the core helper from the CLI command and deleting the local duplicate implementation.

— gpt-5.5 via Qwen Code /review

@wenshao wenshao left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. LGTM! ✅ — gpt-5.5 via Qwen Code /review

@wenshao wenshao merged commit 2528736 into QwenLM:main May 7, 2026
13 checks passed
TaimoorSiddiquiOfficial pushed a commit to TaimoorSiddiquiOfficial/HopCode that referenced this pull request May 8, 2026
…nLM#3866)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DragonnZhang pushed a commit that referenced this pull request May 8, 2026
* fix(memory): route auto-memory recall selector to fast model

The model-driven relevance selector (selectRelevantAutoMemoryDocumentsByModel)
currently uses the main session model for its LLM call. Since this is a
background side-query that runs in parallel with the user's main request,
route it to config.getFastModel() instead — consistent with sessionRecap,
sessionTitle, toolUseSummary, and forkedAgent which all prefer the fast
model for background work.

When no fast model is configured, getFastModel() returns undefined and
runSideQuery falls back to config.getModel(), so behavior is unchanged
for users without a fast model set.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(memory): address code review feedback for auto-memory recall

* fix(core): move expandHomeDir to core to resolve import errors in CLI

* test(memory): fix document path in mock to match test data

* test(core): add unit tests for expandHomeDir

---------

Co-authored-by: Claude <noreply@anthropic.com>
xaelistic pushed a commit to xaelistic/qwen-code that referenced this pull request Jun 7, 2026
…nLM#3866)

* fix(memory): route auto-memory recall selector to fast model

The model-driven relevance selector (selectRelevantAutoMemoryDocumentsByModel)
currently uses the main session model for its LLM call. Since this is a
background side-query that runs in parallel with the user's main request,
route it to config.getFastModel() instead — consistent with sessionRecap,
sessionTitle, toolUseSummary, and forkedAgent which all prefer the fast
model for background work.

When no fast model is configured, getFastModel() returns undefined and
runSideQuery falls back to config.getModel(), so behavior is unchanged
for users without a fast model set.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(memory): address code review feedback for auto-memory recall

* fix(core): move expandHomeDir to core to resolve import errors in CLI

* test(memory): fix document path in mock to match test data

* test(core): add unit tests for expandHomeDir

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants