NemoClaw icon indicating copy to clipboard operation
NemoClaw copied to clipboard

fix(e2e): openclaw-tui-chat-correlation test fails with all runs aborted

Open hunglp6d opened this issue 6 months ago • 2 comments

Bug Report

✨ [AI-generated issue]

Description

Problem Statement

The openclaw-tui-chat-correlation-e2e nightly job (run #27047055659) failed because all three rapid chat.send runs were aborted by the OpenClaw gateway with empty reply text. The Vitest assertion at test/openclaw-tui-chat-correlation.test.ts:686 expected analysis.missingReplies to be [] but received ['A2603-REPLY', 'B2603-REPLY', 'C2603-REPLY'].

UNCERTAIN: The test ran two attempts (the built-in retry for zero-chat-event captures). Attempt 1 captured 66 events but 0 chat events; attempt 2 captured 41 events and 3 chat events, but all 3 chat events had state: "aborted" with empty text and non-matching run IDs (16aa47fc..., 4335776b..., 1f7b660e... vs the sent run IDs dceadecd..., e697478a..., 99e86e02...). Only prompt A2603's user turn appeared in chat history, and its tool result included /bin/bash: 1: cannot create /proc/self/oom_score_adj: Permission denied, suggesting the sandbox's oom_score_adj restriction may interfere with the agent's exec tool. Combined with NVIDIA inference latency, this may lead to the gateway aborting the runs before replies arrive.

Proposed Design

Requires human investigation -- no PR opened. The "aborted" runs originate inside the OpenClaw runtime within the sandbox, which is pinned to OpenClaw 2026.5.27 and is outside NemoClaw's control. Potential investigation paths:

  1. Check if the oom_score_adj permission denial cascades to an exec-tool failure that causes OpenClaw to abort the run.
  2. Verify if the NVIDIA inference endpoint (nvidia/nemotron-3-super-120b-a12b) was experiencing transient latency during this run's window (00:26-00:30 UTC on 2026-06-06).
  3. Compare against recent nightly runs to determine if this is a recurring flake or a new regression introduced by OpenClaw 2026.5.27.

Follow-up: open a fix PR once the root cause is confirmed.

Alternatives Considered

None -- the root cause is not yet confirmed.

Category

infra_flake

Reproduction Steps

  1. Re-run the openclaw-tui-chat-correlation-e2e job on commit 2b68caa via gh workflow run nightly-e2e.yaml --repo NVIDIA/NemoClaw --ref main
  2. Observe whether the live TUI correlation test's chat.send runs are aborted with empty text

Environment

  • OS: Ubuntu 24.04.4 LTS (GitHub Actions runner ubuntu-latest)
  • Node.js: v22.22.3
  • Docker: Docker (GitHub-hosted runner default)
  • NemoClaw: commit 2b68caa1ce6f88eaf416fa3257c39b8299d3c0a5
  • Other: Nightly-e2e run #27047055659, OpenShell 0.0.44, OpenClaw 2026.5.27, Vitest v4.1.0

Debug Output

FAIL  cli  test/openclaw-tui-chat-correlation.test.ts > OpenClaw TUI chat correlation regression (#2603) > keeps rapid live TUI/webchat sends correlated on a real OpenClaw sandbox
AssertionError: {
  "expectations": [
    "no empty final event for a submitted chat.send run",
    "each submitted prompt receives exactly one visible reply",
    "each visible reply remains correlated to the chat.send run that accepted the prompt",
    "chat.history contains exactly one user turn per submitted prompt"
  ],
  "chatEvents": [
    { "runId": "16aa47fc-9f1a-4a00-94f4-930f92ab0561", "state": "aborted", "text": "" },
    { "runId": "4335776b-aab2-4d02-b479-60cefcccf503", "state": "aborted", "text": "" },
    { "runId": "1f7b660e-4ef4-46db-9c7f-1c469ced4258", "state": "aborted", "text": "" }
  ],
  "missingReplies": ["A2603-REPLY", "B2603-REPLY", "C2603-REPLY"],
  "historyMessages": [
    { "role": "user", "text": "A2603: First task. Wait 8 seconds, then reply exactly A2603-REPLY..." },
    { "role": "assistant", "text": "We need to wait 8 seconds then reply exactly..." },
    { "role": "toolResult", "text": "/bin/bash: 1: cannot create /proc/self/oom_score_adj: Permission denied\nA2603-REPLY" }
  ]
}: expected [ 'A2603-REPLY', 'B2603-REPLY', ...(1) ] to deeply equal []

Test Files  1 failed (1)
     Tests  1 failed | 3 passed (4)
  Duration  247.89s

Logs

N/A

Checklist

  • [x] I confirmed this bug is reproducible (required)
  • [x] I searched existing issues and this is not a duplicate (required)

Suggested Labels

nightly-e2e, auto-diagnosed, ci-failure, needs-triage, VRDC


Suggested Labels (apply manually after triage)

nightly-e2e, auto-diagnosed, ci-failure, needs-triage, VRDC

hunglp6d avatar Jun 06 '26 01:06 hunglp6d

Closed due to intermittent

hunglp6d avatar Jun 08 '26 03:06 hunglp6d

Root-caused this. It's not an OpenClaw 2026.5.27 regression and not the oom_score_adj line — it's the live harness colliding with its own retry. Opened #4940 with a fix.

What's actually happening

The OpenClaw gateway websocket broadcasts chat events from every session, but the zero-event capture retry (#4255) reuses the same gateway with identical reply tokens (A2603-REPLY/B2603-REPLY/C2603-REPLY). When slow inference pushes attempt 1's runs past the reply deadline, attempt 1 times out with 0 chat events → retry fires → and attempt 1's now-orphaned runs surface their events during attempt 2, which the harness attributes to attempt 2.

I pulled all 7 failed nightly runs. They split into two families, both downstream of this:

  • This issue (run 27047055659): attempt 1's 3 orphaned runs were aborted by the gateway (its client disconnected). Attempt 2 captured those 3 aborted events — foreign run IDs, empty text. They both failed the assertions and prevented the retry classifier from re-firing (capture was no longer "zero events").
  • #4742 / #4637 (e.g. run 26790528855): attempt 1's orphaned runs finished during attempt 2 and broadcast the reply tokens under attempt 1's run IDs → reported as uncorrelatedReplies. Attempt 2's own session history showed its prompts still mid-flight, confirming the captured "replies" were ghosts.

On your three specific investigation paths:

  1. oom_score_adj — unrelated noise from the sandbox shell profile. The exec succeeded and produced A2603-REPLY anyway (it's right there in the tool result).
  2. Inference latency — yes, this is the trigger (it's what makes attempt 1 overrun), but not a product bug.
  3. OpenClaw 2026.5.27 regression — no. The signature predates the pin, and the same commit passes and fails on different nights.

Fix (#4940)

The gateway's chat events already carry a sessionKey (the NemoClaw chat.send patch sets it); the harness just never filtered on it. The PR session-scopes the capture/analysis, hardens the retry classifier so stale aborted events can't defeat it, emits an explicit INFRASTRUCTURE CAPTURE FAILURE when every attempt is a capture failure, and exports the in-sandbox gateway log on failure. The strict #2603/#3145 correlation assertions stay in force for events within the attempt's own session.

abhi-0906 avatar Jun 08 '26 06:06 abhi-0906