Skip to content

fix(e2e): use isolated gateway state for inference switch - #9216

Merged
senthilr-nv merged 2 commits into
mainfrom
codex/fix-inference-switch-gateway-state-home
Aug 15, 2026
Merged

fix(e2e): use isolated gateway state for inference switch#9216
senthilr-nv merged 2 commits into
mainfrom
codex/fix-inference-switch-gateway-state-home

Conversation

@senthilr-nv

@senthilr-nv senthilr-nv commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

The OpenClaw inference-switch E2E target installed OpenShell under an isolated home but looked for managed gateway state under the test process's ambient home. Pass the target home to the existing owned gateway-state verifier so the target uses its recorded Docker-driver gateway instead of falling through to unavailable user-systemd services.

Failure evidence: E2E run 31895698451, job 95038810397. Ownership was claimed on #9166 before implementation: #9166 (comment)

Related Issue

Related to #9166.

Changes

  • Thread the target home through managed gateway PID and runtime-marker discovery.
  • Store the temporary host-verification resolver under the same isolated home.
  • Pass the OpenClaw inference-switch target's installation home while preserving the existing default for other callers.
  • Add support coverage proving target-home managed state is selected without probing the user service.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: this corrects internal E2E fixture state discovery and changes no supported command, configuration, API, policy, default, error, or runtime behavior.
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: independent Codex Desktop security review at commit under review d47cc72d8 passed all nine required categories with no finding; the three reviewed file blobs are unchanged at latest PR commit 87a58c462.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: At commit under review 87a58c462, the complete diff against base de29c02a1 changes only internal E2E fixtures and tests. It passes the isolated test home to the existing owned gateway-state verifier and stores verifier artifacts under that home; it does not change supported product behavior or a user-visible surface.
  • Agent: Codex Desktop (/root/openclaw_docs_review)

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — at latest PR commit 87a58c462, npx vitest run --project e2e-support test/e2e/support/compatible-anthropic-switch.test.ts: 11 passed, 1 Linux-only skipped on macOS.
  • Applicable broad gate passed — not applicable to this three-file internal E2E fixture correction; npm run validate:pr, CLI typecheck, Oxfmt, Oxlint, repository checks, semantic-phase coverage, size/conditional checks, and git diff --check passed after merging main de29c02a1.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Senthil Ravichandran senthilr@nvidia.com

Summary by CodeRabbit

  • Tests
    • Expanded end-to-end coverage for gateway behavior across custom home directories.
    • Improved validation of gateway process ownership, executable resolution, and state-directory handling.
    • Strengthened host-verification setup and cleanup checks across managed and active service scenarios.
    • Updated provider-switching tests to verify behavior in isolated environments.

Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
@senthilr-nv senthilr-nv self-assigned this Aug 15, 2026
@copy-pr-bot

copy-pr-bot Bot commented Aug 15, 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 Aug 15, 2026

Copy link
Copy Markdown
Contributor

Review 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: 30e5c4b1-3720-414c-981c-11e7e3248621

📥 Commits

Reviewing files that changed from the base of the PR and between 1281924 and d47cc72.

📒 Files selected for processing (3)
  • test/e2e/fixtures/compatible-anthropic-switch.ts
  • test/e2e/live/openclaw-inference-switch.test.ts
  • test/e2e/support/compatible-anthropic-switch.test.ts

📝 Walkthrough

Walkthrough

The gateway fixture now accepts an explicit home directory for PID discovery and resolver setup. End-to-end tests pass isolated home directories, mock process inspection, and clean up the resulting directory trees.

Changes

Gateway home directory propagation

Layer / File(s) Summary
Propagate explicit home directory
test/e2e/fixtures/compatible-anthropic-switch.ts, test/e2e/live/openclaw-inference-switch.test.ts
Gateway PID lookup and host verification alias installation now use an explicit home directory. The installation function defaults to os.homedir().
Isolate gateway test state
test/e2e/support/compatible-anthropic-switch.test.ts
Managed-gateway tests create state under target home directories, mock process ownership and executable resolution, pass explicit homes, and remove the target trees during cleanup.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to d47cc

This localized E2E fixture change selects gateway state from the isolated test home and preserves existing defaults for other callers; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

Suggested reviewers: cv

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 identifies the E2E fix and the isolated gateway state used for the inference switch.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-inference-switch-gateway-state-home

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

@github-code-quality

github-code-quality Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 87a58c4 in the codex/fix-inference-... branch remains at 96%, unchanged from commit de29c02 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 87a58c4 in the codex/fix-inference-... branch remains at 82%, unchanged from commit de29c02 in the main branch.

Show a code coverage summary of the most impacted files.
File main de29c02 codex/fix-inference-... 87a58c4 +/-
src/lib/cua/bounded-file.ts 94% 84% -10%
src/lib/cua/run...ime-manifest.ts 90% 84% -6%
src/lib/onboard...eway-service.ts 84% 83% -1%
src/lib/agent/defs.ts 97% 97% 0%
src/lib/agent/r...ime-manifest.ts 100% 100% 0%
src/lib/sandbox...rce-identity.ts 85% 85% 0%
src/lib/onboard...hell-version.ts 85% 87% +2%

Updated August 15, 2026 19:14 UTC

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Failed

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

2 semantic terminology decisions

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • justified — target home at test/e2e/support/compatible-anthropic-switch.test.ts:116: Keep “target home” in this test title because it identifies the state-selection boundary under test.
  • justified — managed Docker-driver gateway state at test/e2e/support/compatible-anthropic-switch.test.ts:116: Keep the modifier in this test title because it identifies the gateway selection path under test.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite for the commit under review.

Recommended E2E: inference-routing

Manual-only E2E: cloud-onboard, security-posture, openclaw-inference-switch, cloud-inference, network-policy
The manual PR workflow does not run these selectors for the commit under review. Run them from reviewed code on main.

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@senthilr-nv
senthilr-nv marked this pull request as ready for review August 15, 2026 18:38
@senthilr-nv
senthilr-nv requested a review from cv August 15, 2026 18:38
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
@senthilr-nv
senthilr-nv merged commit 6aa38e8 into main Aug 15, 2026
88 of 92 checks passed
@senthilr-nv
senthilr-nv deleted the codex/fix-inference-switch-gateway-state-home branch August 15, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants