Repository navigation
test(opencode): record phase and exit cause for workspace sync-history failures - #845
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
| if (Exit.isSuccess(exit)) return Effect.void | ||
| const cause: SyncHistoryDiagnostic["cause"] = { Fail: 0, Die: 0, Interrupt: 0, interruptors: [] } | ||
| for (const reason of exit.cause.reasons) { | ||
| cause[reason._tag] = Math.min(32, cause[reason._tag] + 1) |
There was a problem hiding this comment.
WARNING: Possible typecheck failure — cause indexed by reason._tag. The accumulator only declares Fail, Die, Interrupt keys, but exit.cause.reasons may carry other tags under effect 4.0.0-beta.83 (composite, timeout, …). cause.reasons is an established pattern (test/tool/task.test.ts:2854); this indexing is not. Typecheck was left to CI — verify before merge.
| for (const reason of exit.cause.reasons) { | ||
| cause[reason._tag] = Math.min(32, cause[reason._tag] + 1) | ||
| if (Cause.isInterruptReason(reason) && cause.interruptors.length < 8) { | ||
| cause.interruptors.push(reason.fiberId) |
There was a problem hiding this comment.
WARNING: Possible typecheck failure — reason.fiberId pushed into interruptors typed (number | undefined)[]. fiberId on an Interrupt reason is not an established in-repo pattern (unused elsewhere) and may be Option<number> under effect 4.0.0-beta.83. Tests pass locally, but this line may fail typecheck — verify before merge.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous Review Summaries (2 snapshots, latest commit 121ad39)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 121ad39)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous review (commit 0043edf)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (1 file)
Reviewed by free · Input: 18.7K · Output: 287 · Cached: 17.5K |
…ertions (#843) Co-authored-by: agenteinstinct1-max <[email protected]>
…barrier diagnostic Diagnostic-only change to the 845 Windows CI hang probe pair. Not a cause fix; no product code changed. Known coverage limits, stated explicitly: - Trace dumps fire only from assertion catch sites. Rejections on the Promise.all / stdin read / stdin write paths are not dumped. - On the fixture gate-assertion failure path the dump fires before finalizer-end, so fixture phase C3 is absent on exactly that path. - Qualified on Linux only; no Windows proof. Windows behavior is the CI question this instrumentation exists to measure. Does not close or resolve any issue.
Issue for this PR
Closes #844, which only asks for the missing measurement (phase reached and exit cause recorded when the test does not succeed). This PR does not fix or explain the underlying Windows CI failure; #830 and #841 remain open.
Development link: #844 is linked in this PR's Development sidebar (GraphQL closingIssuesReferences = #844), because "Closes" in the body is not recognized for a non-default base branch.
Integration update: head 121ad39 is an ordinary merge of the previous head 0043edf into the current dev-vibecoded tip 2ab1fca (which now contains #843). Tree 850b78dee7405e1e23d5f8652e92cc9f462b2335. The PR's own change is unchanged: workspace.test.ts blob 4de34d05b211e3460bc2468dc0b13c4d924256aa, 208 lines added, 3 changed; effect.test.ts is the one from #843. CI for this head has not finished; earlier results at 0043edf do not count for it. Local on this head: workspace.test.ts 40 pass, 0 fail, no "[workspace-sync-history]" output; effect.test.ts 4 pass.
Integration update 2: head 452fb4c (tree b806312f69976dd77eded0d1ee417127b164997b, sole parent 121ad39) adds bounded in-memory trace instrumentation to the abandoned-entry-barrier diagnostic pair only (test/lib/abandoned-entry-barrier.test.ts + test/lib/fixtures/abandoned-entry-barrier.ts, 121 lines added, 17 removed, blobs sha256 5a05faa3.../7749d767...). Measurement only: it records phase/byte counters for the Windows CI hang investigation and changes no product code and no assertion semantics.
Stated coverage limits of the new trace: dumps fire only from assertion catch sites; rejections on the Promise.all / stdin read / stdin write paths are not dumped; on the fixture gate-assertion failure path the dump fires before finalizer-end, so fixture phase C3 is absent on exactly that path. Qualified on Linux only (passing path quiet, original errors rethrown unchanged in forced-failure controls); no Windows proof - Windows is what CI measures. Not a cause fix. Closes only #844 as above; does not close or resolve #833 or #835.
Type of change
What does this PR do?
Instruments the test "sync history sends the local sequence fence and replays returned events in workspace context" in packages/opencode/test/control-plane/workspace.test.ts with a small test-local helper. It records a bounded list of fixed phase labels while the test body runs. Only when the test body exits with a failure or interruption, it prints one "[workspace-sync-history]" line with: the last phase, up to 16 phase breadcrumbs, capped per-phase counts, the current fiber id, and counts of Fail, Die and Interrupt cause entries (each capped at 32) with up to 8 interrupting fiber ids. No error messages, payloads or other values are serialized. A successful run prints nothing. The reporter runs uninterruptibly and its own failure, defect or interruption cannot replace the original cause.
The record is taken at the exit of the test body, before the outer scope closes. A failure in an outer finalizer or the surrounding harness can therefore remain unreported. This is not a full cause capture.
Adds four synthetic tests for the helper: success stays quiet, failure cause and cleanup are preserved with bounded breadcrumbs and no payload serialized, a real interruption is reported and not consumed, and reporter failures do not replace the original cause.
All existing assertions in the real test, their order, text and timeouts are unchanged (208 lines added, 3 changed lines: the effect import, a return that now goes through a local const, and the closing of the test). No production code, workflow, dependency or package-script changes. Base: 32c33f4 on dev-vibecoded.
It makes no claim about the cause of the Windows failure or about any outer finalization or harness behavior.
How did you verify your code works?
Linux, Bun 1.3.14,
--timeout 30000. On this base, the whole workspace.test.ts: 40 pass, 0 fail, no "[workspace-sync-history]" output. That includes the four synthetic tests and the real sync-history test. An independent source-only review of the body-exit scope found no must-fix or should-fix items.Not verified: Windows (CI will be the first Windows run), typecheck (left to CI), and whether the failure recurs.
Checklist