Skip to content

fix: make goal creation idempotent - #28

Merged
danyel117 merged 1 commit into
mainfrom
fix/idempotent-goal-create
Aug 20, 2026
Merged

fix: make goal creation idempotent#28
danyel117 merged 1 commit into
mainfrom
fix/idempotent-goal-create

Conversation

@danyel117

Copy link
Copy Markdown
Contributor

Summary

  • make repeated create_goal and set_goal calls return the existing matching goal without rewriting state
  • return a terminal conflict result for a different non-closed objective instead of the retry-triggering tool error
  • allow matching objectives to start fresh after the prior goal is complete or unmet
  • preserve Plan/restricted and safety-limit notices on reused goals
  • instruct /goal to inspect state and call create_goal at most once
  • handle concurrent matching creation calls without duplicate goal history

Validation

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

Closes #21

@danyel117
danyel117 merged commit 27b8d32 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.

create_goal retried 10x in ~7s with no backoff after "already has a non-closed goal" error

1 participant