Objective
Make cache-memory, comment-memory, and repo-memory content available to on.steps: (the pre-activation job) so deterministic filter steps can make dispatch/activation decisions based on prior memory state — without an LLM turn.
Context
Issue #43924 describes how on.steps: runs in the pre_activation job (see pkg/workflow/compiler_pre_activation_job.go) but memory stores are only ever restored in the agent job. This forces authors to either burn an LLM turn just to read memory, or duplicate state in a separate actions/cache.
The on.steps: pre-activation job is the natural place for a deterministic "should I activate and what should I do?" filter — but only if it can read persisted memory.
Implementation Plan
Implementation Plan
Files to Modify
pkg/workflow/compiler_pre_activation_job.go — inject memory restore steps into the pre-activation job when memory is configured
pkg/workflow/cache.go — potentially refactor generateCacheMemorySteps to accept a target builder/context so it can be reused in the pre-activation job
- Relevant tests — add tests that verify memory restore steps appear in the pre-activation job steps when
on.steps: + memory are both configured
Approach
- In
buildPreActivationJobSteps (in compiler_pre_activation_job.go), when data.CacheMemoryConfig, data.RepoMemoryConfig, or data.SafeOutputs.CommentMemory is set and on.steps is non-empty, emit the corresponding restore steps before the user on.steps entries.
- Reuse or extract the same restore step generation functions used by the agent job (
generateCacheMemorySteps, generateRepoMemorySteps, comment-memory prepare step) — making them accept a generic target builder or returning step YAML strings.
- Ensure the pre-activation job runner environment has the necessary scripts available (they come from the
setup action — check whether setup runs in the pre-activation job or only in the agent job).
- Make memory restore in
on.steps opt-in (only injected when the workflow uses both memory and on.steps), not always-on.
- Add tests asserting restore steps precede user
on.steps in the pre-activation job.
Acceptance Criteria
Generated by 📋 Plan Command · 79.6 AIC · ⌖ 11.7 AIC · ⊞ 4.7K · ◷
Comment /plan to run again
Objective
Make
cache-memory,comment-memory, andrepo-memorycontent available toon.steps:(the pre-activation job) so deterministic filter steps can make dispatch/activation decisions based on prior memory state — without an LLM turn.Context
Issue #43924 describes how
on.steps:runs in thepre_activationjob (seepkg/workflow/compiler_pre_activation_job.go) but memory stores are only ever restored in the agent job. This forces authors to either burn an LLM turn just to read memory, or duplicate state in a separateactions/cache.The
on.steps:pre-activation job is the natural place for a deterministic "should I activate and what should I do?" filter — but only if it can read persisted memory.Implementation Plan
Implementation Plan
Files to Modify
pkg/workflow/compiler_pre_activation_job.go— inject memory restore steps into the pre-activation job when memory is configuredpkg/workflow/cache.go— potentially refactorgenerateCacheMemoryStepsto accept a target builder/context so it can be reused in the pre-activation jobon.steps:+ memory are both configuredApproach
buildPreActivationJobSteps(incompiler_pre_activation_job.go), whendata.CacheMemoryConfig,data.RepoMemoryConfig, ordata.SafeOutputs.CommentMemoryis set andon.stepsis non-empty, emit the corresponding restore steps before the useron.stepsentries.generateCacheMemorySteps,generateRepoMemorySteps, comment-memory prepare step) — making them accept a generic target builder or returning step YAML strings.setupaction — check whether setup runs in the pre-activation job or only in the agent job).on.stepsopt-in (only injected when the workflow uses both memory andon.steps), not always-on.on.stepsin the pre-activation job.Acceptance Criteria
on.steps:andcache-memory:, cache-memory is restored beforeon.stepsrun in the pre-activation jobrepo-memoryandcomment-memoryon.stepstests continue to pass (make test)make recompilepasses