Skip to content

fix(core): ensure global directives are always loaded (fixes #issue_2196)#2197

Closed
sushilibdev wants to merge 3 commits intoQwenLM:mainfrom
sushilibdev:fix/hierarchical-memory-amnesia
Closed

fix(core): ensure global directives are always loaded (fixes #issue_2196)#2197
sushilibdev wants to merge 3 commits intoQwenLM:mainfrom
sushilibdev:fix/hierarchical-memory-amnesia

Conversation

@sushilibdev
Copy link
Copy Markdown

Currently, readMemoryFileContent only reads either global OR project directives based on a scope parameter. This causes an 'amnesia' effect where global instructions in |~/.qwen/QWEN.md` are ignored when working inside a project.

Changes:

  • Refactored readMemoryFileContent to aggregate content from both global and project paths.
  • Global directives are loaded first, followed by project-level directives.
  • Added safety checks to prevent duplicate reading if the project is in the home directory.

Tested on Termux environment. Fixes the issue where users had to manually remind the AI of global instructions.

@sushilibdev sushilibdev changed the title fix(core): ensure global directives are always loaded (fixes #issue_number) fix(core): ensure global directives are always loaded (fixes #issue_2196) Mar 8, 2026
@sushilibdev
Copy link
Copy Markdown
Author

Done! I've updated readMemoryFileContent to handle both global and project paths with proper error handling for ENOENT as suggested. Please let me know if there's anything else. Thanks!

@sushilibdev sushilibdev force-pushed the fix/hierarchical-memory-amnesia branch from 717b227 to 2d52c6b Compare March 9, 2026 07:14
@sushilibdev sushilibdev closed this Mar 9, 2026
@sushilibdev
Copy link
Copy Markdown
Author

I would like to close this Pull Request, because the issue has been resolved by the owner.

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