Skip to content

feat(task): compose local and remote cache stores - #11622

Merged
jdx merged 3 commits into
agent/task-cache-protocolfrom
agent/task-cache-composite
Aug 3, 2026
Merged

jdx merged 3 commits into
agent/task-cache-protocolfrom
agent/task-cache-composite

Conversation

@jdx

@jdx jdx commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add a version-compatible composite task-cache store
  • read local entries first and promote remote hits into the local store
  • publish locally before mirroring entries remotely so local results survive remote write errors
  • cover artifact-bearing and result-only promotion and mirroring
  • mark the composite-store tracker item complete

Validation

  • cargo test --all-features composite_store_promotes_remote_hits_and_mirrors_writes -- --nocapture
  • cargo check --all-features
  • mise run lint-fix

AI-assisted — Tool: Codex; model: unavailable/unavailable; version: unavailable.


Note

Medium Risk
Changes cache hit/miss, expiry, and delete ordering on correctness-sensitive paths; remote is not enabled yet but composite semantics are exercised in tests.

Overview
Adds a composite task cache store that layers local and remote backends behind the existing TaskCacheStore trait, with compose_task_cache_stores wiring the artifact cache through local-only today (remote: None) until a remote implementation is plugged in.

Reads prefer the local store; on a remote hit, entries are promoted into local storage (resetting the local cache_max_age window). Failed promotion still returns the remote entry with a warning.

Writes commit locally first, then mirror manifest and artifact files to remote; remote mirror failures are warnings so local cache hits keep working.

Deletes run remote before local so a failed remote delete cannot resurrect an entry via promotion. remove_local (used when entries expire) drops only the local copy and can re-promote from remote if local removal fails or the remote copy is still valid.

Unit tests cover promotion, mirroring, result-only entries, and behavior when remote commit/remove fails. The parity tracker marks the composite-store item complete.

Reviewed by Cursor Bugbot for commit 53dd271. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: df27c5a3-9323-4a59-8327-7f93c4e99e19

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread src/task/task_cache_store.rs Resolved
Comment thread src/task/task_cache_store.rs Resolved
Comment thread src/task/task_cache_store.rs Resolved
@greptile-apps

greptile-apps Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR introduces a version-compatible composite task-cache store while retaining the local-only production configuration.

  • Reads prefer local entries and promote remote hits into local storage.
  • Writes commit locally before best-effort remote mirroring.
  • Local-only removal supports expiry without deleting remote entries.
  • Tests cover artifact and result-only entries plus remote-operation failure paths.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains within the eligible follow-up review scope.

Important Files Changed

Filename Overview
src/task/task_cache_store.rs Adds composite-store composition, local-first reads, remote promotion and mirroring, split removal semantics, and focused tests; no eligible follow-up defect was established.
src/task/task_cache.rs Routes store construction through the composition helper and changes expiry cleanup to local-only removal while still configuring no remote backend.
TASK_CACHE_PARITY.md Marks the composite local-and-remote cache-store tracker item complete.

Reviews (9): Last reviewed commit: "fix(task): recover failed local cache ev..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
env ▃▆▂▁▁▂▅▄▅█ 80,074,952 → 80,123,934 +0.06% 17.64 → 17.72ms +0.41%
hook-env ▅▅▁▃▂▂▄▃▄█ 82,190,914 → 82,318,696 +0.16% 18.34 → 18.33ms -0.03%
ls ▅▄▁▁▁▇▆▇▆█ 73,127,800 → 73,173,002 +0.06% 15.71 → 16.02ms +1.97%
registry ▁▁▂▁▂▄▃▅▂█ 49,102,713 → 49,277,737 +0.36% 11.64 → 12.41ms +6.61%
startup ▃▃▁▃▂▁▂▂▃█ 15,784,751 → 15,823,388 +0.24% 9.04 → 9.42ms +4.16%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

53dd2713038e vs e5230aa14775 · measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the agent/task-cache-composite branch from 2e5bccf to cb9ddc7 Compare August 2, 2026 02:57
Comment thread src/task/task_cache_store.rs Resolved
Comment thread src/task/task_cache_store.rs Resolved
@jdx
jdx force-pushed the agent/task-cache-composite branch from cb9ddc7 to cce4928 Compare August 2, 2026 03:15
Comment thread src/task/task_cache_store.rs Resolved
@jdx
jdx force-pushed the agent/task-cache-composite branch from cce4928 to 35d52ba Compare August 2, 2026 03:17
@jdx
jdx force-pushed the agent/task-cache-composite branch from 35d52ba to 58eb836 Compare August 2, 2026 13:10
Comment thread src/task/task_cache_store.rs Resolved
@jdx
jdx force-pushed the agent/task-cache-composite branch from 58eb836 to 4ce7380 Compare August 2, 2026 15:18

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4ce7380. Configure here.

Comment thread src/task/task_cache.rs Resolved
@jdx
jdx force-pushed the agent/task-cache-composite branch 2 times, most recently from 7a62859 to 8e8b0a0 Compare August 2, 2026 17:33
@jdx
jdx force-pushed the agent/task-cache-composite branch from 8e8b0a0 to 53dd271 Compare August 2, 2026 18:18
@jdx
jdx merged commit c3b16a9 into main Aug 3, 2026
39 of 56 checks passed
@jdx
jdx deleted the agent/task-cache-composite branch August 3, 2026 03:04
donbeave pushed a commit to donbeave/mise that referenced this pull request Aug 3, 2026
## Summary
- add a version-compatible composite task-cache store
- read local entries first and promote remote hits into the local store
- publish locally before mirroring entries remotely so local results
survive remote write errors
- cover artifact-bearing and result-only promotion and mirroring
- mark the composite-store tracker item complete

## Validation
- `cargo test --all-features
composite_store_promotes_remote_hits_and_mirrors_writes -- --nocapture`
- `cargo check --all-features`
- `mise run lint-fix`

*AI-assisted — Tool: Codex; model: unavailable/unavailable; version:
unavailable.*

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes cache hit/miss, expiry, and delete ordering on
correctness-sensitive paths; remote is not enabled yet but composite
semantics are exercised in tests.
> 
> **Overview**
> Adds a **composite task cache store** that layers local and remote
backends behind the existing `TaskCacheStore` trait, with
`compose_task_cache_stores` wiring the artifact cache through local-only
today (`remote: None`) until a remote implementation is plugged in.
> 
> **Reads** prefer the local store; on a remote hit, entries are
**promoted** into local storage (resetting the local `cache_max_age`
window). Failed promotion still returns the remote entry with a warning.
> 
> **Writes** commit locally first, then **mirror** manifest and artifact
files to remote; remote mirror failures are warnings so local cache hits
keep working.
> 
> **Deletes** run remote before local so a failed remote delete cannot
resurrect an entry via promotion. **`remove_local`** (used when entries
expire) drops only the local copy and can **re-promote** from remote if
local removal fails or the remote copy is still valid.
> 
> Unit tests cover promotion, mirroring, result-only entries, and
behavior when remote commit/remove fails. The parity tracker marks the
composite-store item complete.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
53dd271. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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