Skip to content

test: cover fail-closed middleware in the docker-dummy live case - #14515

Merged
cv merged 1 commit into
v1from
fix/14338-support-openshell-network-middleware-bin
Nov 17, 2026
Merged

cv merged 1 commit into
v1from
fix/14338-support-openshell-network-middleware-bin

Conversation

@deepujain

@deepujain deepujain commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

The docker-dummy live case now checks that a fail_closed middleware binding blocks a sandbox request when the middleware service fails.

Problem

Part of #14338.

#14343 let explicit sandbox policies carry OpenShell middleware bindings, and #14441 made the docker-dummy live case check allow, deny and excluded-destination effects. Nothing in a live run made the middleware service fail, so the issue's last live criterion, that the configured failure behavior applies when the service fails, was untested. The case's binding sets on_error: fail_closed, so a broken guard should stop traffic, not let it through. If OpenShell let the request through or NemoClaw dropped the setting, no test would notice.

Change

  • The live guard in nemoclaw-test-fixtures answers a request to /fail with a service error, after recording it as it does for every request.
  • The middleware run block in docker-dummy.tftest.hcl sends a fourth request, to /fail, last, so no later request depends on how the supervisor treats a failed service. It must return 403.
  • The run block checks three effects. The allow and deny counts stay exact. The middleware must be called at least once for /fail; the count is a floor because OpenShell may call a failing service more than once. The recorder must still see only /allow and /bypass, so neither the denied nor the failed request arrives.
  • The case document and the live test guide describe the new request.
  • Left out on purpose: a fail_open run. It needs a second binding on a different destination, and the case has only the two addresses it already uses. The provider's unit tests already treat a change of on_error to fail_open as drift.
  • Left out for this change: the export and reapply of the binding on the live deployment. The export/reapply integration journey from test: cover middleware effects and export #14441 covers it on its own deployment, and this case's unchanged plan covers unchanged reconciliation. This PR leaves [GTC DC] Support OpenShell network middleware bindings in v1 sandbox policies #14338 open for a maintainer to decide whether those two meet the issue's last live criterion.

Beyond CI

I did not run cargo ci live-docker: this environment has no reachable Docker daemon and cannot fetch the OpenShell dependencies, so the Rust crate was not built here either. What I ran: rustfmt --check on the changed Rust file, tofu fmt -check on the test file, and the new HCL conditions evaluated with OpenTofu against a sample effects file. Per OpenShell's source at the pinned revision, a failed fail-closed middleware gets the same 403 as a denial, so the new /fail assertions rest on that reading until the live Docker lane runs them.

Summary by CodeRabbit

  • Documentation

    • Clarified that requests are blocked when middleware encounters an error and the binding is configured to fail closed.
    • Updated the live-test guidance to describe this scenario and its expected response.
  • Tests

    • Expanded the Docker dummy scenario to cover middleware errors, verify the expected 403 response, and confirm the request does not reach the destination.

The `docker-dummy` live case now shows that a `fail_closed` middleware binding blocks a request when the middleware service errors, so the destination never receives it.

The live guard answers requests to `/fail` with a service error. The sandbox sends that request last, after the allow, deny and excluded requests. The sandbox must get a 403, the middleware must be called at least once for `/fail`, and the recorder must not see it.

Part of #14338. Follows #14343 and #14441.

Signed-off-by: Deepak Jain <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 17, 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.

@github-actions

Copy link
Copy Markdown
Contributor

@deepujain
deepujain marked this pull request as ready for review November 17, 2026 01:12
@deepujain

