Repository navigation
fix(connect): isolate DCode route probe output #6497
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 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3fff912
fix(connect): isolate route probe output
apurvvkumaria 9b996d9
test(connect): isolate DCode probe boundary coverage
apurvvkumaria 71dc79e
fix(connect): remove DCode probe trust channels
cjagwani 1510b70
fix(connect): remove spoofable DCode probe descriptor
apurvvkumaria 4c43035
merge(connect): reconcile DCode probe hardening
apurvvkumaria 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
65 changes: 65 additions & 0 deletions
65
src/lib/actions/sandbox/connect-flow-dcode-probe-preamble.test.ts
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,65 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { afterEach, beforeEach, describe, expect, it, type MockInstance, vi } from "vitest"; | ||
|
|
||
| import { | ||
| connectModulePath, | ||
| createConnectHarness, | ||
| requireDist, | ||
| } from "../../../../test/support/connect-flow-test-harness"; | ||
|
|
||
| describe("connectSandbox DCode probe preamble boundary", () => { | ||
| let exitSpy: MockInstance; | ||
| const originalStdoutIsTty = process.stdout.isTTY; | ||
|
|
||
| beforeEach(() => { | ||
| process.env.NEMOCLAW_TEST_NO_SLEEP = "1"; | ||
| Object.defineProperty(process.stdout, "isTTY", { configurable: true, value: true }); | ||
| exitSpy = vi.spyOn(process, "exit").mockImplementation(((code?: number | string | null) => { | ||
| throw new Error(`process.exit(${code ?? 0})`); | ||
| }) as never); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| vi.restoreAllMocks(); | ||
| Object.defineProperty(process.stdout, "isTTY", { | ||
| configurable: true, | ||
| value: originalStdoutIsTty, | ||
| }); | ||
| delete process.env.NEMOCLAW_TEST_NO_SLEEP; | ||
| delete require.cache[requireDist.resolve(connectModulePath)]; | ||
| }); | ||
|
|
||
| it.each([ | ||
| "OK 200\nBROKEN 000", | ||
| "BROKEN 503\nOK 200", | ||
| ])("rejects login-shell preamble evidence without repair or SSH (%s) (#6192)", async (output) => { | ||
| const harness = createConnectHarness({ | ||
| agentName: "langchain-deepagents-code", | ||
| registryEntry: { | ||
| provider: "nvidia-prod", | ||
| model: "nvidia/nemotron-3-super-120b-a12b", | ||
| }, | ||
| inferenceGetOutput: | ||
| "Gateway inference:\n Provider: nvidia-prod\n Model: nvidia/nemotron-3-super-120b-a12b\n", | ||
| inferenceProbeResponses: [output], | ||
| sessionAgent: { name: "langchain-deepagents-code" }, | ||
| }); | ||
|
|
||
| await expect(harness.connectSandbox("alpha")).rejects.toThrow("process.exit(1)"); | ||
|
|
||
| expect(harness.applyVmDnsMonkeypatchSpy).not.toHaveBeenCalled(); | ||
| expect(harness.runSetupDnsProxySpy).not.toHaveBeenCalled(); | ||
| expect(harness.runOpenshellSpy).not.toHaveBeenCalled(); | ||
| expect(harness.spawnSyncSpy).not.toHaveBeenCalledWith( | ||
| "openshell", | ||
| ["sandbox", "connect", "alpha"], | ||
| expect.any(Object), | ||
| ); | ||
| expect(harness.errorSpy.mock.calls.flat().join("\n")).toContain( | ||
| "did not return a trusted result", | ||
| ); | ||
| expect(exitSpy).toHaveBeenCalledWith(1); | ||
| }); | ||
| }); |
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.
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.