Skip to content

Conversation

@MQ37
Copy link
Contributor

@MQ37 MQ37 commented May 15, 2025

No description provided.

@MQ37 MQ37 requested a review from Copilot May 15, 2025 09:30
@github-actions github-actions bot added the t-ai Issues owned by the AI team. label May 15, 2025
Copy link
Contributor

Copilot AI left a 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.

@MQ37 MQ37 requested a review from jirispilka May 15, 2025 09:31
Copy link
Collaborator

@jirispilka jirispilka left a 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.

MQ37 and others added 2 commits May 16, 2025 12:47
Co-authored-by: Jiří Spilka <jiri.spilka@apify.com>
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label May 16, 2025
Copy link
Collaborator

@jirispilka jirispilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@MQ37 MQ37 merged commit 1a3ce16 into master May 19, 2025
2 checks passed
@MQ37 MQ37 deleted the feat/normal-actors-tool-cache branch May 19, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-ai Issues owned by the AI team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants