Fix e2e flakes in opencode lifecycle and test assertions#971
Closed
Fix e2e flakes in opencode lifecycle and test assertions#971
Conversation
Entire-Checkpoint: e8f72026554b
Entire-Checkpoint: 3ab3686c3abf
Entire-Checkpoint: 410824eb6bc7
Entire-Checkpoint: 0483994acee1
Entire-Checkpoint: f1afa5565570
Entire-Checkpoint: 725cc9843af9
Entire-Checkpoint: b620f59b4502
…FromLiveTranscript Restructure the normalization loop to compute the relative path first, then filter and append once, instead of repeating the isInternalTrackingPath check and append in both if/else-if branches. Entire-Checkpoint: fd68e2e3a47f
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens OpenCode hook lifecycle handling and stabilizes E2E tests by reducing timing sensitivity and by excluding internal runtime artifacts from file attribution/tracking in the manual-commit strategy.
Changes:
- Add more robust OpenCode turn lifecycle handling (turn-start fallback + turn-end dedupe) and regression assertions for generated plugin content.
- Exclude
.entire/and.opencode/runtime artifacts fromfiles_touched/ committed-file fallback logic while preserving user-managedopencode.json. - Stabilize flaky E2E tests via longer prompt timeouts, tolerance for minor attribution variance, and waiting for file creation before committing.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| e2e/tests/subagent_commit_flow_test.go | Waits for file creation before staging/committing and narrows git add scope. |
| e2e/tests/edge_cases_test.go | Increases prompt timeout for two prompts to reduce flakiness. |
| e2e/tests/attribution_test.go | Allows ±1 line variance in mixed attribution assertions. |
| cmd/entire/cli/strategy/manual_commit_test.go | Expands tests to cover .opencode/ exclusion and mergeFilesTouched filtering. |
| cmd/entire/cli/strategy/manual_commit_hooks.go | Filters internal tracking paths from FilesTouched and transcript-derived modified files. |
| cmd/entire/cli/strategy/manual_commit_git.go | Filters internal tracking paths during FilesTouched merge/deduping. |
| cmd/entire/cli/strategy/manual_commit_condensation.go | Uses shared internal-path filter when excluding metadata from committed-file fallback. |
| cmd/entire/cli/strategy/common.go | Introduces isInternalTrackingPath for .entire/ + .opencode/ runtime/config paths. |
| cmd/entire/cli/agent/opencode/hooks_test.go | Adds regression test asserting lifecycle guard code is present in generated plugin. |
| cmd/entire/cli/agent/opencode/entire_plugin.ts | Implements open-turn tracking, turn-start fallback, and turn-end dedupe/cleanup. |
Entire-Checkpoint: 7c56c7f584b0
Entire-Checkpoint: 92d26ee5be87
Contributor
Author
|
Bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 21172e2. Configure here.
Entire-Checkpoint: 93d8f4ddb5fa
Entire-Checkpoint: 6b77f6e6e324
Entire-Checkpoint: a3b93a889843
Entire-Checkpoint: de66ff36ef07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.opencode/and.entire/from checkpoint file tracking while preserving user-managedopencode.jsoninfiles_touchedVerification
go build ./...go vet ./...mise run checkopencode,cursor-cli,claude-code)Note
Medium Risk
Adjusts OpenCode hook emission and file-attribution filtering logic used for checkpointing; mistakes could cause missing/duplicate lifecycle hooks or incorrect
files_touched/attribution in edge cases.Overview
Hardens the OpenCode plugin’s turn lifecycle signaling by adding a
maybeStartTurnhelper, amessage.updatedfallback for missing/latemessage.part.updatedevents, and per-session tracking to dedupe/guardturn-endon idle events.Tightens checkpoint file attribution by introducing
isInternalTrackingPathand filtering.entire/and.opencode/runtime artifacts out ofFilesTouched/fallback committed-file lists, while keeping user project files (e.g.,opencode.json) eligible.Stabilizes tests by adding regression coverage for the generated OpenCode plugin guards, excluding internal paths in unit tests, and relaxing/flaking-proofing E2E assertions (±1 line attribution tolerance, longer timeouts, and waiting/staging only expected files in subagent flows).
Reviewed by Cursor Bugbot for commit 21172e2. Configure here.