Skip to content

fix(e2e): retain launch diagnostics and bound inference availability retries - #12389

Merged
rsliter merged 14 commits into
mainfrom
codex/brev-publication-failure
Sep 29, 2026
Merged

rsliter merged 14 commits into
mainfrom
codex/brev-publication-failure

Conversation

@jyaunches

@jyaunches jyaunches commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Outcome

Readiness-publication failures now retain fixed stage and reason labels instead of discarding their cause. Brev E2E retains safe inference diagnostics and retries narrowly classified transient provider failures within fixed limits. The launch harness avoids login-shell logout hooks that can break cleanup and prevent an otherwise eligible retry.

Reason

The original Brev failure occurred during readiness publication after image construction, onboarding, and inference passed. The retained generic error could not establish its root cause. Readiness has passed in subsequent diagnostic runs; this PR does not claim to have proven or fixed that original cause.

Subsequent runs exposed HTTP 503 responses, an overly restrictive provider-error classifier, and a cleanup failure that prevented retries. The sixth run retained local: can only be used in a function followed by mode: unbound variable in both cleanup calls. Ubuntu Bash 5.1 with a failing .bash_logout reproduces that exact failure. The host harness is self-contained and now uses bash -c with its supplied environment.

Changes

  • Map publication authority, final observation, storage, lock, and clock failures to fixed diagnostic labels. Print them in the existing CLI failure path without exposing raw exception text.
  • Retain allowlisted empty-assistant metadata for JSONL and SQLite sessions. Unknown provider details remain unclassified. Reuse the focused diagnostic from test(security): cover credentials added to reference-only auth profiles #12314.
  • Reuse the shared bounded-retry helper for the stateless arithmetic probe: retry only exact curl HTTP 503 failures once after five seconds. Preserve separate attempt artifacts and log aggregate evidence before artifact writing.
  • Recognize structured managed-inference HTTP 503 without requiring a provider-specific exception prefix. Keep authentication, policy, conflicting error classes, malformed evidence, and cleanup failures terminal.
  • Retain bounded cleanup diagnostics and execute baseline and PTY cleanup independently. Invoke the host harness without login/logout files. Successful cleanup remains mandatory before the existing two-attempt launch retry.
  • Extend existing support tests for redaction, retry eligibility, recovery, exhaustion, artifact-write failure, fatal cleanup, and a failing logout hook. Live acceptance still requires two nonempty user/assistant turn pairs per successful launch.

Verification

  • Focused readiness, observation-timing, connect-flow, and lease-storage tests: 175 passed across four files.
  • Session-evidence classifier suite: 66 passed, with before-fix reproductions for JSONL and SQLite HTTP 503 records.
  • Inference-probe support suite: 29 passed, including retry exhaustion, recovery, and failed artifact writes.
  • vitest run --project e2e-support test/e2e/support/launch-agent-turn.test.ts: 6 passed on macOS; 40 Linux cases skipped. The socket test passed across the required execution boundary after sandbox isolation blocked its first attempt.
  • Isolated Linux tests using the real producer and support fixture with Ubuntu Bash 5.1.16: the prior login-shell invocation reproduces the live cleanup failure; the repaired invocation cleans up and succeeds on its second attempt; a genuine cleanup denial still stops after one attempt. No PTY or host-process residue remained in the recovery case.
  • Third Brev run: arithmetic HTTP 503 recovered on its second attempt. Structured launch HTTP 503 supplied the classifier regression evidence.
  • Sixth Brev run: image build, fresh-boot qualification, exact clean provenance, onboarding, arithmetic inference, readiness, and first logical launch passed. Second launch exposed the logout/cleanup failure repaired here. Brev workspace absence was verified.
  • Seventh Brev run passed on 006d984: the image producer, fresh-boot qualification, exact clean provenance, and full E2E passed. The temporary Brev workspace was verified absent.
  • Follow-up support tests after updating three stale shell-argument expectations and integrating the current base: 151 passed on macOS (41 Linux-only skips); all 192 cases passed on Linux after supplying the generated shared JavaScript outputs. The stale assertion was reproduced before correction. The four readiness-related files also passed all 175 tests after the base update.
  • Diff inspection: no secrets, API keys, credentials, or unrelated feature changes. Normal publication validation and all three TypeScript pre-push checks passed for 655c06b5d9. Current-head hosted CI and review are pending.

