Skip to content

test(e2e): report one failed agent among three and correct the lifecycle test guides - #13483

Merged
cv merged 2 commits into
v1from
test/12734-lifecycle-multi-agent
Oct 21, 2026
Merged

cv merged 2 commits into
v1from
test/12734-lifecycle-multi-agent

Conversation

@gaveezy

@gaveezy gaveezy commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Failure

#12734 asks for system tests of multi-agent deployments and how their failures are reported, and for the scenarios to be recorded before live work starts. Two gaps stood in the way.

One agent failing among several was untested. The fake OpenShell gateway applied its start fault (configuration_error) to every sandbox and recorded exec calls without their target sandbox. No test could reject one agent's start while another's succeeded in the same apply, or check which sandboxes received a start or stop.

The lifecycle filter and the test guides had drifted from the code:

Decision

No production code changes.

One failed agent among three

  • Fixture (nemoclaw-test-fixtures/src/openshell.rs): State gains two fields. Both start empty, so existing tests see unchanged behavior.

    • configuration_error_for is a start rejection keyed by sandbox name. The fabric-agent-ctl start arm checks it before configuration_error.
    • exec_sandboxes holds each exec call's target sandbox, parallel to exec_calls, at both places exec calls are recorded.
  • Test: multi_agent::one_failed_agent_is_reported_alone_and_its_retry_replaces_only_it applies three OpenClaw sandboxes cloned from examples/fabric-openclaw.yaml: assistant, researcher and reviewer. It then narrows the researcher's and reviewer's tools, which replaces both sandboxes, and Fabric rejects only the reviewer's start. On that update, the test checks:

    • The bundled CLI's apply -o json exits 1 and names only sandbox/reviewer.
    • The CLI's output leaves out Fabric's message, and diagnostics/fabric-reviewer.json keeps it.
    • The researcher's replacement finishes, and its new agent runs.
    • The assistant keeps its sandbox id and configuration. It is not stopped and gets no start or stop.

    After the fault clears, the test checks the retry:

    • The plan replaces only the reviewer's sandbox and creates its agent.
    • After the apply, the CLI export equals the document and a reapply changes nothing.
    • The CLI destroy empties the gateway.
  • Why an update: the failure is injected on an update so that the assistant's agent is already running. The test can then check that a sibling's failure neither stops, restarts nor replaces it.

  • Retry plan: it holds two changes, not three. The failed apply already updated terraform_data.agent_reviewer and recorded no fabric_agent.reviewer.

  • In deployment.rs, Lifecycle and the helpers the new module uses become pub(crate), like registry_fixture's shared items. The module is registered in tests/main.rs and the lifecycle profile.

The test passed on its first run against a bundle whose production code matches origin/v1, so it adds coverage and found no defect.

Lifecycle filter and test guides

  • Remove the two inert filter terms and correct each statement against the code.
  • The OpenShift-profile and registry tests still run the deploy, export, and destroy flow that the removed agent test described, through deploy_image_and_export. live-tests.md now attributes that flow to them and adds a separate paragraph on the OIDC test: the stand-in issuer in nc-issuer-*, the token supplied through tokenEnv, refusal of a token for another audience without echoing it, export, and retained storage.
  • testing.md and integration-tests.md list and describe multi_agent.
  • Omissions that are not errors, such as contract modules no guide lists, are left for a later change.

Editing .config/nextest.toml selects the live-docker and live-kind suites in this PR's CI through .config/determinator-live.toml.

Validation

