Skip to content

Post-compaction audit hardcodes WORKFLOW_AUTO.md, can trigger false missing-file loops and session churn #22674

@sene1337

Description

@sene1337

Summary

post-compaction-audit.ts currently hardcodes default required reads to:

const DEFAULT_REQUIRED_READS = [
  "WORKFLOW_AUTO.md",
  /memory\/\d{4}-\d{2}-\d{2}\.md/,
];

In real deployments, many workspaces do not have WORKFLOW_AUTO.md. This produces repeated post-compaction warnings about missing startup files and appears to correlate with unexpected session handoffs/new-session creation during heartbeat windows.

What we observed

  • Repeated warning text after compaction:
    • missing WORKFLOW_AUTO.md
    • missing memory/YYYY-MM-DD.md regex match when daily file didn't exist yet
  • Repeated read ENOENT errors in gateway logs for WORKFLOW_AUTO.md.
  • Overnight heartbeat/session churn around those warning windows.

Why this is problematic

  • WORKFLOW_AUTO.md is treated like a required sentinel but is undocumented and absent by default in many user workspaces.
  • Required-read checks are strict-equality path checks; missing file can create persistent warning loops.
  • This can be interpreted by users as agent/session instability even if core runtime is healthy.

Proposed fix

  1. Do not hardcode WORKFLOW_AUTO.md as required by default.
    • Make it optional, or
    • Gate it behind existence check (if file exists in workspace, then require read), or
    • Move required-read list fully to config with safe defaults.
  2. Keep daily-memory regex check but consider allowing a grace window if today's file doesn't exist yet.
  3. Improve audit messaging to distinguish:
    • "required file missing from workspace" vs
    • "required file exists but wasn't read"

Suggested acceptance criteria

  • Fresh workspace with no WORKFLOW_AUTO.md does not trigger perpetual post-compaction missing-file warnings.
  • Post-compaction audit only requires files that exist or are explicitly configured.
  • No repeated ENOENT spam for audit-required files that are absent by design.

Relevant source

src/auto-reply/reply/post-compaction-audit.ts

Thanks — happy to test a patch quickly once available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions