Skip to content

fix: recover empty goal state files - #25

Merged
danyel117 merged 1 commit into
mainfrom
fix/empty-state-recovery
Aug 20, 2026
Merged

fix: recover empty goal state files#25
danyel117 merged 1 commit into
mainfrom
fix/empty-state-recovery

Conversation

@danyel117

Copy link
Copy Markdown
Contributor

Summary

  • treat empty, whitespace-only, BOM-only, and boundary NUL-padded state files as empty state
  • emit a one-time warning per recovered state path while preserving malformed non-empty files
  • keep async and sync readers aligned and let the next mutation persist canonical state atomically
  • cover V1 prompt hooks, V2 tools, real mutations, BOM input, warnings, and corrupt-state preservation

Validation

  • bun run lint
  • bun run typecheck
  • bun test (190 pass)
  • bun run build
  • bun run pack:dry-run
  • two Claude Opus review rounds; final result: no merge blocker

Closes #1

@danyel117
danyel117 merged commit 96f2195 into main Aug 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Empty goals.json (0 bytes) causes SyntaxError on startup, crashing entire OpenCode session

1 participant