fix(e2e): retry transient OpenClaw provider turns - #11077
Conversation
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall line coverage in commit 65677ba in the TypeScript / code-coverage/cliThe overall line coverage in commit 65677ba in the Show a line coverage summary of the most impacted files.
Updated |
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
| ): boolean { | ||
| const output = resultText(result); | ||
| return ( | ||
| TRANSIENT_PROVIDER_AVAILABILITY_RE.test(output) && !TERMINAL_LAUNCH_FAILURE_RE.test(output) |
There was a problem hiding this comment.
Could we avoid deciding whether to retry from regexes over the combined console output? Provider wording can change, and unrelated output could contain one of these strings. A structured error or exit code from the launch layer would make this classification more reliable.
There was a problem hiding this comment.
Addressed in 65677ba. The launch script now emits an exact nemoclaw.e2e.launch-failure=provider-unavailable marker only from the missing-turn boundary after checking its bounded PTY diagnostic. The TypeScript retry decision requires that exact marker; raw provider wording in combined output no longer triggers a retry, and terminal auth/policy/invalid-response diagnostics still veto it.
| if (result.exitCode === 0) return result; | ||
| finalFailure = result; | ||
| providerUnavailable = isTransientProviderAvailabilityFailure(result); | ||
| if (!providerUnavailable) break; |
There was a problem hiding this comment.
Could we add a short backoff here, and honor Retry-After when it is available, before starting the second attempt? Retrying immediately is likely to hit the same correlated provider outage, so this may only help with isolated per-request failures.
There was a problem hiding this comment.
Addressed in 65677ba with a fixed one-second delay before the second attempt, covered with fake timers. This PTY boundary does not expose a structured Retry-After header, so the change intentionally does not parse arbitrary console text for one; doing that would recreate the classification fragility from the adjacent finding.
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
|
PR Review Advisor finished for commit |
Outcome
OpenClaw security E2E launch turns now retry one positively recognized transient provider-availability failure in a fresh session after a short backoff. Exhausted provider attempts report provider unavailability explicitly, while security-evidence, authentication, policy, invalid-response, and unknown failures remain fail-closed without retry.
Reason
A transient NVIDIA hosted-inference
ServiceUnavailableErrorcan leave the launch session with no assistant evidence, causing the OpenClaw security target to look like a posture failure even though the provider was unavailable.Related issues
Fixes #10978
Changes
ServiceUnavailableor HTTP 5xx output without terminal auth, policy, or invalid-response evidence.Verification
./node_modules/.bin/vitest run --project e2e-support test/e2e/support/launch-agent-turn.test.ts test/e2e/support/launch-agent-turn-provider-availability.test.ts— 28 tests passed, 25 skipped.npx tsx scripts/checks/e2e-mock-parity.mts --base origin/main --head HEAD— passed.npm run e2e:assertions:check— passed with no assertion-ratchet growth.pre-commithooks — passed, including repository checks, E2E assertion census, growth guardrails, Oxfmt, Oxlint, gitleaks, and commitlint.pre-pushhooks — affected CLI TypeScript check passed.5bf10d6590ba35f4169f1fb9762c324781562537,2c6c6870208b2c0c64ff8bc30e3dab3f04f20c60, and65677babd90a36043ebc8bf1c21bd9d08dcc2848are Verified (valid).Review notes
This PR is intentionally a draft so the implementation is not held only in a local worktree. Before it is marked ready, it must be rebased and revalidated on the exact
origin/mainbaseline after #11071 and #10996 merge. The supported local PR Review Advisor must also run whenPR_REVIEW_ADVISOR_API_KEYis available; it is not currently exported in the task environment.Signed-off-by: Charan Jagwani cjagwani@nvidia.com