All checks ran on linux_arm64.

  • cargo ci --full passed: tools, fmt, clippy, build, test (1600 passed), schema, bundle, and lifecycle (151 passed, 98.8 s wall with 8 workers; multi_agent 12.9 s), within budget.
  • Before adding multi_agent, cargo nextest list --profile lifecycle --run-ignored only listed the same 150 tests with origin/v1's nextest.toml and with the corrected one. Replacing helm_recovery with an unmatched term in a scratch copy of the config dropped 9 tests, so the comparison detects a lost term.
  • cargo nextest list --profile live-kind --run-ignored only lists 4 kubernetes_live and 3 kubernetes_chart tests, as the corrected guides say.
  • NEMOCLAW_TEST_BUNDLE=$PWD/dist/linux_arm64 cargo test -p nemoclaw-e2e --test integration -- --ignored multi_agent:: passed in 4 of 4 runs.
  • Each of these temporary mutations made multi_agent fail. All were reverted.
    • The global fault in place of the reviewer's: the output named sandbox/researcher, so the test depends on the per-sandbox fault.
    • The researcher left unchanged.
    • A rejected start that stops every running agent.
    • A fault without Fabric's message.
    • A retry that also changes the assistant.
    • An export compared with the old document.
  • With NEXTEST_TEST_THREADS=4, lifecycle partitions 1/2 and 2/2 passed in 133.9 s and 107.1 s wall against 300 s; multi_agent took 18.3 s against the 90 s per-test limit. These are local times and do not predict CI runner times directly.
  • cargo run -p nemoclaw-build -- docs --check and git diff --check pass.
  • On a single-node k3s v1.36.5 cluster (linux_arm64) with Agent Sandbox v0.5.0, the live-kind profile without the kind-only registry test passed: kubernetes_live::the_gateway_installs_authenticates_and_is_removed_keeping_storage, kubernetes_live::on_openshift_the_sandbox_runs_as_the_namespace_uid, kubernetes_live::oidc::a_managed_gateway_accepts_an_existing_issuers_tokens_and_refuses_another_audience, and the three kubernetes_chart tests. The agent was the Pi image from v1 CI's live-images-linux_arm64 artifact for d33d50647, imported into k3s by digest. 6 passed in 78 s.

Deferred to CI:

  • cargo run -p nemoclaw-build -- fern check stops at npm ci because Node.js is not installed on this host. Its Rust docs and schema checks pass.
  • The live-docker suite, and live-kind on kind including kubernetes_live::registry, which need Docker.
  • Darwin and Windows lifecycle times. They are reported there but not enforced, and the new test adds about 15 s per platform.

🤖 Generated with Claude Code

…cle test guides

## Failure

#12734 asks for system tests of multi-agent deployments and how their failures are reported, and for the scenarios to be recorded before live work starts. Two gaps stood in the way.

**One agent failing among several was untested.** The fake OpenShell gateway applied its start fault (`configuration_error`) to every sandbox and recorded exec calls without their target sandbox. No test could reject one agent's start while another's succeeded in the same apply, or check which sandboxes received a `start` or `stop`.

**The lifecycle filter and the test guides had drifted from the code**:

