Skip to content

Add automatic .serena/cache caching for workflows with Serena tool#12984

Closed
pelikhan with Copilot wants to merge 5 commits into
mainfrom
copilot/update-compiler-cache-setup
Closed

Add automatic .serena/cache caching for workflows with Serena tool#12984
pelikhan with Copilot wants to merge 5 commits into
mainfrom
copilot/update-compiler-cache-setup

Conversation

Copilot AI commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

Workflows using the Serena tool now automatically cache .serena/cache to preserve language server state between runs.

Implementation

  • Cache step generation (pkg/workflow/serena_cache.go)

    • isSerenaEnabled(): Detects Serena in ParsedTools or legacy Tools map
    • generateSerenaCacheStep(): Injects cache step after checkout
  • Cache configuration

    • Path: .serena/cache
    • Key: serena-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}
    • Restore keys: serena-${{ runner.os }}- (prefix match for last-wins behavior)
    • save-always: true ensures cache persists on workflow failure
    • continue-on-error: true handles missing directory gracefully
  • Integration (pkg/workflow/compiler_yaml_main_job.go)

    • Called immediately after checkout step generation

Example output

- name: Checkout repository
  uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
  with:
    persist-credentials: false
- name: Cache Serena
  uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
  continue-on-error: true
  with:
    path: .serena/cache
    key: serena-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}
    restore-keys: |
      serena-${{ runner.os }}-
    save-always: true

20 existing workflows with Serena automatically updated.

Original prompt

Update the compiler:

When the Serena took is enabled, the agent job should have a cache mounted at .serena/cache (after checkout). Ignore if folder does not exist.

The cache should be setup such that the last cache wins. Expires in 7d


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 31, 2026 17:17
…s strategy

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot use resolution name cascade to simulate last-cache-wins

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update compiler to mount cache when Serena is enabled Add automatic .serena/cache caching for workflows with Serena tool Jan 31, 2026
Copilot AI requested a review from pelikhan January 31, 2026 17:26
@pelikhan
pelikhan marked this pull request as ready for review January 31, 2026 17:27
@pelikhan pelikhan closed this Jan 31, 2026
@github-actions
github-actions Bot deleted the copilot/update-compiler-cache-setup branch April 2, 2026 13:14
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.

2 participants