Review notes

All ordinary CI and all nine Advisor specialists passed for 7c5a399. Every specialist summary, finding ledger, and E2E recommendation was read, along with paginated PR comments, reviews, and inline comments. There were no actionable findings. Earlier valid Advisor findings about log-retention order and documentation were repaired and reviewed in that candidate.

The logout repair has local before/after and denial evidence plus a successful live Brev run. Its initial ordinary CI failures were three stale -lc assertions; the follow-up changes them to -c. Local Docker Advisor completed all nine specialists with no findings for the final tree of 655c06b5d9db4b82181aa293b9d0b914232c358e against 946fb1611be605f14af3bc7a78d964c0b331463f. Its disposable snapshot tree d67ef1e59bc86496339b6d0279811863ea34651f was verified identical to the candidate; all summaries, finding ledgers, and E2E recommendations were read. Review sandboxes and gateway were cleaned up. Current-head hosted CI and review are pending. The PR remains a draft; no merge approval is claimed.


Signed-off-by: Julie Yaunches jyaunches@nvidia.com

Summary by CodeRabbit

  • Bug Fixes
    • Launch-readiness failures now include a diagnostic stage and a safe, classified reason when available, making failures easier to understand without exposing sensitive error details.
    • Live inference checks now retry once after a specific temporary service-unavailable response. Other failures remain non-retryable, and availability evidence is retained even if writing an artifact fails.
    • Launch cleanup now reports progress and continues independent cleanup steps when one fails.

@jyaunches jyaunches self-assigned this Sep 28, 2026
@copy-pr-bot

copy-pr-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/NemoClaw/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a9b53dcc-c280-48af-9d9b-31b09a5865fc

📥 Commits

Reviewing files that changed from the base of the PR and between 655c06b and e09e164.

📒 Files selected for processing (4)
  • test/e2e/README.md
  • test/e2e/live/launch-agent-turn.ts
  • test/e2e/support/launch-agent-turn-host-input.test.ts
  • test/e2e/support/launch-agent-turn.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/README.md

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The changes add classified diagnostics for launch-readiness publication failures, a bounded retry for the live inference probe, and expanded provider-error evidence and cleanup handling for launch-agent turns.

Changes

Launch-readiness publication diagnostics

Layer / File(s) Summary
Classify and attach publication diagnostics
src/lib/state/launch-readiness-lease.ts, src/lib/state/launch-readiness-lease.test.ts, src/lib/actions/sandbox/launch-readiness.ts
Publication failures can include a stage and classified reason. The classifier maps recognized store and publication errors to fixed labels.
Verify and report publication diagnostics
src/lib/actions/sandbox/launch-readiness-observation-timing.test.ts, src/lib/actions/sandbox/launch-readiness.test.ts, src/lib/actions/sandbox/connect.ts, src/lib/actions/sandbox/connect-flow.test.ts
Tests assert diagnostic values for publication failures. Connect prints the stage and reason when present.

Full E2E inference probe

Layer / File(s) Summary
Add bounded retry and evidence retention
test/e2e/live/full-e2e-inference-probe.ts, test/e2e/support/full-e2e-inference-probe.test.ts
The probe retries once after five seconds only for the specified curl HTTP 503 result. It logs availability evidence before writing the attempt artifact.
Use retry flow in the live probe
test/e2e/live/full-e2e.test.ts, test/e2e/README.md
The live test uses the retry runner and attempt-specific artifacts. The README describes retry conditions, request limits, and evidence retention.

Launch-agent provider evidence and cleanup

