Skip to content

fix(init): --yes init replaces a user-modified AGENTS.md and an unparseable .mcp.json that sync would preserve #1123

Closed

Description

@admarble

Found by the writer-state matrix in #1097.

OWNERSHIP_RULES declares AGENTS.md user-owned: regenerated only while it carries an unmodified <!-- sequant:agents-md v= h= --> marker. sync honours that (preserved: AGENTS.md, --force to replace). init does not.

What happens

init (no --force) on an already-initialized repo calls generateAgentsMd + writeAgentsMd unconditionally:

Existing AGENTS.md sync init
hand-written, no marker preserved replaced
marker kept, body edited (hash mismatch) preserved replaced
symlink to a user's file preserved written through the link

Separately, in the same init path, .mcp.json with content that is not valid JSON is replaced by sequant's file (the message says "Added Sequant to existing .mcp.json"), although .mcp.json is a merge destination and syncSequantMcpPin leaves such a file alone.

Expected

init routes AGENTS.md through decideAgentsMdSync the way sync does (interactive init already asks "Continue anyway?" for an initialized repo, but --yes skips that). An unparseable .mcp.json is left alone and reported.

The matrix pins the current behaviour and lists it under KNOWN_DEFECTS.

Activity

  1. added a commit that references this issue on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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