fix(cli): accept --glob as alias for --mask in collection add#664
Open
bzqzheng wants to merge 1 commit into
Open
fix(cli): accept --glob as alias for --mask in collection add#664bzqzheng wants to merge 1 commit into
bzqzheng wants to merge 1 commit into
Conversation
Tools such as OpenClaw pass --glob <pattern> to qmd collection add.
The flag was not registered, so it was silently ignored and the pattern
fell back to DEFAULT_GLOB (**/*.md). Both collections in the OpenClaw
boot sequence then got the same path + pattern, tripping the duplicate
guard and leaving memory-alt-{agentId} uncreated.
Register --glob alongside --mask and coalesce (mask ?? glob) at the
use site so both flags produce identical behaviour.
Fixes tobi#536.
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.
Problem
qmd collection add --glob <pattern>silently ignores the flag and falls back to**/*.md. Tools such as OpenClaw pass--globwhen registering per-agent memory collections on the same workspace path, causing the duplicate-path guard to fire and leaving collections uncreated — with a timeout on every subsequentmemory_searchcall.Root cause
The option parser only registered
--maskfor the glob pattern.--globwas unknown, soparseArgssilently discarded it (the parser runs withstrict: false). Both collections ended up with path +**/*.md, matching the(path, pattern)uniqueness check and exiting 1.Fix
globalongsidemaskin the option table(mask ?? glob)at thecollection adduse sitecollection helpto surface--globin the usage lineTest Plan
bun test --preload ./src/test-preload.ts test/cli.test.ts -t "CLI Add Command"CI=true bun test --timeout 60000 --preload ./src/test-preload.ts test/— 820 passCI=true npx vitest run --reporter=verbose --testTimeout 60000 test/— 820 passnpm run test:typesgit diff --checkFixes #536.