Layer / File(s) Summary
Normalize provider errors and classify availability
test/e2e/live/launch-agent-turn.ts, test/e2e/support/launch-agent-turn-session-evidence.test.ts
JSONL and SQLite messages include normalized failure metadata. Provider-unavailability classification and tests cover structured HTTP 503 cases and diagnostic redaction.
Track cleanup and use non-login Bash
test/e2e/live/launch-agent-turn.ts, test/e2e/support/launch-agent-turn.test.ts, test/e2e/support/e2e-clients.test.ts, test/e2e/support/launch-agent-turn-readiness-lease.test.ts, test/e2e/README.md
Cleanup records evidence status and attempts baseline and PTY cleanup independently. The launch command uses non-login Bash, with tests for cleanup failures and logout-hook behavior.
Verify launch-session host inputs
test/e2e/support/launch-agent-turn-host-input.test.ts, test/e2e/support/launch-agent-turn.test.ts
Tests cover relative OpenShell command paths and temporary-root resolution from TMPDIR values.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant FullE2ETest
  participant runFullE2eInferenceCommand
  participant sandbox.exec
  participant retainFullE2eInferenceAvailability
  participant artifactWriter
  FullE2ETest->>runFullE2eInferenceCommand: run inference attempt
  runFullE2eInferenceCommand->>sandbox.exec: execute command
  sandbox.exec-->>runFullE2eInferenceCommand: command result
  runFullE2eInferenceCommand->>retainFullE2eInferenceAvailability: report retry evidence
  retainFullE2eInferenceAvailability->>artifactWriter: write attempt artifact
  runFullE2eInferenceCommand->>sandbox.exec: retry exact HTTP 503 result after five seconds
Loading

Suggested reviewers: ericksoa, prekshivyas

Merge Risk: ⚪ Minimal · up to e09e1

The selected changes mainly harden E2E diagnostics and cleanup and do not introduce a concrete production-facing risk. Normal CI checks should still run before merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 16 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: retaining launch diagnostics and bounding inference availability retries.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 16 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit e09e164 in the codex/brev-publicati... branch remains at 96%, unchanged from commit 63002cd in the main branch.

Show a line coverage summary of the most impacted files.
File main 63002cd codex/brev-publicati... e09e164 +/-
nemoclaw/src/onboard/config.ts 98% 96% -2%
nemoclaw/src/index.ts 94% 93% -1%
nemoclaw/src/co.../config-show.ts 100% 100% 0%
nemoclaw/src/commands/slash.ts 100% 100% 0%
nemoclaw/src/on...native-route.ts 0% 100% +100%

TypeScript / code-coverage/cli

The overall line coverage in commit e09e164 in the codex/brev-publicati... branch is 85%. The line coverage in commit 63002cd in the main branch is 84%.

Show a line coverage summary of the most impacted files.
File main 63002cd codex/brev-publicati... e09e164 +/-
src/lib/actions.../status-text.ts 84% 46% -38%
src/lib/inferen...er-lifecycle.ts 77% 70% -7%
src/lib/onboard...ma-inference.ts 86% 80% -6%
src/lib/onboard...al-inference.ts 84% 90% +6%
src/lib/inferen...file/cleanup.ts 73% 80% +7%
src/lib/state/p...l-retirement.ts 79% 89% +10%
src/lib/readine...y-production.ts 76% 90% +14%
src/lib/onboard.../application.ts 55% 72% +17%
src/lib/onboard...mage/catalog.ts 69% 90% +21%
src/lib/securit...ig-structure.ts 0% 94% +94%

Updated September 29, 2026 17:23 UTC

@jyaunches jyaunches changed the title fix(sandbox): report safe launch-readiness publication failures fix(sandbox): retain safe readiness and launch failure diagnostics Sep 28, 2026
@jyaunches jyaunches changed the title fix(sandbox): retain safe readiness and launch failure diagnostics fix(e2e): retain launch diagnostics and bound inference availability retries Sep 28, 2026
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
The cleanup fix changed bash -lc to bash -c, leaving three stale caller
assertions. Reproduced the fixture failure, then updated those expectations.
Focused E2E support tests pass: 151 passed, 41 Linux-only skips on macOS.

Integrate main for its current dependency lockfile and trusted validator.

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Main changed the workflow validators during publication. Integrate those
trusted definitions before retrying publication; the PR behavior is unchanged.
The merged connect path and readiness suites pass all 175 focused tests.

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
jyaunches added a commit that referenced this pull request Sep 29, 2026
## Outcome

Rebalance the existing stable CLI test shards so the current main test
roster satisfies the unchanged 5.5% load limit. The busiest shard's
estimated load falls from 1,257,861 ms (5.67% above average) to
1,219,489 ms (2.45% above average).

## Reason

PR #12389's original shell-argument assertion failures are fixed, but
its CI now hits an inherited failure in
`test/repository/cli-coverage-sequencer.test.ts`. Running the same test
on current main `946fb1611be605f14af3bc7a78d964c0b331463f` reproduces
the exact failure: `1257861` exceeds `1255812.65625`. This dependency
isolates the main repair from the Brev readiness work.

