Repository navigation
Stop caching Realtime tool-choice matches for each response - #6085
Closed
markstuart-oai wants to merge 1 commit into
Closed
markstuart-oai wants to merge 1 commit into
markstuart-oai wants to merge 1 commit into
Conversation
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
Why: Each scoped Realtime response has been saving a list of tool matches, even for tools the app never checks. This PR has been removing that list and using the same rule when the app checks a tool. A response with no scope still inherits the session tools. A scoped response with no matches still denies all tools.
Test plan
The old and new Rust selectors have been returning the same results for 73 scoped and unscoped cases, including unknown names and MCP servers. With 128 tools and 16 checks that each scan the whole list, the local test took 36 µs before and 92 µs after. That's per response in the test, not the time for a model turn. All 111 patches applied and matched the new tree hash. The full SDK check stopped while building the native module. Without that module, the three SDK tool-choice tests and the global voice test failed at setup.
Issue number
No linked issue.
Checks