-
-
Notifications
You must be signed in to change notification settings - Fork 69.1k
AGENTS.md template uses wrong section names for post-compaction context extraction #25029
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Bug
The official AGENTS.md template (reference/templates/AGENTS.md) uses ## Every Session and ## Safety as section headers. However, post-compaction-context.ts extracts sections named ## Session Startup and ## Red Lines.
This means any workspace using the official template loses startup context after compaction — extractSections() returns null because the expected headers don't match.
Evidence
Code (from bundled dist):
const sections = extractSections(
await fs.promises.readFile(agentsPath, "utf-8"),
["Session Startup", "Red Lines"]
);Template (reference/templates/AGENTS.md):
## Every Session ← code expects "Session Startup"
## Safety ← code expects "Red Lines"The BARE_SESSION_RESET_PROMPT (used by /new and /reset) also references "Session Startup".
CHANGELOG #22338 confirms the feature expects "Session Startup".
Expected fix
Update the template to use ## Session Startup and ## Red Lines, or update the code to accept both naming conventions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.