Skip to content

refactor(cache): generalize remote action protocol - #11763

Merged
jdx merged 1 commit into
mainfrom
agent/cache-action-protocol
Aug 8, 2026
Merged

jdx merged 1 commit into
mainfrom
agent/cache-action-protocol

Conversation

@jdx

@jdx jdx commented Aug 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • generalize the experimental version 1 task-cache contract into a typed action/CAS protocol without changing its unpublished protocol number
  • add task-scoped rust_cache = true configuration, accepting both booleans and option tables so Rust-specific settings can grow without another migration
  • support [task_config] defaults, cascading, templates, and explicit rust_cache = false overrides
  • place remote policy under [settings.task.cache] and the MISE_TASK_CACHE_REMOTE_* environment variables
  • preserve the former flat experimental remote-setting names as hidden compatibility aliases while preferring nested values
  • support nested generated settings/schema/docs groups and document in-process task sessions and read-only local behavior
  • redact the nested remote token from settings output

Validation

  • cargo test --quiet task_rust_cache
  • cargo test --quiet task_config_rust_cache
  • cargo test --quiet test_parses_all_fields
  • cargo test --quiet task_cache_store
  • mise run docs:build
  • mise run format

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


Note

Medium Risk
Touches experimental remote cache wire format, settings migration/aliases, and build-time settings codegen; misconfiguration or server mismatch could break CI caching, but behavior is largely gated behind experimental flags and compatibility shims.

Overview
This PR reframes the experimental remote cache as a shared build/action-cache protocol (still v1) and wires mise’s client, settings, schemas, and docs to match.

Remote cache & settings: Remote policy moves from flat task.cache_remote_* keys to [settings.task.cache] (same MISE_TASK_CACHE_REMOTE_* env vars). Old names remain as hidden deprecated aliases that map into the nested struct when the new key is unset. Codegen in build.rs now emits arbitrarily nested settings structs, metadata paths like task.cache.remote_url, and docs/schema trees; mise settings ls JSON/TOML output nests by path. Shared CacheRemoteMode and CacheDigest live in src/cache.rs; the HTTP client drops the signed action-result envelope, uses lowercase mise-cache-* headers, typed action/metadata kind, and BLAKE3 action-result keys.

Tasks: New experimental rust_cache on tasks (boolean or { enabled }), plus task_config.rust_cache defaults, cascade, and templates—with explicit false overriding inherited defaults. Task cache key material gains a kind: "task" action descriptor aligned with the generalized protocol.

Docs & tests: Remote cache protocol doc becomes “Remote Build Cache Protocol”; task configuration documents rust_cache and nested remote settings. E2E and compat scripts updated for nested settings and protocol shape.

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

@jdx jdx changed the title agent/cache action protocol refactor(cache): generalize remote action protocol Aug 7, 2026
Comment thread src/task/task_cache.rs Resolved
@greptile-apps

greptile-apps Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR generalizes the experimental task-cache contract into a typed action/CAS protocol and introduces nested remote-cache policy plus task-scoped Rust cache configuration.

  • Adds recursive generation and presentation of nested settings, including compatibility aliases and token redaction.
  • Adds boolean/table rust_cache configuration with task defaults, cascading, templates, and explicit overrides.
  • Updates the remote-cache implementation, protocol documentation, schemas, compatibility script, and focused tests.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
src/task/task_cache_store.rs Generalizes the remote task-cache wire implementation around typed actions and shared cache primitives; no eligible follow-up finding was identified.
src/task/mod.rs Adds bool-or-table Rust cache configuration while preserving explicit false values through task merging.
src/config/mod.rs Applies task-scoped Rust cache defaults and cascade precedence without overriding explicit task values.
src/config/settings.rs Resolves nested remote-cache settings while retaining legacy compatibility aliases and redacting token values.
build.rs Extends settings code generation recursively with collision-resistant nested Rust type names and recursive metadata emission.
docs/tasks/remote-cache-protocol.md Documents the generalized typed action/CAS protocol and its revised capability, digest, and result contracts.
settings.toml Moves remote-cache policy into the nested task.cache group and retains hidden legacy aliases.
xtasks/render/schema.ts Extends schema rendering to support arbitrarily nested settings groups.

