-
Notifications
You must be signed in to change notification settings - Fork 78
feat: normal Actor tools cache #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements caching for normal Actor tools to optimize repeated actor definition retrievals. The changes include a new interface for cache entries, a caching mechanism using LruCache in the Actor tools module, and updates to constants and dependencies to support the new caching behavior.
- Introduced ToolCacheEntry interface in src/types.ts.
- Added LruCache-based caching in src/tools/actor.ts to reuse tool definitions.
- Updated getActorDefinition in src/mcp/actors.ts and added new caching constants.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Added ToolCacheEntry interface to define the caching data structure. |
| src/tools/actor.ts | Implemented caching for normal Actor tools using LruCache and updated logic. |
| src/mcp/actors.ts | Revised getActorDefinition to fetch the default build via actor.defaultBuild(). |
| src/const.ts | Added TOOL_CACHE_MAX_SIZE and TOOL_CACHE_TTL_SECS constants for the cache. |
| package.json | Added dependency for @apify/datastructures to support caching functionality. |
jirispilka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry but it is not good at the moment.
Co-authored-by: Jiří Spilka <jiri.spilka@apify.com>
integration test
jirispilka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
No description provided.