Repository navigation
feat: Smart Context plugin — topic bubbles + embedding-based context filtering - #45
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implement _compute_relevant_ids() and _on_pipeline_context() to filter pipeline chat history using cosine similarity against active topic embeddings. Sticky messages are always preserved; if nothing passes the threshold the full history is kept as a fallback. Adds 4 tests (17 total). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_mode Implements the three stub command methods and adds _emit_highlight_ids. set_filter updates active_topics and emits filter_changed; get_topics loads chat data via memory.load_chat; set_similarity_mode toggles embedding search and clears the filter when disabled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds .sc-highlight CSS class and two window event listeners in chat.js (setupSmartContextEventListeners) so Smart Context filter events visually highlight matching messages via a blue left-border accent. Also fixes a variable shadowing lint issue in panel.html (e -> err in catch handler). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ory_fallback tests The smart_context plugin registers a pipeline.output subscriber that spawns a background asyncio task (_run_topic_extraction) after every LLM response. In the test environment the memory plugin is live, so memory.load_chat succeeds and _run_topic_extraction proceeds to call LLMService.complete with the topic extraction prompt. This overwrites mock_instance.complete.call_args, making the test's assertion about which messages were sent to the chat completion call fail. Fix: patch _run_topic_extraction to a no-op AsyncMock on the smart_context plugin instance before the test's chat_send calls, so background extraction cannot consume mock calls or corrupt call_args. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e writes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
New files
example-vault/plugins/smart_context/main.pyexample-vault/plugins/smart_context/embedding_cache.py{msg_id}:{content_hash}example-vault/plugins/smart_context/panel.htmlModified files
sidecar/services/llm_service.pyembed()method via LiteLLMaembeddingsrc/vault/chat/chat.jssetupSmartContextEventListeners()for message highlightingsrc/styles/styles.css.sc-highlightclassexample-vault/.vault.tomlTest plan
pixi run test)🤖 Generated with Claude Code