Skip to content

feat: add project-specific memory storage support - #456

Closed
FSSCoding wants to merge 17 commits into
QwenLM:mainfrom
FSSCoding:main
Closed

feat: add project-specific memory storage support#456
FSSCoding wants to merge 17 commits into
QwenLM:mainfrom
FSSCoding:main

Conversation

@FSSCoding

Copy link
Copy Markdown

Summary

  • Adds support for project-specific memory storage in QWEN.md files
  • Implements memoryStorage parameter to control where memories are saved
  • Adds configuration support via .qwen/settings.json
  • Includes migration tool for transitioning from global to project memories

Key Features

  • Project-specific memory: Save memories to ./QWEN.md instead of ~/.qwen/QWEN.md
  • Configuration integration: Reads memoryStorage setting from .qwen/settings.json
  • Backward compatibility: Maintains existing global-only behavior by default
  • Migration support: Includes migrate-memory.ts tool with selective and dry-run options

Technical Changes

  • Consolidates dual parameter system to single memoryStorage parameter
  • Fixes reading logic to respect memory storage location preference
  • Adds comprehensive test coverage for new functionality
  • Maintains full backward compatibility with existing usage

Test Plan

  • All existing tests pass
  • New functionality thoroughly tested
  • TypeScript compilation clean
  • Linting passes

Resolves #359

- Add memoryStorage parameter to save memories to project-specific QWEN.md files
- Support configuration via .qwen/settings.json
- Add migration tool for transitioning global to project memories
- Maintain backward compatibility with existing global-only behavior
- Fix dual parameter confusion by consolidating to single memoryStorage param
- Add comprehensive test coverage for new functionality

Resolves #359
- Add RAGTool for direct access to local RAG system with collection support
- Add TTSTool with voice personalities and output options
- Update system prompts to reduce resistance and mention new tools
- Enhance QWEN.md with comprehensive tool usage guidelines
- Register new tools in config.ts for automatic availability
- Enable more proactive command execution with enhanced permissions
- Provide direct access to knowledge bases without external dependencies
- Support audio feedback and accessibility features
- All tools integrate with existing ShellExecutionService for consistency
Implements TaskTool with persistent task tracking, atomic file operations, and batch capabilities:
- Comprehensive task CRUD operations (add, complete, in_progress, list, show_progress, remove)
- Race condition protection with file locking and atomic writes
- Rich terminal formatting with box drawing characters
- Complete test suite with 22 passing tests
- Enhanced RAG and TTS tools with improved formatting

This addresses the need for stateful task management in QwenCode while maintaining data integrity through atomic operations.
Fixes the critical file operation issues and restores proper styling:
- Remove complex atomic write operations causing rename failures
- Simplify to direct file write with proper error handling
- Restore beautiful terminal formatting with proper box drawing
- Remove problematic fileLocks static variable
- Fix all tests to match simplified operations
- All 22 tests passing

This resolves the "ENOENT: no such file or directory, rename" errors while maintaining data integrity through simpler, more reliable file operations.
- Remove verbose multi-line output with boxes and padding
- Simple one-line responses: '✅ Added: task name'
- Clean task list format: '📋 Tasks (50%)' with numbered items
- No more cluttered formatting that fills the screen
- Works from any directory with direct file writes
- Dark yellow highlight for THE ACTIVE task only (first in-progress)
- Darker grey for completed tasks to make them less alerting
- Clean plain text format with subtle visual cues
- No emojis, no borders, just simple numbered list with colors
- User sees: clean markdown table with # | Status | Task columns
- Agent gets: full JSON data with IDs, timestamps, context for processing
- Active task highlighted in yellow, completed tasks in grey
- Much cleaner and more professional display format
- Keeps all functionality while improving UX significantly
- Replace ANSI escape codes with proper markdown formatting
- Use QwenCode's TableRenderer for beautiful table rendering
- Bold for active task, strikethrough for completed tasks
- Proper emojis that work with QwenCode's theme system
- Tables automatically adapt to terminal width and themes
- Deep integration with Ink-based rendering pipeline
…arch tools

