Description
Calling the push_repo_memory safe-output tool mid-session — whose own description is "Validate repo-memory files are within configured size limits before the workflow [completes]" — silently deletes the entire repo-memory working directory from disk instead of just validating it, and reports success rather than an error.
Reproduced live during this DeepReport run:
- Wrote new content to all 6 files under
/tmp/gh-aw/repo-memory/default/deep-report/ (confirmed immediately after each write via wc -l — e.g. last_analysis_timestamp.md went from 137 to 152 lines).
- Called
safeoutputs push_repo_memory '{}' (and again with {"memory_id":"default"}). Both calls returned {"result":"success","message":"Storage validation passed: 0 file(s), 0 KB total content, 0 KB patch diff (0 bytes) ..."} — i.e. it reported zero files even though 6 freshly-written files existed moments earlier.
- Immediately after,
ls -la /tmp/gh-aw/repo-memory/default/deep-report/ showed an empty directory (just ./..), and git status inside /tmp/gh-aw/repo-memory/default/ (a git checkout of the memory/deep-report branch) showed every file — including 2 unrelated legacy-path copies under memory/deep-report/ and memory/default/ — staged as deleted, with the directory's own mtime matching the exact moment of the tool call.
- The pre-wipe content was only recoverable because it had previously been committed to the
memory/deep-report branch (git show HEAD:deep-report/<file> still had it); anything written and not yet committed upstream is lost with no warning.
Expected Impact
This is very likely the root cause of long-standing repo-memory staleness observed independently in this very deep-report memory folder: its own last_analysis_timestamp.md had not been updated since ~2026-09-07, despite the DeepReport workflow running continuously since then (confirmed via discussion history — a briefing ran just ~6.5h before this one). Per the project's own workflow instructions, every cycle is told to call push_repo_memory after writing memory files — if every one of those calls wipes the agent's own uncommitted writes before the post-workflow commit/push step runs, repo-memory silently stops accumulating for any workflow using this safe-output, with no error ever surfacing to the agent or a human.
Suggested Fix
push_repo_memory should validate the working directory's pending state (e.g. by diffing against a copy, or using git diff --staged/--stat without mutating the working tree) rather than performing any destructive git operation (checkout/reset/clean) directly on the directory the agent is actively writing to. At minimum, it should never report "0 files, success" when the directory is non-empty before the call and empty after — that specific combination should fail loudly instead.
Suggested Agent
An agent familiar with the safe-outputs runtime / repo-memory push implementation (see actions/setup/js/push_repo_memory.cjs and .github/skills/developer-internals/SKILL.md).
Estimated Effort
Medium (1-4 hours) — needs careful review of whatever runtime component backs the push_repo_memory MCP tool (likely distinct from the compile-time pkg/workflow/repo_memory*.go generators and the post-workflow actions/setup/js/push_repo_memory.cjs committer) to find where it touches the live working directory, plus a regression test asserting a validation call never deletes agent-written files.
Data Source
DeepReport analysis — reproduced directly in this run (see this cycle's flagged_items.md/known_patterns.md entries in the memory/deep-report repo-memory branch for full repro notes).
Generated by 🔬 Deep Report · claude · agent · 548.3 AIC · ⌖ 12.8 AIC · ⊞ 7.1K · ◷
Description
Calling the
push_repo_memorysafe-output tool mid-session — whose own description is "Validate repo-memory files are within configured size limits before the workflow [completes]" — silently deletes the entire repo-memory working directory from disk instead of just validating it, and reports success rather than an error.Reproduced live during this DeepReport run:
/tmp/gh-aw/repo-memory/default/deep-report/(confirmed immediately after each write viawc -l— e.g.last_analysis_timestamp.mdwent from 137 to 152 lines).safeoutputs push_repo_memory '{}'(and again with{"memory_id":"default"}). Both calls returned{"result":"success","message":"Storage validation passed: 0 file(s), 0 KB total content, 0 KB patch diff (0 bytes) ..."}— i.e. it reported zero files even though 6 freshly-written files existed moments earlier.ls -la /tmp/gh-aw/repo-memory/default/deep-report/showed an empty directory (just./..), andgit statusinside/tmp/gh-aw/repo-memory/default/(a git checkout of thememory/deep-reportbranch) showed every file — including 2 unrelated legacy-path copies undermemory/deep-report/andmemory/default/— staged asdeleted, with the directory's own mtime matching the exact moment of the tool call.memory/deep-reportbranch (git show HEAD:deep-report/<file>still had it); anything written and not yet committed upstream is lost with no warning.Expected Impact
This is very likely the root cause of long-standing repo-memory staleness observed independently in this very
deep-reportmemory folder: its ownlast_analysis_timestamp.mdhad not been updated since ~2026-09-07, despite the DeepReport workflow running continuously since then (confirmed via discussion history — a briefing ran just ~6.5h before this one). Per the project's own workflow instructions, every cycle is told to callpush_repo_memoryafter writing memory files — if every one of those calls wipes the agent's own uncommitted writes before the post-workflow commit/push step runs, repo-memory silently stops accumulating for any workflow using this safe-output, with no error ever surfacing to the agent or a human.Suggested Fix
push_repo_memoryshould validate the working directory's pending state (e.g. by diffing against a copy, or usinggit diff --staged/--statwithout mutating the working tree) rather than performing any destructive git operation (checkout/reset/clean) directly on the directory the agent is actively writing to. At minimum, it should never report "0 files, success" when the directory is non-empty before the call and empty after — that specific combination should fail loudly instead.Suggested Agent
An agent familiar with the safe-outputs runtime / repo-memory push implementation (see
actions/setup/js/push_repo_memory.cjsand.github/skills/developer-internals/SKILL.md).Estimated Effort
Medium (1-4 hours) — needs careful review of whatever runtime component backs the
push_repo_memoryMCP tool (likely distinct from the compile-timepkg/workflow/repo_memory*.gogenerators and the post-workflowactions/setup/js/push_repo_memory.cjscommitter) to find where it touches the live working directory, plus a regression test asserting a validation call never deletes agent-written files.Data Source
DeepReport analysis — reproduced directly in this run (see this cycle's
flagged_items.md/known_patterns.mdentries in thememory/deep-reportrepo-memory branch for full repro notes).