- `.config/nextest.toml` still selected `sandbox_readiness::` and `inference_discovery::`, whose files #13379 and #13291 deleted.
- `testing.md` listed those modules but not `travel_example` and `travel_team_example`. It named `nemoclaw-runtime` as a live-docker package after #13457 removed its test, said the live suites build OpenClaw on AMD64 (Deep Agents since #13369), said live-kind runs one test at a time, and showed contract-binary budgets that `.config/test-budgets.yaml` no longer has.
- `live-tests.md` described `an_agent_sandbox_starts_and_destroy_keeps_storage`, which #13414 replaced with `kubernetes_live::oidc`, a test no contributing guide described. It also implied that only `NEMOCLAW_KEEP_KIND_CLUSTER=1` keeps the cluster.
- `integration-tests.md` listed four openshell-provider modules under nemoclaw-provider (moved by #13187), `runtime_image` (renamed `host_image` by #13223), and the Fabric types `fabric_agent` and `fabric_harnesses` as if they were modules. It kept the `inference_discovery` system module and the Helm recovery tests that #13373 removed: `receipt`, `release_record`, and the second-destroy test. It also presented `fabric_bridge`, which is not ignored, as a lifecycle test.
- `live_kind.rs` said the cluster is kept only after a failed run; it is kept on either outcome.

## Decision

No production code changes.

### One failed agent among three

- **Fixture** (`nemoclaw-test-fixtures/src/openshell.rs`): `State` gains two fields. Both start empty, so existing tests see unchanged behavior.
  - `configuration_error_for` is a start rejection keyed by sandbox name. The `fabric-agent-ctl` `start` arm checks it before `configuration_error`.
  - `exec_sandboxes` holds each exec call's target sandbox, parallel to `exec_calls`, at both places exec calls are recorded.
- **Test**: `multi_agent::one_failed_agent_is_reported_alone_and_its_retry_replaces_only_it` applies three OpenClaw sandboxes cloned from `examples/fabric-openclaw.yaml`: assistant, researcher and reviewer. It then narrows the researcher's and reviewer's tools, which replaces both sandboxes, and Fabric rejects only the reviewer's start. On that update, the test checks:
  - The bundled CLI's `apply -o json` exits 1 and names only `sandbox/reviewer`.
  - The CLI's output leaves out Fabric's message, and `diagnostics/fabric-reviewer.json` keeps it.
  - The researcher's replacement finishes, and its new agent runs.
  - The assistant keeps its sandbox id and configuration. It is not stopped and gets no `start` or `stop`.

  After the fault clears, the test checks the retry:
  - The plan replaces only the reviewer's sandbox and creates its agent.
  - After the apply, the CLI export equals the document and a reapply changes nothing.
  - The CLI destroy empties the gateway.
- **Why an update**: the failure is injected on an update so that the assistant's agent is already running. The test can then check that a sibling's failure neither stops, restarts nor replaces it.
- **Retry plan**: it holds two changes, not three. The failed apply already updated `terraform_data.agent_reviewer` and recorded no `fabric_agent.reviewer`.
- In `deployment.rs`, `Lifecycle` and the helpers the new module uses become `pub(crate)`, like `registry_fixture`'s shared items. The module is registered in `tests/main.rs` and the `lifecycle` profile.

The test passed on its first run against a bundle whose production code matches `origin/v1`, so it adds coverage and found no defect.

### Lifecycle filter and test guides

- Remove the two inert filter terms and correct each statement against the code.
- The OpenShift-profile and registry tests still run the deploy, export, and destroy flow that the removed agent test described, through `deploy_image_and_export`. `live-tests.md` now attributes that flow to them and adds a separate paragraph on the OIDC test: the stand-in issuer in `nc-issuer-*`, the token supplied through `tokenEnv`, refusal of a token for another audience without echoing it, export, and retained storage.
- `testing.md` and `integration-tests.md` list and describe `multi_agent`.
- Omissions that are not errors, such as contract modules no guide lists, are left for a later change.

Editing `.config/nextest.toml` selects the live-docker and live-kind suites in this PR's CI through `.config/determinator-live.toml`.

## Validation

All checks ran on linux_arm64.

- `cargo ci --full` passed: tools, fmt, clippy, build, test (1600 passed), schema, bundle, and lifecycle (151 passed, 98.8 s wall with 8 workers; `multi_agent` 12.9 s), within budget.
- Before adding `multi_agent`, `cargo nextest list --profile lifecycle --run-ignored only` listed the same 150 tests with `origin/v1`'s `nextest.toml` and with the corrected one. Replacing `helm_recovery` with an unmatched term in a scratch copy of the config dropped 9 tests, so the comparison detects a lost term.
- `cargo nextest list --profile live-kind --run-ignored only` lists 4 `kubernetes_live` and 3 `kubernetes_chart` tests, as the corrected guides say.
- `NEMOCLAW_TEST_BUNDLE=$PWD/dist/linux_arm64 cargo test -p nemoclaw-e2e --test integration -- --ignored multi_agent::` passed in 4 of 4 runs.
- Each of these temporary mutations made `multi_agent` fail. All were reverted.
  - The global fault in place of the reviewer's: the output named `sandbox/researcher`, so the test depends on the per-sandbox fault.
  - The researcher left unchanged.
  - A rejected start that stops every running agent.
  - A fault without Fabric's message.
  - A retry that also changes the assistant.
  - An export compared with the old document.
- With `NEXTEST_TEST_THREADS=4`, lifecycle partitions 1/2 and 2/2 passed in 133.9 s and 107.1 s wall against 300 s; `multi_agent` took 18.3 s against the 90 s per-test limit. These are local times and do not predict CI runner times directly.
- `cargo run -p nemoclaw-build -- docs --check` and `git diff --check` pass.

Deferred to CI:

- `cargo run -p nemoclaw-build -- fern check` stops at `npm ci` because Node.js is not installed on this host. Its Rust docs and schema checks pass.
- The live-docker and live-kind suites, which need Docker.
- Darwin and Windows lifecycle times. They are reported there but not enforced, and the new test adds about 15 s per platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

v1 now builds the Pi agent image on every platform (#13569 and the
Bake image changes), so this branch's correction to "Pi on ARM64 or
Deep Agents on AMD64" is stale:

- docs/contributing/live-tests.md conflicted on that sentence; keep
  v1's "The runner builds Pi".
- docs/contributing/testing.md merged cleanly but kept this branch's
  "Pi on ARM64, Deep Agents on AMD64" for the live-docker step; it now
  says "the Pi agent image", matching live_images::agent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gaveezy added a commit that referenced this pull request Oct 21, 2026
Bring in #13483's merge of v1 (98b2a8d), so this branch carries the
same resolution of docs/contributing/live-tests.md and would not conflict
with v1 once #13483 merges. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cv
cv merged commit 5b1b48a into v1 Oct 21, 2026
@cv
cv deleted the test/12734-lifecycle-multi-agent branch October 21, 2026 22:13
gaveezy added a commit that referenced this pull request Oct 22, 2026
#13483 merged into v1 as a squash (5b1b48a), so this branch
and v1 held the same changes in different commits, and the
merge conflicted in crates/nemoclaw-e2e/tests/multi_agent.rs and
docs/contributing/integration-tests.md. The squash matches #13483's
final head (98b2a8d) in every file it touched, so each conflicted
file was merged three ways with that head as the base: this branch's
own change on one side and v1's later changes on the other. The result
differs from v1 by exactly this pull request's own commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gaveezy added a commit that referenced this pull request Oct 22, 2026
#13483 merged into v1 as a squash (5b1b48a), so this branch and v1
held the same changes in different commits, and the merge conflicted
in .config/nextest.toml, crates/nemoclaw-e2e/tests/deployment.rs,
docs/contributing/integration-tests.md and
docs/contributing/testing.md. The squash matches #13483's final head
(98b2a8d) in every file it touched, so each conflicted file was
merged three ways with that head as the base: this branch's own change
on one side and v1's later changes on the other. The result differs
from v1 by exactly this pull request's own commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gaveezy added a commit that referenced this pull request Oct 22, 2026
docs/contributing/live-tests.md conflicted with #13483 (5b1b48a) in two
places:

- The shared Kind flow: #13483 corrected the old one-agent description;
  this branch replaces it with the three-agent flow, its request rounds
  and the stub. Keep this branch's text.
- The end of the Kubernetes section: #13483 added the OIDC test's
  paragraph, and this branch rewords the "request no inference"
  sentence for the stub. Keep both: the OIDC paragraph, then this
  branch's sentence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wscurran wscurran added area: docs Documentation, examples, guides, or docs build area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance labels Oct 23, 2026
@wscurran wscurran added the v1 NemoClaw v1 branch label Oct 28, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation, examples, guides, or docs build area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants