Cache Anthropic capabilities and defer compaction lookup - #184
Open
Anteriousis wants to merge 1 commit into
Open
Cache Anthropic capabilities and defer compaction lookup#184Anteriousis wants to merge 1 commit into
Anteriousis 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.
Reuse Anthropic model output capabilities across user turns through a parent-process cache (64 entries, five-minute TTL), scoped to model, endpoint and authentication identity. Child processes receive validated cached values and report successful lookups back to the parent. Credentials are hashed in cache identity and excluded from capability events.
A distinct compaction model is now resolved only when compaction is needed. Short successful turns avoid that lookup entirely; warm turns also avoid the primary lookup. Model-reported maximum output and older-SDK fallback behavior remain intact. Failed lookups and older-SDK fallback values are not cached.
Verification
With local test dependencies on PYTHONPATH, $python denotes the bundled Python executable:
Tests exercise new provider instances, endpoint/model/auth changes, TTL expiry without sliding refresh, bounded size, failed/invalid metadata, lazy compaction and existing maximum-output/older-SDK behavior. Provider and CAD boundaries are mocked; no paid API calls or full FreeCAD GUI/C++ build were run.
Capabilities may remain stale for up to five minutes. Concurrent cold turns may each retrieve metadata; no cross-process shared disk cache or request coalescing is introduced.
Compatibility
Issues
Closes #178.
Before and After Images
Not applicable; no GUI changes.