Skip to content

Update cache-memory folder naming: default at /tmp/gh-aw/cache-memory/, others at /tmp/gh-aw/cache-memory-{id}/ - #1985

Merged
pelikhan merged 4 commits into
mainfrom
copilot/update-cache-memory-schema
Oct 19, 2025
Merged

pelikhan merged 4 commits into
mainfrom
copilot/update-cache-memory-schema

Conversation

Copilot AI commented Oct 19, 2025 •

Copy link
Copy Markdown
Contributor

Problem

The previous cache-memory implementation used nested folder paths that could cause overlaps:

  • Single default cache: /tmp/gh-aw/cache-memory/
  • Multiple caches: /tmp/gh-aw/cache-memory/{id}/

This meant the default cache folder could conflict with the parent directory of multiple cache configurations, potentially causing unexpected behavior when switching between single and multiple cache setups.

Solution

Updated the cache-memory folder naming schema to use a flat, non-overlapping structure while maintaining backward compatibility:

  • Default cache: /tmp/gh-aw/cache-memory/ (unchanged for backward compatibility)
  • Other caches: /tmp/gh-aw/cache-memory-{id}/ (flat structure with ID suffix)

This ensures custom caches have their own isolated directories at the same level as the default cache, preventing any possibility of path conflicts while maintaining backward compatibility for existing workflows.

Changes

Core Implementation

  • cache.go: Updated generateCacheMemorySteps() to use /tmp/gh-aw/cache-memory/ for default cache and /tmp/gh-aw/cache-memory-{id}/ for other caches; updated generateCacheMemoryPromptSection() to reflect correct paths in AI agent prompts
  • copilot_engine.go: Modified to add all cache directories individually with --add-dir flag using the correct path for each cache
  • claude_engine.go: Updated computeAllowedClaudeToolsString() to accept CacheMemoryConfig parameter and generate path-specific tools for each cache directory with correct paths
  • sh/create_cache_memory_dir.sh: Maintains original /tmp/gh-aw/cache-memory/ path for default cache

Testing

  • Updated all test expectations to match new path format
  • Added cache config extraction to test helper functions
  • All unit and integration tests passing

Documentation

  • Updated docs/src/content/docs/reference/cache-memory.md to reflect new folder structure
  • All repository workflows regenerated with correct paths

Examples

Single cache (default):

tools:
  cache-memory: true

Creates: /tmp/gh-aw/cache-memory/ (backward compatible)

Multiple caches:

tools:
  cache-memory:
    - id: session
    - id: logs

Creates: /tmp/gh-aw/cache-memory-session/ and /tmp/gh-aw/cache-memory-logs/

Mixed (default + others):

tools:
  cache-memory:
    - id: default
    - id: session

Creates: /tmp/gh-aw/cache-memory/ and /tmp/gh-aw/cache-memory-session/

Verification

  • ✅ All unit tests passing
  • ✅ All integration tests passing
  • ✅ Linter checks passing
  • ✅ Manual compilation tests with single, multiple, and mixed cache configurations
  • ✅ All repository workflows regenerated correctly
  • ✅ Backward compatibility maintained for existing workflows using default cache

Fixes the folder naming overlap issue while maintaining backward compatibility and providing a clean, predictable cache directory structure.

Original prompt

Update the folder naming schema of multiple cache memory to

/tmp/cache-memory-/

Instead of a nested folder in /tmp/cache-memory/

This will prevent overlaps between the default cache memory and the custom ones.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits October 19, 2025 18:13
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update folder naming schema for cache memory Update cache-memory folder naming to /tmp/cache-memory-{id}/ to prevent overlaps Oct 19, 2025
Copilot AI requested a review from pelikhan October 19, 2025 18:22
@pelikhan

pelikhan commented Oct 19, 2025 •

Copy link
Copy Markdown
Collaborator

.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot Update the folder path scheme to:

For the "default" cache:

/tmp/gh-aw/cache-memory/

For other caches:

/tmp/gh-aw/cache-memory-/

…ry/, others=/tmp/gh-aw/cache-memory-{id}/

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

Copilot AI commented Oct 19, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Update the folder path scheme to:

...

Updated cache-memory paths as requested:

  • Default cache: /tmp/gh-aw/cache-memory/
  • Other caches: /tmp/gh-aw/cache-memory-{id}/

Changes in commit 7c5ddc9

Copilot AI changed the title Update cache-memory folder naming to /tmp/cache-memory-{id}/ to prevent overlaps Update cache-memory folder naming: default at /tmp/gh-aw/cache-memory/, others at /tmp/gh-aw/cache-memory-{id}/ Oct 19, 2025
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot recompile

Copilot AI commented Oct 19, 2025

Copy link
Copy Markdown
Contributor Author

@copilot recompile

Recompiled all 37 workflows successfully. No changes were needed as the workflows were already compiled with the latest cache-memory path updates:

  • Default cache: /tmp/gh-aw/cache-memory/
  • Other caches: /tmp/gh-aw/cache-memory-{id}/

@pelikhan
pelikhan marked this pull request as ready for review October 19, 2025 19:28
@pelikhan
pelikhan merged commit 8ace369 into main Oct 19, 2025
6 checks passed
@pelikhan
pelikhan deleted the copilot/update-cache-memory-schema branch October 19, 2025 19:28
@github-actions

Copy link
Copy Markdown
Contributor

Agentic Changeset Generator triggered by this pull request.

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