Copy link
Copy Markdown
Collaborator Author
Authoring session — opening
Field Status Value Evidence or limit
Harness partial Cursor agent Product name from the session's system prompt; the version is not shown to the session.
Skills partial issue-launch (complete read); nemoclaw-v1 adapter (complete read); pr-review (injected); humanizer (first 80 lines read); nemoclaw-contributor-implement-issue and nemoclaw-contributor-create-pr (complete read) Reads and injections visible in the conversation up to the cutoff; the explain-product-impact skill was not opened.
Instruction files partial AGENTS.md (injected, complete); WRITING.md (not read); .github/PULL_REQUEST_TEMPLATE.md and .github/SESSION_REPORT_TEMPLATE.md (complete read) Startup injections beyond AGENTS.md are not visible to the session.
Tool calls unavailable - The session cannot read its own persisted tool record; a count from memory would be a guess.
Tokens unavailable - Token counters are not exposed to the session.
Session window partial 2026-11-16T16:42 to 17:23 (UTC-8); about 41 min First and latest turn timestamps in the conversation; idle time is included.
Compactions unavailable - No compaction event is visible, and the persisted record is not readable from the session.
Models partial Claude Sonnet 5.5 Model named in the session's system prompt; changes are not recorded there.
Reasoning levels unavailable - Reasoning-level history is not exposed to the session.

@deepujain

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The middleware fixture returns an internal service error for /fail. The Docker dummy end-to-end test checks that the fail-closed binding returns 403 and that the request does not reach the destination. Scenario comments and live-test documentation describe this case.

Changes

Fail-closed middleware error coverage

Layer / File(s) Summary
Middleware fixture error response
crates/nemoclaw-test-fixtures/src/middleware.rs
The fixture records /fail requests and returns an internal service error for that path. /deny continues to return a denial, and other paths continue to be allowed.
Docker dummy failure-path test
crates/nemoclaw-e2e/cases/docker-dummy.yaml, crates/nemoclaw-e2e/tests/e2e/hcl/tests/docker-dummy.tftest.hcl, internal-docs/contributing/live-tests.md
The test sends /fail last, expects a 403, and verifies that the destination receives only /allow and /bypass. Scenario comments and live-test documentation describe the fail-closed behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related issues

Suggested reviewers: jyaunches

Merge Risk: Minimal · up to f939c

This PR extends test coverage for fail-closed middleware error handling without changing production behavior. No merge-blocking risk was found. The new /fail expectation of HTTP 403 will only be confirmed when the live Docker lane runs.

Security architecture risk: Minimal · up to f939c

The change strengthens fail-closed test coverage without introducing an identified security or failure-containment regression. The new error response is confined to the live-test guard.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test: cover fail-closed middleware in the docker-dummy live case" matches the main change. The PR adds a /fail request to the docker-dummy live case, with the middleware guard returning a…
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: Title check

Explanation

The title "test: cover fail-closed middleware in the docker-dummy live case" matches the main change. The PR adds a /fail request to the docker-dummy live case, with the middleware guard returning a service error and the sandbox expecting HTTP 403. The changed files include the test fixture, the HCL test, the YAML case, and the live-test docs, all of which support this focus. The title is specific and uses the conventional prefix, so it describes the primary change accurately.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit sends a request through the gate,
/fail meets an error and waits.
A 403 returns; the destination stays clear,
/allow and /bypass pass through here.
The rabbit checks the recorder, then hops away.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 0f924f18-2340-4167-93f3-d21502a27c5e
Commits

Reviewing files that changed from the base of the PR and between 402b2c7 and f939cfd.

Files selected for processing: 4

  • crates/nemoclaw-e2e/cases/docker-dummy.yaml
  • crates/nemoclaw-e2e/tests/e2e/hcl/tests/docker-dummy.tftest.hcl
  • crates/nemoclaw-test-fixtures/src/middleware.rs
  • internal-docs/contributing/live-tests.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.

@cv
cv merged commit 76ab8a2 into v1 Nov 17, 2026
77 of 78 checks passed
@cv
cv deleted the fix/14338-support-openshell-network-middleware-bin branch November 17, 2026 09:51
@cv cv added the v1 NemoClaw v1 branch label Nov 17, 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

v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants