fix(pi-extension): use search --list flag for CLI v0.3.x compatibility#171
Open
wooksong wants to merge 2 commits into
Open
fix(pi-extension): use search --list flag for CLI v0.3.x compatibility#171wooksong wants to merge 2 commits into
wooksong wants to merge 2 commits into
Conversation
CLI v0.3.x changed memex search (no query) from listing all cards to showing guidance/help text. Listing all cards now requires --list flag. This broke three integration points in the Pi extension: - memex_recall fallback (when no index card exists) - memex_search tool (when called with no query) - /memex command (card count was based on wrong output) All three now pass --list when query is empty. Also adds defensive usage text detection in memex_recall as safety net against future CLI changes. This caused the confusing "No query provided. To search your knowledge base..." message to appear in every Pi session start.
Verify the exact CLI commands the Pi extension issues, ensuring CLI behavior changes dont silently break the extension: - memex_recall (no query): read index → fallback search --list - memex_search (no query): search --list - /memex command: search --list returns card count 6 tests covering: index hit, index miss fallback, fresh memory, search --list listing, search with query, and card count pattern. Regression protection against the v0.3.x CLI change where memex search (no args) changed from listing cards to showing guidance text.
c2c6036 to
055de23
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.
Problem
memex CLI v0.3.x changed the behavior of
memex search(no args): it now returns guidance text ("No query provided. To search your knowledge base...") instead of listing all cards.The Pi extension was calling
memex searchwithout--list, which broke three workflows:memex_recallwith no query — fallback path afterread indexfailed showed CLI help text instead of card listingmemex_searchwith no query — tool docs say "Omit query to list all cards" but returned guidance text/memexslash command — showed card count fromsearchoutput, broken by guidance textFix
Added
--listflag to all threememex searchcalls inpi-extension/index.ts. Also added defensive detection of CLI usage-text inmemex_recallto handle future CLI changes gracefully.Tests
Added
tests/pi-extension/cli-patterns.test.tswith 6 integration tests verifying the exact CLI call patterns the Pi extension relies on:memex_recall: read index → fallback search --listmemex_search(no query): search --list/memexcommand: card count from search --list outputFull test suite passes (774 tests, 40 files).