Reviews (15): Last reviewed commit: "refactor(cache): generalize remote actio..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
env ▆▇▇▆▇▆█▇▆█▇▆▇▇▇▇█▁ 75,889,848 → 75,573,243 -0.42% 17.54 → 18.25ms +4.09%
hook-env ▃▅▄▄▅▄▅▅▅▅▅█▆▅▆▅▄▁ 77,303,619 → 77,178,775 -0.16% 18.14 → 18.58ms +2.43%
ls ▅██▆▇▆██▇█▇▆█▇▇█▇▁ 68,635,970 → 68,360,671 -0.40% 15.87 → 16.42ms +3.48%
registry ▆▄▅▅▆▄▆▇▆██▆▂▃▃▃▃▁ 48,710,962 → 48,670,510 -0.08% 12.34 → 11.63ms -5.73%
startup ▆▇█▆▆▆▆▇▆▇██▇▇▇█▇▁ 15,429,287 → 15,334,366 -0.62% 9.55 → 9.26ms -2.97%

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.

8a025ede0902 vs b368e7464832 · measured on the runner, not pushed to the history.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The remote cache protocol now supports typed build actions and version 2 endpoints. Remote cache settings move into nested task.cache configuration. Task and configuration models support Rust and Go action-cache adapters. Task cache keys and metadata identify task actions.

Changes

Remote build cache

Layer / File(s) Summary
Version 2 cache protocol
docs/tasks/remote-cache-protocol.md, docs/public/llms.txt
The protocol defines typed actions, version 2 endpoints, direct action results, digest rules, metadata validation, and authorization requirements.
Recursive settings generation
build.rs, schema/mise-settings.json, xtasks/render/schema.ts, docs/settings.data.ts
Settings generation and schema rendering now support recursively nested TOML settings and dotted metadata paths.
Shared cache configuration
settings.toml, schema/mise.json, src/cache.rs, src/config/settings.rs, e2e/tasks/test_task_artifact_cache_remote_modes
Remote cache settings use nested task.cache.remote_* names. Shared remote modes and digest validation are defined. Redaction, schemas, environment metadata, and fixtures use the new settings.
Task action configuration
src/task/mod.rs, src/task/task_template.rs, src/config/config_file/mod.rs, src/config/mod.rs, schema/mise-task.json, docs/tasks/task-configuration.md
Tasks, templates, and scoped configuration support deduplicated rust and go cache-action adapters. Defaults inherit unless a task provides an explicit value.
Task cache key and store integration
src/task/task_cache.rs, src/task/task_cache_store.rs
Task keys separate cache and action versions. Manifests preserve action keys. The remote store validates task metadata and uses version 2 direct-result HTTP transport.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • jdx/mise#11340: Both changes extend task cache-key material in src/task/task_cache.rs.
  • jdx/mise#11595: Both changes extend task cache key generation and explanations.
  • jdx/mise#11653: Both changes update remote-cache authentication and OIDC settings.

Poem

A rabbit sorts the action keys,
Through nested paths and cache trees.
Rust and Go hop into line,
Version two results align.
Direct blobs cross moonlit skies.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: generalizing the remote cache action protocol.

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.

@jdx
jdx force-pushed the agent/cache-action-protocol branch 2 times, most recently from efaa429 to e3a1c18 Compare August 7, 2026 22:05

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/tasks/remote-cache-protocol.md (1)

78-96: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Define the capability for supported action kinds.

The protocol allows compiler and build-system kinds only when advertised. The capabilities response defines no field for supported action kinds, action schema versions, or kind-specific metadata versions. Add a normative capability field before clients send non-task actions.

Also applies to: 113-143

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/tasks/remote-cache-protocol.md` around lines 78 - 96, Extend the
capabilities response specification around GET /v2/capabilities to include a
normative field advertising supported action kinds, including compiler and
build-system kinds, along with their action schema and kind-specific metadata
versions. Define how clients must use this field before sending any non-task
action, and update the related capability examples and requirements
consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/tasks/remote-cache-protocol.md`:
- Line 210: Update commit validation to compare the action descriptor’s kind
with the client metadata kind, and reject the commit before publication when
they differ. Preserve the existing schema and reference-graph validation for
matching kinds, covering the related validation paths identified in the diff.
- Around line 68-74: Align the protocol documentation with the task client’s
action-result URL construction: either update the task cache flow around the
action-result URL builder to negotiate and pass the selected digest algorithm,
or explicitly require BLAKE3 for action-result keys and scope the SHA-256
allowance to object types that support it. Ensure the documented negotiation
rules match the implemented behavior.

In `@docs/tasks/task-configuration.md`:
- Line 711: Update the documentation text near “bearer token” to hyphenate the
compound modifier as “Kubernetes-projected service account tokens,” without
changing the surrounding meaning.

---

