#22124: fix(agents): remove non-existent WORKFLOW_AUTO.md from post-compaction audit
size: S
experienced-contributor
Cluster:
Error Handling Improvements
## Summary
- **Bug**: Post-compaction audit requires reading `WORKFLOW_AUTO.md`, but this file does not exist in the workspace
- **Root cause**: `DEFAULT_REQUIRED_READS` in `post-compaction-audit.ts` hardcodes `WORKFLOW_AUTO.md` which was never created
- **Fix**: Remove `WORKFLOW_AUTO.md` from the default required reads list
Fixes #21957
## Problem
After auto-compaction, the post-compaction read audit checks whether the agent has read certain required startup files. `DEFAULT_REQUIRED_READS` includes `WORKFLOW_AUTO.md`, but this file:
1. Does not exist anywhere in the repository
2. Is not listed in the canonical workspace file documentation (`docs/concepts/agent-workspace.md`)
3. Was never created as part of the workspace setup
This causes the audit to always fail for `WORKFLOW_AUTO.md`, generating a warning that tells the agent to read a non-existent file — leading to a confusing loop where the agent tries and fails to read it.
**Before fix:**
Input: Agent reads all real workspace files (`AGENTS.md`, `SOUL.md`, `memory/2026-02-21.md`, etc.)
Output: Audit fails with `missingPatterns: ["WORKFLOW_AUTO.md"]` and warns agent to read it
## Changes
- `src/auto-reply/reply/post-compaction-audit.ts` — Remove `WORKFLOW_AUTO.md` from `DEFAULT_REQUIRED_READS`
- `src/auto-reply/reply/post-compaction-audit.test.ts` — Update tests to reflect removal; add regression tests for #21957
**After fix:**
Input: Agent reads daily memory file (`memory/2026-02-21.md`)
Output: Audit passes, no spurious warning about non-existent file
## Test plan
- [x] New test: regression #21957 — audit does not require `WORKFLOW_AUTO.md`
- [x] New test: regression #21957 — audit warning never mentions `WORKFLOW_AUTO.md`
- [x] All 16 existing + new tests pass
- [x] Related `post-compaction-context.test.ts` (10 tests) still passes
- [x] Format check passes
## Effect on User Experience
**Before:** After context compaction, the agent receives a warning to read `WORKFLOW_AUTO.md`. The agent attempts to read it, fails (file not found), and may retry or get confused.
**After:** The audit only checks for files that actually exist in the workspace (daily memory files). No spurious warnings after compaction.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Removes the non-existent `WORKFLOW_AUTO.md` from the `DEFAULT_REQUIRED_READS` array in the post-compaction audit, fixing a bug where agents were warned to read a file that was never created.
- Removed `"WORKFLOW_AUTO.md"` from `DEFAULT_REQUIRED_READS` in `post-compaction-audit.ts`, leaving only the daily memory file regex pattern
- Updated existing tests to reflect that only `memory/*.md` is required, and added two regression tests ensuring `WORKFLOW_AUTO.md` is never required or mentioned in audit warnings
- Added changelog entry documenting the fix
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge — it removes a reference to a file that never existed, eliminating a guaranteed audit failure.
- The change is minimal and well-targeted: one line removed from a constant array, with comprehensive test updates and regression tests. The removed string literal referenced a file that was never committed to the repository. The function signature and behavior are otherwise unchanged, and the consuming code in agent-runner.ts requires no modifications.
- No files require special attention.
<sub>Last reviewed commit: faeb0d6</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#22711: fix: post-compaction audit skips non-existent required files
by taw0002 · 2026-02-21
93.2%
#20465: fix: remove WORKFLOW_AUTO.md from default post-compaction audit reads
by aldoeliacim · 2026-02-19
88.2%
#20267: feat: workspace-aware post-compaction context
by nickjlamb · 2026-02-18
78.8%
#21285: fix(auto-reply): parse toolCall read paths in post-compaction audit
by Jackten · 2026-02-19
77.6%
#18914: fix: use per-session workspaceDir instead of process.cwd() for post...
by irchelper · 2026-02-17
76.4%
#18468: fix(agents): prevent infinite retry loops in sub-agent completion a...
by BinHPdev · 2026-02-16
73.5%
#12760: fix(memory-flush): fire on every compaction cycle instead of skippi...
by lailoo · 2026-02-09
72.9%
#22375: fix(audit): use human-readable labels for RegExp patterns in post-c...
by aldoeliacim · 2026-02-21
72.8%
#22917: fix: Use agent's configured workspace when spawned as subagent
by jriff · 2026-02-21
72.6%
#18647: fix(agents): guard against undefined paths in injectedFiles
by kleinpanic · 2026-02-16
72.5%