Repository navigation
Keep the memory store in S3 instead of the Actions cache - #6
Merged
Merged
Conversation
A cache entry saved by a pull request run is visible only to that pull request, so a scheduled job on the default branch, and every other pull request, never saw what an agent learned. The cache also evicts whatever has not been read lately once it fills, which in CVector-Energy/ui happens within a day. The store now lives under <owner>/<repo>/memory/ in a bucket the caller names, reached through a role assumed with the job's OIDC token inside the action, so the agent does not inherit the credentials. The save writes back only what the run changed relative to what it restored, skips a deletion another run has since overtaken, merges MEMORY.md line by line when two runs both edited it, and saves nothing when the store directory is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Actions cache can't hold a store that every run shares:
PR Review Responserun on a pull request, so the weekly Skill Refinement run onmainand every other pull request were unable to restore it.What changes
bucketandrole-to-assume, plus optionalaws-region(defaultus-east-1). The store is kept under<owner>/<repo>/memory/.id-token: write), and never exports the credentials, so the agent step does not inherit them.MEMORY.mdline by line when two runs both changed it.memory/folder mid-session, and syncing a missing folder would delete every memory.@actions/cacheis replaced by@aws-sdk/client-s3and@aws-sdk/client-sts(3.1147.0). Thesnapshotinput and all outputs are unchanged.This is a breaking change, so it should be released as v0.2.0. The bucket and role for CVector-Energy/ui come from that repository's dev terraform stacks.
Testing
npm test: 20 tests pass. New tests cover the save plan (uploads, deletes, concurrent edits and deletions, index merges), the line-wiseMEMORY.mdmerge, local hashing, and the path-escape guard.npm run build:dist/is regenerated.🤖 Generated with Claude Code