Skip to content

fix: keep state mutations on one file - #31

Merged
danyel117 merged 1 commit into
mainfrom
fix/ci-timing-flakes
Aug 20, 2026
Merged

fix: keep state mutations on one file#31
danyel117 merged 1 commit into
mainfrom
fix/ci-timing-flakes

Conversation

@danyel117

Copy link
Copy Markdown
Contributor

Summary

  • capture OPENCODE_GOAL_STATE_PATH once per queued mutation so reads and writes cannot target different files
  • dispose every V1 and V2 plugin instance from test teardown, including after assertion failures
  • add a deterministic regression that changes the state path between read and write
  • restore Bun's native sequential runner while retaining centralized normal/coverage scripts

Root cause

An in-flight continuation from a prior test could begin a state mutation against fixture A. readStateEffect read A, but writeStateEffect resolved the environment variable again and wrote the old state into fixture B after the next test changed OPENCODE_GOAL_STATE_PATH. Captured failures showed objectives from earlier tests inside the current test's newly-created path.

The regression was observed RED before the fix (original objective remained in A and updated state moved to B) and GREEN after capturing one path for the mutation.

Validation

  • fixed full suite: 0/50 loops
  • after V2 teardown hardening: 0/20 additional loops
  • bun run lint
  • bun run typecheck
  • bun run test (213 pass)
  • bun run test:coverage (213 pass)
  • bun run build
  • bun run pack:dry-run
  • Claude Opus review: no merge blocker

@danyel117
danyel117 merged commit 2aabd27 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.

1 participant