Skip to content

Sync main into dev#23

Merged
rejojer merged 17 commits intodevfrom
main
Apr 13, 2026
Merged

Sync main into dev#23
rejojer merged 17 commits intodevfrom
main

Conversation

@rejojer
Copy link
Copy Markdown
Member

@rejojer rejojer commented Apr 13, 2026

Summary

Sync main back into dev. main is ahead by 17 commits (PR #20 slash commands, PR #21 lint skip bugfix, and the PR #19 merge commit).

Test plan

rejojer and others added 17 commits April 12, 2026 00:48
* 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
@rejojer rejojer merged commit c553321 into dev Apr 13, 2026
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.

2 participants