Add targeted user cache patch on miss#269
Open
gkatz2 wants to merge 1 commit intokorotovsky:masterfrom
Open
Conversation
When a user ID is not in the in-memory cache, message rendering degrades to raw IDs and paramFormatUser fails the tool call entirely. This is common on Enterprise Grid workspaces where the user cache (50K+ users) can be hours stale. On cache miss, fetch the single user via users.info and patch the snapshot atomically. This costs one API call instead of rebuilding the entire user cache. Disk persistence is skipped; the next full refresh cycle handles it. Fixes korotovsky#268 Co-Authored-By: Claude Opus 4.6 (1M context) <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
users.info(O(1) API call) and patch the snapshot atomically, instead of showing raw IDs or failing the tool callparamFormatUser(search filters),convertMessagesFromHistory, andconvertMessagesFromSearch(message rendering)userResolverthat encapsulates cache lookup, on-demand fetch, and failed-lookup dedup for message batchesFixes #268
Test plan
PatchUser(success, API error, empty/nil result, snapshot immutability, overwrite)go build ./...passesmake testpasses (all existing + new tests)Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com