Conversation
Merge dev into main
* Skip lint when knowledge base has no indexed documents
Extract core logic from CLI commands into reusable functions (print_status, print_list, run_lint) so the chat REPL can call them directly instead of duplicating code. /add uses asyncio.to_thread since _add_single_file internally calls asyncio.run which cannot be nested.
- Rename _add_single_file → add_single_file (public API, consistent with print_status/print_list/run_lint already being public) - Add progress counter [i/total] for /add when processing directories - Move `import asyncio` to module-level imports in chat.py - Add 12 tests covering all new slash commands in _handle_slash
When users type /add '/path/to file' the quotes were included as part of the path, causing "Path does not exist" errors. Now single and double quotes wrapping the argument are stripped.
- Tab on / prefix completes slash commands (/status, /list, etc.) - Tab after /add completes file paths with expanduser support - Handles quoted paths (strips leading quote before path completion)
Store prompt history in .openkb/chat_history so users can press up/down arrows to recall previous inputs across chat sessions.
- Show command descriptions next to completions (e.g. /status → "Show knowledge base status") - Switch completion display to MULTI_COLUMN (zsh-like, listed below the prompt instead of a dropdown menu)
- Filter out dotfiles from /add path completion unless the user explicitly types a dot prefix (e.g. /add ./. will show dotfiles) - Restyle completion menu: transparent background, subtle text colors, no heavy inverted bar
Disable complete_while_typing so completions only appear on Tab press. Subsequent Tabs cycle through candidates, like zsh.
Custom key bindings so that: - Tab with no menu open: trigger completion - Arrow keys: navigate candidates in the menu - Tab with menu open: accept current selection and insert
Guard against current_completion being None when the menu is open but no item is highlighted. Falls back to selecting the first item.
When only one candidate matches, Tab inserts it directly without requiring arrow key selection first.
- Restore underscore in test_add_single_file_calls_helper (accidental removal during _add_single_file rename) - Catch KeyboardInterrupt around _handle_slash so Ctrl-C during /add or /lint aborts the command instead of triggering the exit prompt - Add test for Ctrl-C behavior during slash command execution
- Append closing quote for file completions so quotes stay paired - Skip closing quote for directory completions to allow continued navigation - Fallback strip unmatched leading quote in _handle_slash
feat: Add slash commands to chat REPL
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
Sync
mainback intodev.mainis ahead by 17 commits (PR #20 slash commands, PR #21 lint skip bugfix, and the PR #19 merge commit).Test plan