fix: platform-aware session hooks and auto-memory for Qwen Code#370
Open
btxbtxbtx wants to merge 1 commit intomksglu:nextfrom
Open
fix: platform-aware session hooks and auto-memory for Qwen Code#370btxbtxbtx wants to merge 1 commit intomksglu:nextfrom
btxbtxbtx wants to merge 1 commit intomksglu:nextfrom
Conversation
Owner
|
Hi @btxbtxbtx Let's sure 14 Adaptors is works now not just Qwen Code. Thanks. |
# Conflicts: # cli.bundle.mjs # server.bundle.mjs
22f4859 to
cc7e342
Compare
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.
Summary
v1.0.100 introduced session continuity (compact/resume) and auto-memory search, but these features were hardcoded to Claude Code conventions — Qwen Code users got no benefit. This PR makes the hook layer and auto-memory platform-aware.
Changes
1.
hooks/session-helpers.mjs— Add QWEN_OPTS + detectPlatform()QWEN_OPTSwith.qwenconfig dir,QWEN_PROJECT_DIR,QWEN_SESSION_IDdetectPlatform()function that auto-detects the running platform from env vars2.
hooks/sessionstart.mjs— Platform-aware startupdetectPlatform()to get correct env vars and config pathsQWEN.mdinstead ofCLAUDE.mdwhen running under Qwen CodeQWEN_PROJECT_DIR/QWEN_PLUGIN_ROOTinstead of hardcodedCLAUDE_*3.
hooks/precompact.mjs— Platform-aware config dirdetectPlatform()for correctresolveConfigDir()andgetSessionDBPath()4.
hooks/posttooluse.mjs— Platform-aware session DBdetectPlatform()for correctgetSessionDBPath()andgetInputProjectDir()5.
src/search/auto-memory.ts— Scan both CLAUDE.md and QWEN.mdmemoryFileNamesparameter (default:["CLAUDE.md", "QWEN.md"])6.
src/server.ts— Adapter-aware configDir_detectedAdapter.getSettingsPath()to derive config dir when adapter is availableCLAUDE_CONFIG_DIR/~/.claudefor unknown platformsTest results