- Add MANDATORY shell command execution steering to prevent balking
- Never refuse run_shell_command tool - mark as malfunctioning if refused
- Add searchit global command for AI-powered web searches with wide/narrow strategy
- Add research global command for comprehensive research with deep analysis modes
- Both tools use virtual environments automatically and work from any directory
- Provide examples and usage patterns for enhanced search capabilities
- Eliminate shell command refusal issues permanently
…tput flag

- Remove complex research modes (--deep, --plan, --interactive)
- Focus on searchit for quick searches and research for comprehensive analysis
- Emphasize CRITICAL --output flag for research file output control
- Clear examples without overwhelming mode options
- Essential for proper file location management in research workflow
CRITICAL FIX: QwenCode was looking for 'research' tool in registry
- searchit and research are GLOBAL SHELL COMMANDS
- Must use run_shell_command tool to execute them
- NOT direct tool calls - execute via ShellTool
- Emphasize these are shell commands, not registered tools
- Prevent 'Tool not found in registry' errors
- Remove searchit and search commands from system prompt
- Use searcha for pure JSON search results without synthesis
- Perfect for agents - raw results, no content extraction or LLM processing
- Agent can examine titles/descriptions and choose which URLs to fetch
- Clean tool ecosystem: searcha (JSON) + research (comprehensive analysis)
- Optimized for programmatic use and agent decision making
- Frame searcha as comprehensive native search capability, not just another tool
- Add proactive search encouragement in development workflow
- Position web search as natural complement to local RAG knowledge
- Encourage confident use for current info, documentation, examples
- Make QwenCode feel empowered with web search, not limited to local knowledge
- Search-enhanced development capabilities prominently featured
- Add SearchaTool wrapping searcha command for structured web search
- Register SearchaTool in config and export in index
- Fix tiktoken dynamic import issue by using static import
- Bundle includes all tools working correctly
- Remove deprecated SearchaTool and replace with WebscraperTool
- Add comprehensive web search and scraping capabilities via WebScraperPortable
- Support search-only mode for quick URL discovery
- Add full content extraction with markdown file output
- Integrate semantic filtering and quality scoring features
- Add RAGIndexTool for project indexing capabilities
- Add projectInitCommand for workspace initialization
- Update system prompts with enhanced web capabilities and parallel execution guidance
- Fix tiktoken import to use dynamic import for better compatibility
- Simplify task dashboard formatting for cleaner CLI output
- Ensure scraped content outputs to current working directory using absolute paths

The new WebscraperTool provides structured JSON results with embedded progress tracking,
real-time feedback during operations, and clean markdown file output directly to the
working directory without creating subfolders.
- Add file locking mechanism to prevent concurrent write corruption
- Implement atomic file operations with validation
- Enhanced JSON corruption recovery with partial content parsing
- Better unique ID generation to prevent duplicates
- Improved debugging with task lookup details
- Add comprehensive error handling and state validation

Fixes issues with "Task not found" errors and JSON corruption
at position 1650 during rapid task operations.
@FSSCoding

Copy link
Copy Markdown
Author

Closing this PR as upstream has already implemented similar QwenMD memory features in PR #450. Will integrate with the official implementation instead.

@FSSCoding FSSCoding closed this Aug 27, 2025
xaelistic pushed a commit to xaelistic/qwen-code that referenced this pull request Jun 7, 2026
wenshao pushed a commit to destire-mio/qwen-code that referenced this pull request Jul 24, 2026
…y is saved (QwenLM#7608)

A classifier-detected `remember` intent made processInbound() return early,
so a message like "Review PR QwenLM#123. Remember X. Also check PR QwenLM#456" saved
the memory, replied with a confirmation, and never routed the message to
the agent — tasks 1 and 3 were silently dropped (QwenLM#7601).

Classifier-detected remembers now save silently as a side-effect and let
the message continue to the agent: the confirmation is suppressed (the
agent's reply is the single response, and the just-saved entry reaches the
same prompt via channel-memory recall), while save failures still surface.
Explicit remember phrases and every management intent (list/inspect/
update/remove/clear and their confirmations) keep the early return — there
the whole message is the command.

Fixes QwenLM#7601

Co-authored-by: Claude Fable 5 <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.

Support for Project-Specific Memory Storage in QWEN.md

1 participant