fix(agents): remove non-existent WORKFLOW_AUTO.md from post-compaction audit#22124
Closed
lailoo wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(agents): remove non-existent WORKFLOW_AUTO.md from post-compaction audit#22124lailoo wants to merge 1 commit intoopenclaw:mainfrom
lailoo wants to merge 1 commit intoopenclaw:mainfrom
Conversation
|
This pull request has been automatically marked as stale due to inactivity. |
Contributor
|
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, Since the audit subsystem no longer exists on main, this PR no longer has a valid target. Thank you for the contribution, @lailoo! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WORKFLOW_AUTO.md, but this file does not exist in the workspaceDEFAULT_REQUIRED_READSinpost-compaction-audit.tshardcodesWORKFLOW_AUTO.mdwhich was never createdWORKFLOW_AUTO.mdfrom the default required reads listFixes #21957
Problem
After auto-compaction, the post-compaction read audit checks whether the agent has read certain required startup files.
DEFAULT_REQUIRED_READSincludesWORKFLOW_AUTO.md, but this file:docs/concepts/agent-workspace.md)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 itChanges
src/auto-reply/reply/post-compaction-audit.ts— RemoveWORKFLOW_AUTO.mdfromDEFAULT_REQUIRED_READSsrc/auto-reply/reply/post-compaction-audit.test.ts— Update tests to reflect removal; add regression tests for OpenClaw System Script provides instruction to read "WORKFLOW_AUTO.md", but it's not a file included or created by the repo. #21957After fix:
Input: Agent reads daily memory file (
memory/2026-02-21.md)Output: Audit passes, no spurious warning about non-existent file
Test plan
WORKFLOW_AUTO.mdWORKFLOW_AUTO.mdpost-compaction-context.test.ts(10 tests) still passesEffect 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.mdfrom theDEFAULT_REQUIRED_READSarray in the post-compaction audit, fixing a bug where agents were warned to read a file that was never created."WORKFLOW_AUTO.md"fromDEFAULT_REQUIRED_READSinpost-compaction-audit.ts, leaving only the daily memory file regex patternmemory/*.mdis required, and added two regression tests ensuringWORKFLOW_AUTO.mdis never required or mentioned in audit warningsConfidence Score: 5/5
Last reviewed commit: faeb0d6