Repository navigation
ci(e2e): restore Anthropic switch variants #5947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
866c6fe
ci(e2e): restore Anthropic switch variants
cv 7407058
ci(e2e): pin switch job permissions
cv 458a6ba
fix(e2e): separate Hermes install and switch models
cv 2aaf682
Merge branch 'main' into codex/e2e-anthropic-switch-matrix
cv 4bb3790
Merge remote-tracking branch 'origin/main' into codex/e2e-anthropic-s…
cv 3a55151
chore(e2e): normalize switch boundary imports
cv b99940d
fix(e2e): reset Hermes gateway before switch runs
cv aa45910
fix(e2e): share inference switch retry policy
cv 7f114cd
fix(e2e): honor configured Hermes gateway cleanup
cv 1c29c6f
fix(e2e): reset Hermes gateway through CLI
cv ffe4206
fix(e2e): stabilize Hermes mock routing
cv 90413fd
fix(e2e): restore Hermes live probe parity
cv 9bebd96
refactor(e2e): remove unused mock preflight
cv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import type { ShellProbeResult } from "./shell-probe.ts"; | ||
|
|
||
| const TRANSIENT_INFERENCE_SET_FAILURE = | ||
| /timed? out|timeout|ETIMEDOUT|ECONNRESET|EAI_AGAIN|ENOTFOUND|failed to connect|error sending request|failed to verify inference endpoint|502|503|504|temporar/iu; | ||
|
|
||
| export function inferenceSetAttemptCount(raw: string | undefined, fallback = 3): number { | ||
| if (raw === undefined) return fallback; | ||
| const parsed = Number(raw); | ||
| if (!Number.isInteger(parsed) || parsed < 1) { | ||
| throw new Error(`NEMOCLAW_SWITCH_SET_ATTEMPTS must be a positive integer; got ${raw}`); | ||
| } | ||
| return parsed; | ||
| } | ||
|
|
||
| export function isTransientInferenceSetFailure(result: ShellProbeResult): boolean { | ||
| return TRANSIENT_INFERENCE_SET_FAILURE.test(`${result.stdout}\n${result.stderr}`); | ||
| } | ||
|
|
||
| export async function runInferenceSetWithRetry(options: { | ||
| attempts: number; | ||
| delay?: (milliseconds: number) => Promise<void>; | ||
| run: (attempt: number, verify: boolean) => Promise<ShellProbeResult>; | ||
| }): Promise<ShellProbeResult> { | ||
| const delay = | ||
| options.delay ?? | ||
| ((milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds))); | ||
| for (let attempt = 1; attempt <= options.attempts; attempt += 1) { | ||
| const result = await options.run(attempt, true); | ||
| if (result.exitCode === 0 || !isTransientInferenceSetFailure(result)) return result; | ||
| if (attempt < options.attempts) { | ||
| await delay(attempt * 5_000); | ||
| continue; | ||
| } | ||
| return options.run(attempt, false); | ||
| } | ||
| throw new Error("Inference switch retry loop completed without running an attempt."); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.