Repository navigation
test(e2e): retry empty TUI chat event captures - #4255
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis test update adds intelligent retry logic for chat event capture failures in Issue 2603 live reproduction. A new session key generation scheme with UUID suffixes ensures per-run uniqueness, detection logic identifies zero-event failure modes, and a retry wrapper conditionally re-executes the test. Failure reporting now captures attempt histories and trace-derived metrics. ChangesIssue 2603 Event Capture Resilience
Sequence DiagramsequenceDiagram
participant LiveTest as Live Sandbox Test
participant RetryWrapper as runLiveIssue2603ReproWithEventCaptureRetry
participant ReproExec as Live Repro Execution
participant Classifier as looksLikeEventCaptureFailure
participant Reporting as buildFailureSummary
LiveTest->>RetryWrapper: trigger with UUID session key
RetryWrapper->>ReproExec: run repro (attempt 1)
ReproExec-->>RetryWrapper: repro trace
RetryWrapper->>Classifier: analyze trace for zero captured events
alt Capture failure detected
RetryWrapper->>ReproExec: run repro (attempt 2)
ReproExec-->>RetryWrapper: repro trace
end
RetryWrapper-->>LiveTest: return {repro, attempts}
LiveTest->>Reporting: pass trace + attempts
Reporting-->>LiveTest: enriched failure JSON
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
E2E Advisor RecommendationRequired E2E: None Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: None Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 0 needs attention, 0 worth checking, 0 nice ideas This is an automated advisory review. A human maintainer must make the final merge decision. |
|
Addressed the review advisor note in 749bc90 by adding source-boundary and removal-criteria context next to the retry helper. The comment now documents that the tolerated zero-event state is a live repro observability race at the pinned OpenClaw gateway/websocket boundary, that this PR keeps the strict #2603/#3145 assertions intact, and when to remove the guard. Verification re-run:
|
The OpenClaw gateway websocket broadcasts chat events from every session, and the zero-event capture retry added in NVIDIA#4255 reuses the same gateway with identical reply tokens. When slow inference pushes the first attempt's runs past the reply deadline, those orphaned runs complete or get aborted during the retry attempt, whose capture then misreads the stale events as uncorrelated replies (NVIDIA#4742, NVIDIA#4637) or as aborted runs that defeat the retry classifier (NVIDIA#4881). No correlation regression actually occurred in those nightlies. - Scope chat-event analysis and the in-sandbox reply wait to the attempt's own sessionKey, fail-open for events without one, and surface excluded events as foreignSessionChatEvents diagnostics. - Reclassify capture failure as "no chat event references a submitted run or reply token" so stale aborted events cannot defeat the retry, and fail with an explicit infrastructure classification when every attempt is a capture failure (NVIDIA#4198 acceptance criterion). - Record per-attempt sessionKey and sent run ids in the failure summary so cross-attempt contamination is visible in CI logs. - Export the in-sandbox gateway log on failure and upload it as a CI artifact before sandbox cleanup destroys it. Fixes NVIDIA#4881 Signed-off-by: Abhimanyu Kumar <[email protected]>
The OpenClaw gateway websocket broadcasts chat events from every session, and the zero-event capture retry added in NVIDIA#4255 reuses the same gateway with identical reply tokens. When slow inference pushes the first attempt's runs past the reply deadline, those orphaned runs complete or get aborted during the retry attempt, whose capture then misreads the stale events as uncorrelated replies (NVIDIA#4742, NVIDIA#4637) or as aborted runs that defeat the retry classifier (NVIDIA#4881). No correlation regression actually occurred in those nightlies. - Scope chat-event analysis and the in-sandbox reply wait to the attempt's own sessionKey, fail-open for events without one, and surface excluded events as foreignSessionChatEvents diagnostics. - Reclassify capture failure as "no chat event references a submitted run or reply token" so stale aborted events cannot defeat the retry, and fail with an explicit infrastructure classification when every attempt is a capture failure (NVIDIA#4198 acceptance criterion). - Record per-attempt sessionKey and sent run ids in the failure summary so cross-attempt contamination is visible in CI logs. - Export the in-sandbox gateway log on failure and upload it as a CI artifact before sandbox cleanup destroys it. Fixes NVIDIA#4881 Signed-off-by: Abhimanyu Kumar <[email protected]>
The OpenClaw gateway websocket broadcasts chat events from every session, and the zero-event capture retry added in NVIDIA#4255 reuses the same gateway with identical reply tokens. When slow inference pushes the first attempt's runs past the reply deadline, those orphaned runs complete or get aborted during the retry attempt, whose capture then misreads the stale events as uncorrelated replies (NVIDIA#4742, NVIDIA#4637) or as aborted runs that defeat the retry classifier (NVIDIA#4881). No correlation regression actually occurred in those nightlies. - Scope chat-event analysis and the in-sandbox reply wait to the attempt's own sessionKey, fail-open for events without one, and surface excluded events as foreignSessionChatEvents diagnostics. - Reclassify capture failure as "no chat event references a submitted run or reply token" so stale aborted events cannot defeat the retry, and fail with an explicit infrastructure classification when every attempt is a capture failure (NVIDIA#4198 acceptance criterion). - Record per-attempt sessionKey and sent run ids in the failure summary so cross-attempt contamination is visible in CI logs. - Export the in-sandbox gateway log on failure and upload it as a CI artifact before sandbox cleanup destroys it. Fixes NVIDIA#4881 Signed-off-by: Abhimanyu Kumar <[email protected]>
The OpenClaw gateway websocket broadcasts chat events from every session, and the zero-event capture retry added in NVIDIA#4255 reuses the same gateway with identical reply tokens. When slow inference pushes the first attempt's runs past the reply deadline, those orphaned runs complete or get aborted during the retry attempt, whose capture then misreads the stale events as uncorrelated replies (NVIDIA#4742, NVIDIA#4637) or as aborted runs that defeat the retry classifier (NVIDIA#4881). No correlation regression actually occurred in those nightlies. - Scope chat-event analysis and the in-sandbox reply wait to the attempt's own sessionKey, fail-open for events without one, and surface excluded events as foreignSessionChatEvents diagnostics. - Reclassify capture failure as "no chat event references a submitted run or reply token" so stale aborted events cannot defeat the retry, and fail with an explicit infrastructure classification when every attempt is a capture failure (NVIDIA#4198 acceptance criterion). - Record per-attempt sessionKey and sent run ids in the failure summary so cross-attempt contamination is visible in CI logs. - Export the in-sandbox gateway log on failure and upload it as a CI artifact before sandbox cleanup destroys it. Fixes NVIDIA#4881 Signed-off-by: Abhimanyu Kumar <[email protected]>
The OpenClaw gateway websocket broadcasts chat events from every session, and the zero-event capture retry added in NVIDIA#4255 reuses the same gateway with identical reply tokens. When slow inference pushes the first attempt's runs past the reply deadline, those orphaned runs complete or get aborted during the retry attempt, whose capture then misreads the stale events as uncorrelated replies (NVIDIA#4742, NVIDIA#4637) or as aborted runs that defeat the retry classifier (NVIDIA#4881). No correlation regression actually occurred in those nightlies. - Scope chat-event analysis and the in-sandbox reply wait to the attempt's own sessionKey, fail-open for events without one, and surface excluded events as foreignSessionChatEvents diagnostics. - Reclassify capture failure as "no chat event references a submitted run or reply token" so stale aborted events cannot defeat the retry, and fail with an explicit infrastructure classification when every attempt is a capture failure (NVIDIA#4198 acceptance criterion). - Record per-attempt sessionKey and sent run ids in the failure summary so cross-attempt contamination is visible in CI logs. - Export the in-sandbox gateway log on failure and upload it as a CI artifact before sandbox cleanup destroys it. Fixes NVIDIA#4881 Signed-off-by: Abhimanyu Kumar <[email protected]>
The OpenClaw gateway websocket broadcasts chat events from every session, and the zero-event capture retry added in NVIDIA#4255 reuses the same gateway with identical reply tokens. When slow inference pushes the first attempt's runs past the reply deadline, those orphaned runs complete or get aborted during the retry attempt, whose capture then misreads the stale events as uncorrelated replies (NVIDIA#4742, NVIDIA#4637) or as aborted runs that defeat the retry classifier (NVIDIA#4881). No correlation regression actually occurred in those nightlies. - Scope chat-event analysis and the in-sandbox reply wait to the attempt's own sessionKey, fail-open for events without one, and surface excluded events as foreignSessionChatEvents diagnostics. - Reclassify capture failure as "no chat event references a submitted run or reply token" so stale aborted events cannot defeat the retry, and fail with an explicit infrastructure classification when every attempt is a capture failure (NVIDIA#4198 acceptance criterion). - Record per-attempt sessionKey and sent run ids in the failure summary so cross-attempt contamination is visible in CI logs. - Export the in-sandbox gateway log on failure and upload it as a CI artifact before sandbox cleanup destroys it. Fixes NVIDIA#4881 Signed-off-by: Abhimanyu Kumar <[email protected]>
The OpenClaw gateway websocket broadcasts chat events from every session, and the zero-event capture retry added in NVIDIA#4255 reuses the same gateway with identical reply tokens. When slow inference pushes the first attempt's runs past the reply deadline, those orphaned runs complete or get aborted during the retry attempt, whose capture then misreads the stale events as uncorrelated replies (NVIDIA#4742, NVIDIA#4637) or as aborted runs that defeat the retry classifier (NVIDIA#4881). No correlation regression actually occurred in those nightlies. - Scope chat-event analysis and the in-sandbox reply wait to the attempt's own sessionKey, fail-open for events without one, and surface excluded events as foreignSessionChatEvents diagnostics. - Reclassify capture failure as "no chat event references a submitted run or reply token" so stale aborted events cannot defeat the retry, and fail with an explicit infrastructure classification when every attempt is a capture failure (NVIDIA#4198 acceptance criterion). - Record per-attempt sessionKey and sent run ids in the failure summary so cross-attempt contamination is visible in CI logs. - Export the in-sandbox gateway log on failure and upload it as a CI artifact before sandbox cleanup destroys it. Fixes NVIDIA#4881 Signed-off-by: Abhimanyu Kumar <[email protected]>
The OpenClaw gateway websocket broadcasts chat events from every session, and the zero-event capture retry added in NVIDIA#4255 reuses the same gateway with identical reply tokens. When slow inference pushes the first attempt's runs past the reply deadline, those orphaned runs complete or get aborted during the retry attempt, whose capture then misreads the stale events as uncorrelated replies (NVIDIA#4742, NVIDIA#4637) or as aborted runs that defeat the retry classifier (NVIDIA#4881). No correlation regression actually occurred in those nightlies. - Scope chat-event analysis and the in-sandbox reply wait to the attempt's own sessionKey, fail-open for events without one, and surface excluded events as foreignSessionChatEvents diagnostics. - Reclassify capture failure as "no chat event references a submitted run or reply token" so stale aborted events cannot defeat the retry, and fail with an explicit infrastructure classification when every attempt is a capture failure (NVIDIA#4198 acceptance criterion). - Record per-attempt sessionKey and sent run ids in the failure summary so cross-attempt contamination is visible in CI logs. - Export the in-sandbox gateway log on failure and upload it as a CI artifact before sandbox cleanup destroys it. Fixes NVIDIA#4881 Signed-off-by: Abhimanyu Kumar <[email protected]>
The OpenClaw gateway websocket broadcasts chat events from every session, and the zero-event capture retry added in NVIDIA#4255 reuses the same gateway with identical reply tokens. When slow inference pushes the first attempt's runs past the reply deadline, those orphaned runs complete or get aborted during the retry attempt, whose capture then misreads the stale events as uncorrelated replies (NVIDIA#4742, NVIDIA#4637) or as aborted runs that defeat the retry classifier (NVIDIA#4881). No correlation regression actually occurred in those nightlies. - Scope chat-event analysis and the in-sandbox reply wait to the attempt's own sessionKey, fail-open for events without one, and surface excluded events as foreignSessionChatEvents diagnostics. - Reclassify capture failure as "no chat event references a submitted run or reply token" so stale aborted events cannot defeat the retry, and fail with an explicit infrastructure classification when every attempt is a capture failure (NVIDIA#4198 acceptance criterion). - Record per-attempt sessionKey and sent run ids in the failure summary so cross-attempt contamination is visible in CI logs. - Export the in-sandbox gateway log on failure and upload it as a CI artifact before sandbox cleanup destroys it. Fixes NVIDIA#4881 Signed-off-by: Abhimanyu Kumar <[email protected]>
## Summary Root-causes and fixes the recurring `openclaw-tui-chat-correlation-e2e` nightly flake. The OpenClaw gateway websocket broadcasts chat events from **every** session, but the zero-event capture retry added in #4255 reuses the same gateway with identical reply tokens. When slow inference pushes the first attempt's runs past the reply deadline, those orphaned runs complete or get aborted *during* the retry attempt, whose websocket capture then misreads the stale events as a correlation regression. No #2603/#3145 regression actually occurred in those nightlies — the test was catching its own retry's echo. ## Related Issue Fixes #4881 Same contamination signature, previously closed as intermittent: #4742, #4637. Advances umbrella issue #4198 (acceptance criterion: "failure is classified clearly as infrastructure/setup rather than a product regression"). ## Root cause (evidence) Across the 7 failed nightly runs I pulled, the failures split into two families, both downstream of the global event stream + retry interaction: - **#4881 (run 27047055659):** attempt 1 timed out with 0 chat events; during attempt 2, attempt 1's 3 orphaned runs were **aborted** by the gateway (its client had disconnected). Attempt 2 captured those 3 `aborted` events — foreign run IDs, empty text — which both failed the assertions and prevented the retry classifier from re-firing. - **#4742 / #4637 (e.g. run 26790528855):** attempt 1's orphaned runs *finished* during attempt 2 and broadcast `A2603-REPLY`/`B2603-REPLY`/`C2603-REPLY` under attempt 1's run IDs. Attempt 2's own session history showed its prompts still mid-flight, proving the captured "replies" were ghosts from attempt 1. The gateway's chat events already carry a `sessionKey` (the NemoClaw chat.send patch sets it), but the harness never filtered on it. The `oom_score_adj` permission-denied line in #4881 is unrelated noise from the sandbox shell profile — the exec succeeded and produced `A2603-REPLY` anyway. ## Changes - **Session-scope the capture.** `analyzeIssue2603Trace` and the in-sandbox reply-wait/empty-final checks now only consider chat events whose `sessionKey` matches the attempt's own session. Events without a `sessionKey` are kept (fail-open) so the assertions can never be silently blinded by a payload-shape change. Excluded events are surfaced as `foreignSessionChatEvents` diagnostics. - **Harden the retry classifier.** `looksLikeEventCaptureFailure` now means "no chat event references a submitted run ID or a reply token," so stale `aborted` events for foreign runs no longer defeat the retry (the #4881 trap). - **Explicit infrastructure verdict.** When every attempt is a capture failure, the live test now throws a clearly-labelled `INFRASTRUCTURE CAPTURE FAILURE` instead of a generic correlation assertion, so a red nightly is unambiguous. - **Better forensics.** Per-attempt `sessionKey` and sent run IDs are recorded in the failure summary; the in-sandbox gateway log is exported on failure and uploaded as a CI artifact before sandbox cleanup destroys it. - **Unit tests** for foreign-session exclusion, fail-open without `sessionKey`, and the #4881 stale-aborted classification. The strict #2603/#3145 correlation assertions are unchanged for events within the attempt's own session — a genuine mis-correlation still fails the test. ## Type of Change - [x] Code change (feature, bug fix, or refactor) ## Verification - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] `npx prek run --all-files` passes — *prek/shellcheck/shfmt not runnable on my Windows host; `bash -n` passes on the shell script* - [ ] `npm test` passes — *full suite not run locally on Windows; the changed test file (6 unit tests), `test/e2e-script-workflow.test.ts`, `test/validate-e2e-coverage.test.ts`, and `npm run typecheck:cli` all pass. The live `it.runIf(...)` path needs a real sandbox + NVIDIA API key and is best validated by a maintainer nightly dispatch.* Suggested validation: dispatch the nightly against this branch — `gh workflow run nightly-e2e.yaml --ref <branch> -f jobs=openclaw-tui-chat-correlation-e2e` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Improved chat-event correlation to be session-scoped: excludes foreign-session noise from correlation metrics while still fail-opening events without session keys. * Added/expanded coverage for stale/aborted scenarios and updated live-repro failure messaging with clearer summaries to distinguish capture vs infrastructure issues. * **Chores** * Enhanced CI/E2E failure diagnostics: the test runner now captures the Vitest result code and, on failure, exports the relevant gateway log for troubleshooting. * CI now uploads additional logs together when E2E fails. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Abhimanyu Kumar <[email protected]> --------- Signed-off-by: Abhimanyu Kumar <[email protected]> Signed-off-by: Carlos Villela <[email protected]> Co-authored-by: Julie Yaunches <[email protected]> Co-authored-by: Carlos Villela <[email protected]> Co-authored-by: Prekshi Vyas <[email protected]> Co-authored-by: abhi-0906 <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]> Co-authored-by: Prekshi Vyas <[email protected]>
## Summary Root-causes and fixes the recurring `openclaw-tui-chat-correlation-e2e` nightly flake. The OpenClaw gateway websocket broadcasts chat events from **every** session, but the zero-event capture retry added in NVIDIA#4255 reuses the same gateway with identical reply tokens. When slow inference pushes the first attempt's runs past the reply deadline, those orphaned runs complete or get aborted *during* the retry attempt, whose websocket capture then misreads the stale events as a correlation regression. No NVIDIA#2603/NVIDIA#3145 regression actually occurred in those nightlies — the test was catching its own retry's echo. ## Related Issue Fixes NVIDIA#4881 Same contamination signature, previously closed as intermittent: NVIDIA#4742, NVIDIA#4637. Advances umbrella issue NVIDIA#4198 (acceptance criterion: "failure is classified clearly as infrastructure/setup rather than a product regression"). ## Root cause (evidence) Across the 7 failed nightly runs I pulled, the failures split into two families, both downstream of the global event stream + retry interaction: - **NVIDIA#4881 (run 27047055659):** attempt 1 timed out with 0 chat events; during attempt 2, attempt 1's 3 orphaned runs were **aborted** by the gateway (its client had disconnected). Attempt 2 captured those 3 `aborted` events — foreign run IDs, empty text — which both failed the assertions and prevented the retry classifier from re-firing. - **NVIDIA#4742 / NVIDIA#4637 (e.g. run 26790528855):** attempt 1's orphaned runs *finished* during attempt 2 and broadcast `A2603-REPLY`/`B2603-REPLY`/`C2603-REPLY` under attempt 1's run IDs. Attempt 2's own session history showed its prompts still mid-flight, proving the captured "replies" were ghosts from attempt 1. The gateway's chat events already carry a `sessionKey` (the NemoClaw chat.send patch sets it), but the harness never filtered on it. The `oom_score_adj` permission-denied line in NVIDIA#4881 is unrelated noise from the sandbox shell profile — the exec succeeded and produced `A2603-REPLY` anyway. ## Changes - **Session-scope the capture.** `analyzeIssue2603Trace` and the in-sandbox reply-wait/empty-final checks now only consider chat events whose `sessionKey` matches the attempt's own session. Events without a `sessionKey` are kept (fail-open) so the assertions can never be silently blinded by a payload-shape change. Excluded events are surfaced as `foreignSessionChatEvents` diagnostics. - **Harden the retry classifier.** `looksLikeEventCaptureFailure` now means "no chat event references a submitted run ID or a reply token," so stale `aborted` events for foreign runs no longer defeat the retry (the NVIDIA#4881 trap). - **Explicit infrastructure verdict.** When every attempt is a capture failure, the live test now throws a clearly-labelled `INFRASTRUCTURE CAPTURE FAILURE` instead of a generic correlation assertion, so a red nightly is unambiguous. - **Better forensics.** Per-attempt `sessionKey` and sent run IDs are recorded in the failure summary; the in-sandbox gateway log is exported on failure and uploaded as a CI artifact before sandbox cleanup destroys it. - **Unit tests** for foreign-session exclusion, fail-open without `sessionKey`, and the NVIDIA#4881 stale-aborted classification. The strict NVIDIA#2603/NVIDIA#3145 correlation assertions are unchanged for events within the attempt's own session — a genuine mis-correlation still fails the test. ## Type of Change - [x] Code change (feature, bug fix, or refactor) ## Verification - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] `npx prek run --all-files` passes — *prek/shellcheck/shfmt not runnable on my Windows host; `bash -n` passes on the shell script* - [ ] `npm test` passes — *full suite not run locally on Windows; the changed test file (6 unit tests), `test/e2e-script-workflow.test.ts`, `test/validate-e2e-coverage.test.ts`, and `npm run typecheck:cli` all pass. The live `it.runIf(...)` path needs a real sandbox + NVIDIA API key and is best validated by a maintainer nightly dispatch.* Suggested validation: dispatch the nightly against this branch — `gh workflow run nightly-e2e.yaml --ref <branch> -f jobs=openclaw-tui-chat-correlation-e2e` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Improved chat-event correlation to be session-scoped: excludes foreign-session noise from correlation metrics while still fail-opening events without session keys. * Added/expanded coverage for stale/aborted scenarios and updated live-repro failure messaging with clearer summaries to distinguish capture vs infrastructure issues. * **Chores** * Enhanced CI/E2E failure diagnostics: the test runner now captures the Vitest result code and, on failure, exports the relevant gateway log for troubleshooting. * CI now uploads additional logs together when E2E fails. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Abhimanyu Kumar <[email protected]> --------- Signed-off-by: Abhimanyu Kumar <[email protected]> Signed-off-by: Carlos Villela <[email protected]> Co-authored-by: Julie Yaunches <[email protected]> Co-authored-by: Carlos Villela <[email protected]> Co-authored-by: Prekshi Vyas <[email protected]> Co-authored-by: abhi-0906 <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]> Co-authored-by: Prekshi Vyas <[email protected]>
Summary
Retries the OpenClaw TUI chat correlation live repro only when an accepted-send attempt captures zero chat events, which matches the dominant harness flake. The strict correlation assertions remain unchanged for empty finals, duplicate turns, missing replies with observed events, and uncorrelated replies.
Changes
Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela [email protected]
Summary by CodeRabbit