Repository navigation
Conversation
Signed-off-by: Yushu Li <eeyushuli@gmail.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Identity-aware eviction crates/libsy/src/algorithms/util/affinity.rs, crates/libsy/src/algorithms/composite.rs |
evict_if_full now checks whether the incoming identity already exists before evicting. Call sites pass the identity. Regression tests verify that updates preserve map capacity and other assignments. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Merge Risk: 
Minimal · up to f8b23
-
The change preserves retained sessions during updates. No merge-blocking issue is identified.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
A rabbit checks the map at night
An old identity stays in sight
No neighbor hops away
The count holds through the day
New sessions find their place just right
Comment @coderabbitai help to get the list of available commands.
What
I fixed retained-routing eviction in
AffinityRouterand the composite router'sTierSetter. The shared eviction helper now receives the incoming identity and makes room only when that identity is new.Why
With
classify_trigger = "user_turn", an existing session gets a new retained decision when the user speaks. At the 4096-entry limit, both maps previously evicted an unrelated session before overwriting the existing entry, leaving only 4095 entries.The lost affinity can send that other session's tool continuation back through the judge. A composite route can instead lose its retained tier and use its default. Updating an existing identity needs no additional slot; the cache limit and eviction behavior for new identities stay the same.
Notes for reviewers
4095 != 4096, and pass after it.Local checks passed on macOS arm64 with Rust 1.99.0 and Python 3.12:
cargo fmt --all --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo test --workspace --locked: 1131 passed, one existing ignored test.ruff check .andmypy switchyardmaturin develop --locked --uv, then ranpytest tests/ -v -m "not integration": 157 passed, two integration tests deselected.The local Rust binding checks used a PyO3 library-path override for the relocated Python runtime. No repository changes were needed for that setup.
I used AI assistance for implementation, regression tests, and local validation. No live model calls or paid services were used.
Summary by CodeRabbit