The fixed hash assignment no longer balances the expanded roster within
the existing bound. The current-roster test detected it; its bound and
the independent serialized integration-lane bound remain intact.

### Related issues

Refs #6237. Unblocks #12389 after maintainer merge.

## Changes

- Recalibrate the CLI lane salt from `959` to `15873`, using the
existing timing hints and current 2,500-file roster. Integration and
E2E-support assignments stay unchanged.
- Update the pinned CLI ownership fixture for the intentional remapping.
Membership remains independent of other files' additions, removals, and
timing weights.

## Verification

- Exact-base reproduction — 12 passed, 1 failed with the same CI
assertion.
- `vitest run --project integration
test/repository/cli-coverage-sequencer.test.ts` — all 13 passed after
repair, including both balance bounds, unique assignment, deterministic
order, and roster-stability checks.
- `git diff --check` — passed.
- Diff contains no secrets, API keys, or credentials.

## Review notes

All nine local Docker Advisor specialists cleared the prepared candidate
tree `fe7f787b8ae98810c8d55b3db9f13f91509a697a` against base
`946fb1611be605f14af3bc7a78d964c0b331463f`. Every summary, finding
ledger, and E2E receipt was inspected; none has findings or additional
E2E recommendations. The deterministic risk plan selects no live E2E
jobs for this test-only change. Reports are retained locally; review
sandboxes and gateway were verified gone. Normal publication validation
and all three TypeScript pre-push checks passed for
`cef57c75ae5ddf6b1a84e56c3c2e14e33cf8dd12`. The remote branch matches
that signed candidate; hosted CI and automated review are pending. This
PR remains a draft until automated evaluation completes. Human review
and merge are separate maintainer actions.

---
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>

---------

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Consume merged dependency #12479 and resolve the launch-evidence conflict
with #11870. Preserve bounded diagnostic history together with the
provider-status tracking and non-login launch shell.

The integrated tree passes 276 Linux E2E support tests, 175 readiness
unit tests, and 13 shard allocation tests. The live Brev pass on 006d984
remains prior-head evidence; hosted checks will evaluate this new head.

Move the existing host-input tests to a focused file after combined
upstream coverage exceeded the per-file size budget. Preserve every
assertion; project membership and growth checks pass.

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Name the implementation helper as the parsing and retry owner and the
support test as its regression evidence. Verified against the helper
exports; no runtime behavior changes.

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
@jyaunches
jyaunches marked this pull request as ready for review September 29, 2026 17:01
@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit e09e164. Include the Advisor findings in the complete PR feedback collection. Verify and group valid findings before repair.

Request review only when Require no Advisor blockers is green.

All previous runs

@rsliter rsliter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed e09e164 against base 815ad8e.

The availability retries are bounded to two attempts and require exact, structured transient evidence. Authentication, policy, malformed-response, transport, cleanup, and unknown failures remain terminal. Launch cleanup independently attempts baseline and PTY removal, suppresses the retry marker on cleanup failure, and avoids login/logout hooks. Publication and empty-message diagnostics retain only fixed or allowlisted metadata, with regression coverage for secret-bearing and unknown values.

Security review: PASS across credentials, input validation, authorization, dependencies, error handling, cryptography, configuration, tests, and system safety. Current-head CI is green, including CLI shards, ShellCheck, CodeQL, rootless Linux, direct managed startup, Staging QA, and both exact all-agent activation jobs.

No blocking findings.

@rsliter
rsliter merged commit 327ce0a into main Sep 29, 2026
94 checks passed
@rsliter
rsliter deleted the codex/brev-publication-failure branch September 29, 2026 17:44
@wscurran wscurran added the area: e2e End-to-end tests, nightly failures, or validation infrastructure label Oct 14, 2026
@wscurran wscurran added area: observability Logging, metrics, tracing, diagnostics, or debug output bug-fix PR fixes a bug or regression integration: openclaw OpenClaw integration behavior labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: e2e End-to-end tests, nightly failures, or validation infrastructure area: observability Logging, metrics, tracing, diagnostics, or debug output bug-fix PR fixes a bug or regression integration: openclaw OpenClaw integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants