Skip to content

fix(executor): seed run-wide access key lists and scope exact-key cache grants - #7850

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/execution-context-shared-state
Sep 15, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/execution-context-shared-state

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Child executors started with no largeValueKeys / fileKeys lists, so the ??= [] append a block makes landed on its per-block context copy and was dropped. Seed both lists in createExecutionContext: top-level runs keep the lists they pass in, child executors get their own empty lists and never the parent's (an exact key is an access grant, so sharing would widen access across custom blocks)
  • The sync large-value cache honored an exact key grant without checking the key's workspace and workflow, while the async storage check refuses a key from another workspace/workflow before looking at grants. Both now call one isGrantedLargeValueKey predicate
  • Correct the executionFilesById TSDoc: the index is built per block from block states, not shared across the run
  • Investigated making the execution file index run-scoped and did not: agent tool results already land in block outputs, so later blocks find those files, and a run-wide index would expose files from failed blocks and names recorded before output redaction

Type of Change

  • Bug fix

Testing

  • New tests: keys recorded on a block copy reach the run, passed-in lists are shared by reference, a granted key from the same workflow is served from cache, a granted key for another workspace/workflow or a scope without one is refused
  • Verified the new tests fail against the old code
  • Affected vitest suites, type-check, lint, check:audits all pass

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…he grants

- Seed largeValueKeys/fileKeys in createExecutionContext so keys a block records on its per-block context copy reach later blocks; child executors get their own lists, never the parent's
- Share one exact-key grant predicate between the async storage check and the sync large-value cache, which previously honored a granted key without checking the key's workspace and workflow
- Correct the executionFilesById TSDoc: the index is built per block from block states
@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 15, 2026 3:31am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no actionable regressions identified.

Summary

Seeds execution access-key lists at context creation and centralizes workspace/workflow checks for exact large-value grants.

  • Block-context copies retain recorded large-value and file keys through shared run-local arrays.
  • Caller-supplied lists retain their existing reference identity; child executors without supplied lists start empty.
  • Synchronous cache grants now use the same scoped predicate as asynchronous materialization.
  • Adds regression tests and corrects the execution-file index lifecycle documentation.

No actionable issues were identified.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Create execution context] --> B{Key lists supplied?}
  B -->|Yes| C[Retain supplied array references]
  B -->|No| D[Create empty run-local arrays]
  C --> E[Shallow block-context copies]
  D --> E
  E --> F[Append keys to shared run lists]
  G[Exact large-value grant check] --> H[Require matching workspace and workflow prefix]
  H --> I[Require exact key in grant list]
  I --> J[Used by cache and storage authorization]
Loading

Reviews (1) · Last reviewed commit: "fix(executor): seed run-wide access key ..."

@waleedlatif1
waleedlatif1 merged commit e92de57 into staging Sep 15, 2026
33 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/execution-context-shared-state branch September 15, 2026 03:36
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