Outside diff comments:
In `@docs/tasks/remote-cache-protocol.md`:
- Around line 78-96: Extend the capabilities response specification around GET
/v2/capabilities to include a normative field advertising supported action
kinds, including compiler and build-system kinds, along with their action schema
and kind-specific metadata versions. Define how clients must use this field
before sending any non-task action, and update the related capability examples
and requirements consistently.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 9d3e76f1-2639-4adf-984c-326c0cb826ef

📥 Commits

Reviewing files that changed from the base of the PR and between afb8501 and e3a1c18.

📒 Files selected for processing (10)
  • docs/public/llms.txt
  • docs/tasks/remote-cache-protocol.md
  • docs/tasks/task-configuration.md
  • e2e/tasks/test_task_artifact_cache_remote_modes
  • schema/mise.json
  • settings.toml
  • src/cache.rs
  • src/task/mod.rs
  • src/task/task_cache.rs
  • src/task/task_cache_store.rs
💤 Files with no reviewable changes (1)
  • src/task/mod.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • schema/mise.json
  • e2e/tasks/test_task_artifact_cache_remote_modes
  • src/task/task_cache.rs

Comment thread docs/tasks/remote-cache-protocol.md Resolved
Comment thread docs/tasks/remote-cache-protocol.md Resolved
Comment thread docs/tasks/task-configuration.md Resolved
@jdx
jdx force-pushed the agent/cache-action-protocol branch from e3a1c18 to 7bf823c Compare August 7, 2026 23:17
Comment thread src/config/settings.rs Resolved
@jdx
jdx force-pushed the agent/cache-action-protocol branch from 7bf823c to 4e7d039 Compare August 7, 2026 23:20
Comment thread src/config/mod.rs Resolved
Comment thread src/task/task_cache.rs Resolved
Comment thread settings.toml Resolved
@jdx
jdx force-pushed the agent/cache-action-protocol branch from 4e7d039 to 05ec75c Compare August 7, 2026 23:27

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
build.rs (1)

617-724: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Prevent generated struct-name collisions.

settings_struct_name removes component boundaries. Valid paths such as a.b_c and a_b.c both generate SettingsABC. The generated file then contains duplicate struct definitions and the build fails.

Encode each path component with an unambiguous boundary. Add a regression test with colliding PascalCase paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@build.rs` around lines 617 - 724, Update settings_struct_name to preserve
unambiguous boundaries between path components so distinct paths such as a.b_c
and a_b.c generate different struct names; keep the naming consistent for both
props_to_code and emit_nested_settings. Add a regression test covering colliding
PascalCase paths and verify the generated output contains unique struct
definitions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/tasks/remote-cache-protocol.md`:
- Around line 399-403: Update scripts/task-cache-remote-compat.sh to test
version 2 conformance rather than version 1: use the /v2 status, capabilities,
blob, and action-result endpoints; generate and validate BLAKE3 action-key
hashes; test direct action results; and add kind validation coverage while
preserving the existing compatibility checks.

In `@src/task/task_cache.rs`:
- Around line 140-142: Update TaskArtifactCache::store() and its callers so
observed action digests are collected during the task run and passed into
CacheManifest.action_keys instead of always constructing an empty Vec. Preserve
the existing serde default while ensuring cache_actions-enabled runs write the
collected keys for remote prefetch.

---

Outside diff comments:
In `@build.rs`:
- Around line 617-724: Update settings_struct_name to preserve unambiguous
boundaries between path components so distinct paths such as a.b_c and a_b.c
generate different struct names; keep the naming consistent for both
props_to_code and emit_nested_settings. Add a regression test covering colliding
PascalCase paths and verify the generated output contains unique struct
definitions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: e4b92324-49e7-4376-a7a4-a1e23d1e78ba

📥 Commits

Reviewing files that changed from the base of the PR and between e3a1c18 and 7bf823c.

📒 Files selected for processing (17)
  • build.rs
  • docs/tasks/remote-cache-protocol.md
  • docs/tasks/task-configuration.md
  • e2e/tasks/test_task_artifact_cache_remote_modes
  • schema/mise-settings.json
  • schema/mise-task.json
  • schema/mise.json
  • settings.toml
  • src/cache.rs
  • src/config/config_file/mod.rs
  • src/config/mod.rs
  • src/config/settings.rs
  • src/task/mod.rs
  • src/task/task_cache.rs
  • src/task/task_cache_store.rs
  • src/task/task_template.rs
  • xtasks/render/schema.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • e2e/tasks/test_task_artifact_cache_remote_modes
  • src/config/settings.rs

Comment thread docs/tasks/remote-cache-protocol.md Outdated
Comment on lines +399 to +403
The repository's compatibility suite is the executable definition of required version 2 behavior.
It must cover capability negotiation, canonical object validation, namespace isolation, independent
read/write authorization, missing-blob batches, streamed and resumable transfers, digest rejection,
atomic action-result commits, immutable conflicts, delegated-transfer credential isolation,
signatures, corruption handling, and retry semantics.
corruption handling, and retry semantics.

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.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

while IFS= read -r file; do
  echo "== $file =="
  rg -n '/v1/|protocol\.major == 1|algorithm:"sha256"|signatures|\.result' "$file"
done < <(fd -t f 'task-cache-remote-compat\.sh$' .)

Repository: jdx/mise

Length of output: 198


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files =="
git ls-files | rg '(^|/)docs/tasks/remote-cache-protocol\.md$|(^|/)scripts/task-cache-remote-compat\.sh$' || true

echo "== doc lines 360-420 =="
file="$(git ls-files | rg '(^|/)docs/tasks/remote-cache-protocol\.md$' | head -n1)"
sed -n '360,420p' "$file"

echo "== script outline/size =="
ws="$(git ls-files | rg '(^|/)scripts/task-cache-remote-compat\.sh$' | head -n1)"
[ -n "$ws" ] && { wc -l "$ws"; sed -n '60,175p' "$ws"; }

echo "== relevant v1/v2/version/key mentions across repo =="
rg -n 'protocol\.major|/v[0-9]|/v2/|/v1/|BLAKE|blake3|repository compatibility|remote-cache-protocol|task-cache-remote-compat|action-key|action_kind|result_envelope|Protocol Version 2' .

Repository: jdx/mise

Length of output: 50365


Update the repository compatibility suite before declaring it as version 2 conformance.

docs/tasks/remote-cache-protocol.md:399 says the repository compatibility suite defines required version 2 behavior, but scripts/task-cache-remote-compat.sh only tests protocol major version 1, uses /v1 status/capabilities/blob/action-result endpoints, and expects SHA-256 objects. Add or update the suite to cover the version 2 path, including BLAKE3 action-key hashes, direct action results, /v2 endpoints, and kind validation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/tasks/remote-cache-protocol.md` around lines 399 - 403, Update
scripts/task-cache-remote-compat.sh to test version 2 conformance rather than
version 1: use the /v2 status, capabilities, blob, and action-result endpoints;
generate and validate BLAKE3 action-key hashes; test direct action results; and
add kind validation coverage while preserving the existing compatibility checks.

Comment thread src/task/task_cache.rs Outdated
Comment on lines +140 to +142
/// Action keys observed while this task ran, used to predict the next session's prefetch set.
#[serde(default)]
pub(crate) action_keys: Vec<CacheDigest>,

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.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Search the repository for any writer of CacheManifest.action_keys other than the
# hardcoded Vec::new() in task_cache.rs, and any TaskArtifactCache::store() caller that could supply
# observed action-cache digests.

echo "--- occurrences of action_keys ---"
rg -n 'action_keys' --type=rust

echo "--- store() definition and callers ---"
ast-grep run --pattern 'async fn store($$$) { $$$ }' --lang rust src/task/task_cache.rs
rg -n '\.store\(' --type=rust -C3

echo "--- any rustc/go compiler wrapper / interception code ---"
rg -n -i 'rustc[_-]?wrapper|RUSTC_WRAPPER|compiler.?action|action.?adapter' --type=rust

Repository: jdx/mise

Length of output: 181


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "git status:"
git status --short

echo "--- list task files ---"
git ls-files | grep -E '(^|/)(task|cache).*\.(rs|toml|md|json)$|src/task|docs/tasks' | head -200

echo "--- locate task_cache.rs and task cache files ---"
fd -a 'task_cache\.rs|task.*cache|cache.*task' . | sed 's#^\./##' | head -100

echo "--- search action_keys in entire repo ---"
rg -n -i 'action_keys|actions.*cache|cache.*actions|TaskCacheKey|CacheManifest|CacheDigest|TaskArtifactCache|TaskCache' . --glob '!target/**' --glob '!node_modules/**' | head -300 || true

echo "--- broad store call context ---"
rg -n '\.?store\(' --type rust -C2 src || true

echo "--- broad rustc / go / compiler-related context ---"
rg -n -i 'RUSTC|rustc|compiler.?wrapper|action.?adapter|cache_actions|prefs|prefetch|manifest' . --glob '!target/**' --glob '!node_modules/**' | head -400 || true

Repository: jdx/mise

Length of output: 50364


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "--- task executor cache store call ---"
sed -n '820,875p' src/task/task_executor.rs

echo "--- task_cache.store definition and manifest construction ---"
sed -n '635,692p' src/task/task_cache.rs

echo "--- CacheManifest definition ---"
sed -n '120,150p' src/task/task_cache.rs

echo "--- cache_actions handling definitions ---"
sed -n '926,956p' docs/tasks/task-configuration.md
sed -n '1310,1365p' src/task/task_cache.rs
sed -n '204,216p' src/task/task_cache.rs
sed -n '2735,2750p' src/config/mod.rs

echo "--- exact Rust action_keys and store call count/context ---"
python3 - <<'PY'
from pathlib import Path
for p in Path('src').rglob('*.rs'):
    text=p.read_text(errors='replace').splitlines()
    for i,l in enumerate(text,1):
        if 'action_keys' in l or re.search(r'\bstore\s*\(', l):
            if 'store' in l.lower() or 'action_keys' in l:
                print(f"{p}:{i}:{l.rstrip()}")
PY

Repository: jdx/mise

Length of output: 9945


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "--- remaining task_cache action/cache keys references ---"
rg -n 'action|cache_actions|RUSTC|compiler' src task docs/tasks/task-configuration.md schema/mise-task.json --glob '!target/**' | head -300

echo "--- cache_actions enum and docs around remote session lifecycle ---"
sed -n '40,72p' src/task/task_cache.rs
sed -n '1248,1260p' docs/tasks/task-configuration.md
sed -n '220,245p' docs/tasks/remote-cache-protocol.md

echo "--- cache_actions references with context ---"
rg -n -C3 'cache_actions' src schema/mise-task.json docs/tasks/task-configuration.md docs/tasks/remote-cache-protocol.md | head -260

Repository: jdx/mise

Length of output: 22527


Wire action_keys populated data before writing manifests.

CacheManifest.action_keys documents observed action digests for prefetch, but TaskArtifactCache::store() always builds action_keys: Vec::new() and no caller passes observed digests. As written, runs with cache_actions enabled produce manifests with no previous-action keys for remote prefetch to use; update the manifest construction to populate observed action keys, or change the docs/API until that wiring exists.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/task/task_cache.rs` around lines 140 - 142, Update
TaskArtifactCache::store() and its callers so observed action digests are
collected during the task run and passed into CacheManifest.action_keys instead
of always constructing an empty Vec. Preserve the existing serde default while
ensuring cache_actions-enabled runs write the collected keys for remote
prefetch.

@jdx
jdx force-pushed the agent/cache-action-protocol branch 3 times, most recently from 1eee9d1 to c097811 Compare August 8, 2026 00:03
@jdx
jdx changed the base branch from main to agent/vfox-handle-http-read-count August 8, 2026 00:04
Base automatically changed from agent/vfox-handle-http-read-count to main August 8, 2026 00:34
@jdx
jdx force-pushed the agent/cache-action-protocol branch from c097811 to c828af6 Compare August 8, 2026 00:34
}
let metadata = envelope
.result
let metadata = result

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Legacy envelope breaks remote reads

Medium Severity

Remote cache GET handling now expects a flat action-result JSON body, but previously committed results used an envelope with a nested result (and optional signatures). Responses in the old shape no longer deserialize into the new type, so lookups can error instead of falling back to a cache miss when the server has not been upgraded in lockstep.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c828af6. Configure here.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This compatibility case does not apply here. The envelope shape existed only in this still-unmerged experimental stack, and there are no supported deployments that can have persisted it. The flat action-result body deliberately replaces that intermediate shape before the protocol ships, so accepting both would add permanent compatibility code for data that cannot exist in a released cache. The protocol therefore remains v1.

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

@jdx
jdx force-pushed the agent/cache-action-protocol branch 2 times, most recently from 4bf2396 to 59e57b3 Compare August 8, 2026 01:25
Comment thread scripts/task-cache-remote-compat.sh Resolved
@jdx
jdx force-pushed the agent/cache-action-protocol branch from 59e57b3 to db96bd5 Compare August 8, 2026 01:30

@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.

There are 2 total unresolved issues (including 1 from previous review).

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 db96bd5. Configure here.

Comment thread src/config/settings.rs Resolved
@jdx
jdx force-pushed the agent/cache-action-protocol branch from db96bd5 to 8a025ed Compare August 8, 2026 01:39
@jdx
jdx merged commit d821d59 into main Aug 8, 2026
32 checks passed
@jdx
jdx deleted the agent/cache-action-protocol branch August 8, 2026 02:07
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