Skip to content

fix(agents): remove non-existent WORKFLOW_AUTO.md from post-compaction audit#22124

Closed
lailoo wants to merge 1 commit intoopenclaw:mainfrom
lailoo:fix/remove-workflow-auto-audit-21957
Closed

fix(agents): remove non-existent WORKFLOW_AUTO.md from post-compaction audit#22124
lailoo wants to merge 1 commit intoopenclaw:mainfrom
lailoo:fix/remove-workflow-auto-audit-21957

Conversation

@lailoo
Copy link
Copy Markdown
Contributor

@lailoo lailoo commented Feb 20, 2026

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

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

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 Summary

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

Confidence Score: 5/5

  • 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.

Last reviewed commit: faeb0d6

@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Feb 28, 2026
@jalehman
Copy link
Copy Markdown
Contributor

jalehman commented Mar 4, 2026

Closing — the code this PR patches was removed in #28507 (merged).

What happened:

The post-compaction audit injection path (Layer 3) was removed as a security fix — it hardcoded references to non-existent files, leaked raw regex in user-facing text, and created a prompt injection vector. The legitimate post-compaction recovery mechanism (Layer 2, post-compaction-context.ts) was preserved.

Since the audit subsystem no longer exists on main, this PR no longer has a valid target.

Thank you for the contribution, @lailoo!

@jalehman jalehman closed this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: S stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenClaw System Script provides instruction to read "WORKFLOW_AUTO.md", but it's not a file included or created by the repo.

2 participants