Skip to content

feat: add task caching support#243

Closed
thalesraymond wants to merge 1 commit intomainfrom
feat-task-caching-467948463945241517
Closed

feat: add task caching support#243
thalesraymond wants to merge 1 commit intomainfrom
feat-task-caching-467948463945241517

Conversation

@thalesraymond
Copy link
Copy Markdown
Owner

Implemented task caching to skip execution of already completed tasks when using identical inputs. Added ICacheProvider, MemoryCacheProvider, and CachingExecutionStrategy. OpenSpec feat-task-caching is archived and verified with extensive tests.


PR created automatically by Jules for task 467948463945241517 started by @thalesraymond

- Define `ICacheProvider` interface
- Implement `MemoryCacheProvider`
- Update `TaskStep` to include `cache` config
- Create `CachingExecutionStrategy` wrapper
- Update `TaskRunner` to configure and use caching
- Add unit and integration tests
- Archive OpenSpec for `feat-task-caching`

Co-authored-by: thalesraymond <32554150+thalesraymond@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 3, 2026

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements a task caching mechanism by introducing an ICacheProvider interface, a MemoryCacheProvider with TTL support, and a CachingExecutionStrategy. The TaskRunner now supports cache providers, and TaskStep includes optional cache configurations. Feedback suggests replacing direct Date.now() calls in the cache provider with an injectable time provider to enhance testability.

return undefined;
}

if (entry.expiresAt !== undefined && Date.now() > entry.expiresAt) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using Date.now() directly in the logic makes the code harder to test and potentially inconsistent. Consider injecting a clock or using a time provider to improve testability and maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant