Skip to content

discussion-task-miner: repo-memory never persists β€” Step 1/6 write to a subdirectory excluded by the default file-globΒ #43846

Description

@yskopets

πŸ€– This issue was researched and written by Claude Code (Anthropic's CLI agent), while debugging a downstream copy of this workflow.

Summary

The discussion-task-miner workflow's repo-memory never persists across runs. Its dedup state (processed-discussions.json / extracted-tasks.json) is written to a subdirectory of the repo-memory root, but the file-glob configured by shared/repo-memory-standard.md only matches files at the root. push_repo_memory silently skips the nested files, so every run starts from empty history, re-mines the same recent discussions, and opens duplicate issues.

Runs still report success β€” the only visible symptom is that the memory/discussion-task-miner branch quietly stops advancing.

Affected files (on main)

  • .github/workflows/discussion-task-miner.md β€” Step 1 (Load Memory) and Step 6 (Update Memory) read/write nested paths:
    memory/discussion-task-miner/processed-discussions.json
    memory/discussion-task-miner/extracted-tasks.json
    memory/discussion-task-miner/latest-run.md
    
  • .github/workflows/shared/repo-memory-standard.md β€” configures a root-anchored glob:
    tools:
      repo-memory:
        file-glob: ["*.json", "*.jsonl", "*.csv", "*.md"]

Mechanism

push_repo_memory matches each candidate file's path relative to the repo-memory directory against the glob, and *.json compiles to a root-anchored regex ^[^/]*\.json$ β€” [^/]* cannot cross a /. The memory files the prompt writes land in a subdirectory of the repo-memory root (the agent resolves the relative memory/discussion-task-miner/… under …/repo-memory/<id>/), so they never match. The job log shows:

##[warning]Skipping file that does not match allowed patterns: discussion-task-miner/extracted-tasks.json
...
No changes detected after copying files

β†’ nothing is committed. Only files written flat at the repo-memory root are eligible for persistence.

Secondary issue: the prompt uses cat > memory/discussion-task-miner/<file>, which requires the subdirectory to already exist. mkdir is commonly outside the workflow's bash allowlist (I saw mkdir … was blocked), so these bash writes fail unless the agent happens to fall back to a file-write tool that creates parent dirs. Combined with the glob mismatch, persistence is doubly unreliable.

Impact

  • Silent. Runs succeed; the memory branch just stops advancing (in the case I debugged, it was frozen ~10 days while daily runs kept "succeeding").
  • Dedup depends entirely on that memory, so the miner re-processes the same last-N-days discussions each run and files duplicate issues β€” I observed the identical dependency-upgrade task issued twice, days after a PR had already merged the change.

Reproduce

  1. Run discussion-task-miner (or any workflow importing shared/repo-memory-standard.md whose prompt writes memory under a memory/<name>/… subdirectory).
  2. Inspect the push_repo_memory job log β†’ Skipping file that does not match allowed patterns: <name>/… followed by No changes detected.
  3. Observe the memory/<branch> branch does not advance even though the agent reported updating memory.

Suggested fix

Preferred β€” write memory flat at the repo-memory root. In Step 1/6, replace memory/discussion-task-miner/<file> with the repo-memory root (/tmp/gh-aw/repo-memory/<id>/<file>; default for a single memory), and add an explicit note that memory files must be stored flat at the root (no subdirectories, no mkdir) because only top-level files match the persist glob. This mirrors the fix already applied to copilot-pr-prompt-analysis in #40547, which moved history to repo-memory/default/ flat.

Alternative β€” keep the nested layout but make the glob match it, e.g. file-glob: ["discussion-task-miner/*.json", "discussion-task-miner/*.md"] (as some namespaced-memory workflows already do), and ensure the subdirectory is creatable. This is more fragile: it re-breaks silently if the glob and the paths ever drift, and it still needs the mkdir/parent-dir path to work.

Note

This likely affects any template that pairs shared/repo-memory-standard.md (root-anchored glob) with nested memory/<name>/… paths in the prompt body β€” worth a grep across the workflow set. Related prior instance of the same repo-memory-path class of bug: #40547.

Happy to send a PR for the flat-path fix if it'd help.

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions