feat(toolset): improve dedup with sparse reminders and canonical args#2372
Merged
sailist merged 2 commits intoMay 26, 2026
Merged
Conversation
Extract shared _do_new_session helper so /clear and /new reuse the same new-session logic.
- canonicalize tool arguments by sorting JSON keys for stable dedup keys\n- track consecutive repeat streaks across steps instead of single-step history\n- append gentle reminder only at 3rd consecutive repeat\n- append stronger detailed reminder at 5th and 8th repeats showing tool name, repeat count, and canonical args\n- update shell welcome tip to promote Kimi Code download link
e2bc3f5 to
fde829c
Compare
This was referenced May 27, 2026
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
This PR improves the tool call deduplication system with smarter repeat detection and sparse reminders, makes
/cleara true alias for/newin the shell UI, and updates the welcome tip.1. Tool Call Deduplication Improvements
Problem: The previous deduplication system appended a reminder on every cross-step duplicate call, which could be noisy. It also did not normalize JSON argument key order, causing identical calls with different key orderings to be treated as distinct.
What was done:
2. Shell UI Improvements
Problem:
/clearand/newhad overlapping but slightly different implementations.What was done:
_do_new_sessionhelper in shell slash commands/cleara proper alias for/newwith consistent session reset behaviorChecklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.