Skip to content

fix(e2e): echo unique launch replies in mock inference - #9058

Merged
cv merged 1 commit into
mainfrom
agent/normalize-agent-turn-output
Aug 13, 2026
Merged

fix(e2e): echo unique launch replies in mock inference#9058
cv merged 1 commit into
mainfrom
agent/normalize-agent-turn-output

Conversation

@prekshivyas

@prekshivyas prekshivyas commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

The release E2E run showed two agent-turn failures: OpenClaw rendered the expected unique reply inside terminal control sequences, and the shared mock inference endpoint returned fixed PONG to Hermes. Current main already contains the OpenClaw OSC normalization and regression from #9034; this change repairs the remaining mock behavior by deriving each unique reply from the exact launch prompt.

Related Issue

Fixes #9046

Changes

  • Add an opt-in launch-prompt parser to the fake Chat Completions endpoint. The shared fake server serves unrelated fixtures, so changing its default response would alter other tests; the adapter enables the parser only for mock inference.
  • Accept only the generated four-fragment prompt and preserve the configured PONG response for partial or altered prompts.
  • Add a regression test that failed with fixed PONG before the change and now verifies both the unique reply and fallback behavior.
  • Close the detection gap where the adapter test exercised only a fixed PONG prompt and did not cover the generated launch-turn contract.

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 changes an internal E2E mock endpoint and its support test. It does not change a public command, API, configuration, default, workflow, or supported product 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: The mock Chat Completions input boundary accepts one exact uppercase prompt shape. A negative regression preserves the fixed response for altered input. Authentication, credential redaction, request metadata, production inference routes, dependencies, and network policy are unchanged.
  • 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: The reviewed four-file diff changes only E2E fixture and support behavior. It adds no public API, CLI, configuration, default, workflow, or supported product behavior.
  • Agent: Codex Desktop

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 — npx vitest run --project e2e-support test/e2e/support/inference-adapter.test.ts test/e2e/support/hosted-inference.test.ts test/e2e/support/device-auth-health-helpers.test.ts test/e2e/support/launch-agent-turn.test.ts: 4 files passed, 32 tests passed, 1 platform skip.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: Not applicable to this isolated mock behavior. An additional npx vitest run --project e2e-support passed 197 files and failed in seven unrelated macOS host-sensitive files that require GNU find, trusted Homebrew state, systemd or Ollama, or longer subprocess timeouts.
  • 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: Prekshi Vyas prekshiv@nvidia.com

Summary by CodeRabbit

  • Tests
    • Enhanced end-to-end inference testing for launch-specific prompts.
    • Added coverage for both streaming and non-streaming responses.
    • Verified exact prompt-derived responses while preserving default responses for similar prompts without explicit instructions.

@prekshivyas prekshivyas self-assigned this Aug 13, 2026
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 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 13, 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: a348cabc-39e5-4adb-a1d0-a6777479afc1

📥 Commits

Reviewing files that changed from the base of the PR and between ddcdd56 and 5d38dbe.

📒 Files selected for processing (4)
  • test/e2e/fixtures/fake-openai-compatible.ts
  • test/e2e/fixtures/inference-adapter.ts
  • test/e2e/lib/fake-openai-compatible-api.mts
  • test/e2e/support/inference-adapter.test.ts

📝 Walkthrough

Walkthrough

The fake inference server now supports opt-in launch replies derived from prompt fragments. The inference adapter enables this mode, and end-to-end tests verify exact launch responses while preserving PONG for non-matching prompts.

Changes

Prompt-derived launch reply flow

Layer / File(s) Summary
Server configuration
test/e2e/fixtures/fake-openai-compatible.ts, test/e2e/fixtures/inference-adapter.ts, test/e2e/lib/fake-openai-compatible-api.mts
The fixtures expose and propagate launchReplyFromPrompt. The fake server reads the setting from NEMOCLAW_FAKE_OPENAI_LAUNCH_REPLY_FROM_PROMPT.
Prompt response handling and validation
test/e2e/lib/fake-openai-compatible-api.mts, test/e2e/support/inference-adapter.test.ts
Matching prompts produce the constructed launch reply for streaming and non-streaming completions. Non-matching prompts retain PONG. Tests verify both cases.

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

Mergeability Score: ⚪ Minimal · up to 5d38d

This changes only opt-in E2E mock response behavior, with targeted tests passing; no actionable merge-blocking risk remains.

Suggested reviewers: cv

Sequence Diagram(s)

sequenceDiagram
  participant InferenceAdapterTest
  participant InferenceAdapter
  participant FakeOpenAiCompatibleServer
  InferenceAdapterTest->>InferenceAdapter: send launch-specific prompt
  InferenceAdapter->>FakeOpenAiCompatibleServer: request chat completion
  FakeOpenAiCompatibleServer->>FakeOpenAiCompatibleServer: validate prompt fragments
  FakeOpenAiCompatibleServer-->>InferenceAdapter: constructed launch reply
  InferenceAdapter-->>InferenceAdapterTest: exact response
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: mock inference now echoes unique launch replies.
Linked Issues check ✅ Passed The PR updates fake inference to echo prompt-encoded unique replies, preserves PONG fallback, and adds regression coverage for issue #9046.
Out of Scope Changes check ✅ Passed All changes are limited to E2E fixtures, fake inference behavior, and tests directly related to issue #9046.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 agent/normalize-agent-turn-output

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

@github-code-quality

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 5d38dbe in the agent/normalize-agen... branch remains at 96%, unchanged from commit ddcdd56 in the main branch.

