syncStateFrontmatter() rebuilds YAML frontmatter from the body on every writeStateMd() call. If an agent removes or omits the Status: field from the body, buildStateFrontmatter() defaults to 'unknown', overwriting a previously valid status (e.g., 'executing'). Fix: read existing frontmatter before stripping, and preserve its status value when the body-derived status would be 'unknown'. This makes frontmatter self-healing — once a status is set, it persists even if the body loses the field. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
58 KiB
58 KiB