make add_route public#624
Merged
Merged
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes route mutation more usable and durable by exposing a public SemanticRouter.add_route() API and ensuring router configuration persists correctly across SemanticRouter.from_existing() reloads.
Changes:
- Add public
SemanticRouter.add_route(Route) -> strthat embeds references, writes to the index, updates in-memory routes, and persists{name}:route_config. - Persist
remove_route()changes by calling_update_router_state()after deleting the route’s indexed references. - Add integration tests for the public add API, duplicate-name errors, and add/remove persistence across reload; update
uv.lockto reflectredisvl0.20.0.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
redisvl/extensions/router/semantic.py |
Adds public add_route() and persists router config updates after remove_route(). |
tests/integration/test_semantic_router.py |
Adds integration coverage for add_route() and persistence across from_existing(). |
uv.lock |
Updates lockfile entries (including redisvl 0.20.0) and changes lockfile header revision. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nkanu17
approved these changes
Jun 9, 2026
Comment on lines
+556
to
+558
| self._add_routes([route]) | ||
| self._update_router_state() | ||
| return route.name |
|
🚀 PR was released in |
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.
This resolves #623