@prekshivyas
prekshivyas requested a review from cv August 13, 2026 23:17
@prekshivyas
prekshivyas marked this pull request as ready for review August 13, 2026 23:17
@cv
cv merged commit 8860d24 into main Aug 13, 2026
68 of 71 checks passed
@cv
cv deleted the agent/normalize-agent-turn-output branch August 13, 2026 23:20
@github-actions

github-actions Bot commented Aug 13, 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): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized terminology decisions differ; normalized E2E selections differ; severity counts match.
2 terminology differences from the second opinion

Advisory only. These are normalized differences from the primary terminology receipt.

  • mock prompt at test/e2e/support/inference-adapter.test.ts:183: selected only by the second-opinion lane as conflict.
  • unique launch reply at test/e2e/support/inference-adapter.test.ts:183: selected only by the second-opinion lane as justified.
3 additional E2E selections from the second opinion

Advisory only. The primary lane did not select these E2E jobs or targets.

  • e2e-all: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • hermes-inference-switch: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • openclaw-inference-switch: The completed second-opinion lane identified E2E coverage that the primary lane omitted.

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

1 semantic terminology decision

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

  • justified — launch reply at test/e2e/support/inference-adapter.test.ts:183: Keep “launch reply” for the prompt-derived reply used by launch-turn tests.

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, 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.

1 optional E2E recommendation
  • hermes-e2e

Workflow run details

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

@sandl99 sandl99 mentioned this pull request Aug 13, 2026
23 tasks
cv added a commit that referenced this pull request Aug 13, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Add a Deferred N1x Express preview that recognizes the qualified FastOS
and PCI identity and offers one-host managed vLLM. N1x remains outside
the supported-platform set until physical NemoClaw Express E2E
validation is complete.

## Related Issue

Fixes #8574

## Changes

- Add a bounded N1x identity reader for the installer and readiness
projection. Generic DMI cannot identify this device directly, so the
classifier requires a trusted `/etc/fastos-release` marker and exact
NVIDIA display PCI identity; focused identity and installer tests
protect the boundary.
- Add a distinct N1x managed-vLLM profile using
`nvidia/Qwen3.6-35B-A3B-NVFP4`. A separate profile prevents N1x from
inheriting DGX Spark cluster, fixed-catalog, llama.cpp, or NIM behavior;
vLLM profile and menu tests protect the selection.
- Keep Local NVIDIA NIM unavailable on N1x in both interactive
onboarding and explicit provider selection. Provider-selection tests
prove that `nim-local` is rejected before NIM setup while managed vLLM
remains available.
- Keep `host.platform.supported` absent and add a blocking
pending-validation finding. Only explicit managed-vLLM preview intent
can waive that finding after N1x identity qualifies; readiness and
onboarding-admission tests protect the exception.
- Document the Deferred preview, readiness contract, model, exclusions,
and physical E2E promotion gate across the platform matrix, quickstarts,
inference setup, command reference, and readiness reference.

## Type of Change

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

## Quality Gates

- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: Local security review
covered bounded identity input, marker ownership and mode checks,
symlink and malformed-marker rejection, exact PCI matching, fail-closed
readiness states, and the scoped preview waiver. No blocking findings
remain.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Documentation Writer Review

- [x] Documentation writer subagent reviewed the completed changes
- Result: `docs-updated`
- Evidence: Reviewed the complete 41-file diff at
`06aecf4d1247980d37af2a0550b4cc272462e8a1` against
`8860d24fe17da339c56b83b08b8f2b43568adbd7`. N1x remains outside the
supported-platform set and admits only explicit Deferred `install-vllm`
intent; existing-server reuse is excluded, and port `8000` conflicts,
preview decline, unqualified identity, and other providers fail closed.
Hermes and Deep Agents preserve their explicit agent and sandbox names
through Express setup. Verified the canonical platform matrix, generated
Starter Prompt, and all agent variants. The #9040 recovery documentation
singularly identifies the Platform Evidence workflow. Base change #9058
affects only internal E2E fixtures and support, and its unique reply
behavior is already documented. `npm run docs` passed with 0 errors and
2 existing warnings; CLI typecheck, `git diff --check`, normal merge
hooks, the changed E2E-support test (10/10), and the N1x installer
regression (10/10) passed.
- Agent: Codex Desktop
<!-- docs-review-head-sha: 06aecf4 -->
<!-- docs-review-agents-blob-sha: e30afb2 -->

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit: Not applicable; `scripts/prepare-dgx-station-host.sh`
is unchanged.
- Station profile/scenario: Not applicable.
- Result: Not applicable.
- Supporting evidence: Not applicable.

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] 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
- [x] Targeted behavior tests pass for the current change set — `npx
vitest run test/install-express-n1x.test.ts` (10 passed), including
non-C locale metadata collection plus N1x decline,
`NEMOCLAW_NO_EXPRESS=1`, and explicit `install-vllm` bypass coverage.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: Not applicable; this
change does not modify the runtime-wide test harness or repository-wide
validation configuration.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — build
passed with 0 errors and 2 pre-existing Fern warnings.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
— no new documentation pages.

---

Signed-off-by: San Dang <sdang@nvidia.com>


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

* **New Features**
  * Added deferred Express-install preview support for N1x FASTOS hosts.
* Added managed vLLM support with the default Qwen3.6-35B-A3B-NVFP4
model.
  * Added N1x platform detection and readiness qualification.

* **Bug Fixes**
* Prevented local NVIDIA NIM from being offered or selected on N1x
hosts.

* **Documentation**
* Updated setup, inference, platform-support, readiness, and security
guidance for N1x requirements, limitations, and preview behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: San Dang <sdang@nvidia.com>
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Charan Jagwani <cjagwani@nvidia.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Prekshi Vyas <prekshiv@nvidia.com>
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.

Agent-turn E2E rejects valid OpenClaw terminal output and fixed Hermes mock replies

2 participants