refactor(e2e): migrate agent-turn-latency to shared inference adapter (#5745) - #8619
Conversation
…NVIDIA#5745) agent-turn-latency-helpers.ts and agent-turn-latency.test.ts derived their own model, provider, and expected route from ad hoc NEMOCLAW_* env inspection, duplicating logic the shared E2E inference adapter (NVIDIA#5745) already centralizes. Route both through the adapter instead: - env(), installSandbox(), cleanupTurnSandbox(s)(), route(), openclawTurn(), and waitHermesHealth() now take an AgentTurnInference value (the adapter's env/expectedRouteProvider/model/mode/provider/redactionValues) instead of a bare apiKey and locally computed MODEL/PROVIDER/EXPECTED_ROUTE_PROVIDER. - The test skips itself when the adapter resolves to hermetic `mock` mode, since a real latency measurement is meaningless against a loopback stub; select `internal-nvidia` or `public-nvidia` via NEMOCLAW_E2E_INFERENCE_MODE to run it for real. e2e.yaml sets NEMOCLAW_E2E_INFERENCE_MODE=internal-nvidia for this job accordingly. - Progress-support unit tests exercise the same helpers with a small fakeInference() stand-in instead of a bare secret string. No behavior change for callers already setting NEMOCLAW_E2E_USE_HOSTED_INFERENCE; this only removes the duplicated model/provider/route derivation. Signed-off-by: Waqas Ahmed <wakqasahmed@protonmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe agent-turn latency E2E test now consumes injected inference adapter configuration. Helpers use adapter-provided environments and redaction values. The workflow selects internal NVIDIA inference mode, and support tests use a reusable fake inference fixture. ChangesAgent turn latency inference integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests. 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. A maintainer can dispatch the default E2E suite against this exact revision. Recommended E2E: 1 warning · 0 suggestionsWarningsWarnings do not block.
|
…dary codebase-growth-guardrails flagged the mode skip added in the prior commit: it was an `if` inside the test body, which the guardrail requires to be a skipIf/runIf boundary instead. Move it there, matching the existing runIssue4434LiveTest pattern in issue-4434-tui-unreachable-inference.test.ts: resolve NEMOCLAW_E2E_INFERENCE_MODE once at module scope via the adapter's own normalizeMode() (now exported instead of duplicated) and gate the test with `test.skipIf(...)`. Biome's reformat of the now-differently-wrapped test() call accounts for most of the diff noise. Signed-off-by: Waqas Ahmed <wakqasahmed@protonmail.com>
Summary
agent-turn-latency-helpers.tsandagent-turn-latency.test.tsderived their own model, provider, and expected route via ad hocNEMOCLAW_*env inspection, duplicating logic the shared E2E inference adapter (#5745) already centralizes. This migrates both to route through the adapter instead.Changes
env(),installSandbox(),cleanupTurnSandbox(s)(),route(),openclawTurn(), andwaitHermesHealth()now take anAgentTurnInferencevalue (the adapter'senv/expectedRouteProvider/model/mode/provider/redactionValues) instead of a bareapiKeyplus locally computedMODEL/PROVIDER/EXPECTED_ROUTE_PROVIDER.mockmode, since a real latency measurement is meaningless against a loopback stub. Selectinternal-nvidiaorpublic-nvidiaviaNEMOCLAW_E2E_INFERENCE_MODEto run it for real;e2e.yamlsetsNEMOCLAW_E2E_INFERENCE_MODE=internal-nvidiafor this job accordingly.fakeInference()stand-in instead of a bare secret string.No behavior change for callers already setting
NEMOCLAW_E2E_USE_HOSTED_INFERENCE; this only removes the duplicated model/provider/route derivation.Test plan
npx vitest run --project e2e-support test/e2e/support/agent-turn-latency-progress.test.ts— 8/8 passednpm run validate:prequivalent hooks (pre-commit, commit-msg, pre-push) all passed locally, including CLI/plugin TypeScript checksSigned-off-by: Waqas Ahmed wakqasahmed@protonmail.com
🤖 Generated with Claude Code
Summary by CodeRabbit