Skip to content

Commit 02c813a

Browse files
committed
fix(inference): align Pi reasoning environment
1 parent 73a4806 commit 02c813a

2 files changed

Lines changed: 18 additions & 30 deletions

File tree

src/lib/onboard/managed-startup-agent-environment.test.ts

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -707,22 +707,13 @@ describe("managed startup agent environment", () => {
707707
https_proxy: "",
708708
no_proxy: "",
709709
});
710-
const expectedPiRuntime = { ...result.configurationEnvironment };
711-
delete expectedPiRuntime.NEMOCLAW_INFERENCE_BASE_URL;
712-
delete expectedPiRuntime.NEMOCLAW_CONTEXT_WINDOW;
713-
delete expectedPiRuntime.NEMOCLAW_MAX_TOKENS;
714-
delete expectedPiRuntime.NEMOCLAW_REASONING;
715-
for (const name of [
716-
"HTTP_PROXY",
717-
"HTTPS_PROXY",
718-
"NO_PROXY",
719-
"http_proxy",
720-
"https_proxy",
721-
"no_proxy",
722-
]) {
723-
delete expectedPiRuntime[name];
724-
}
725-
expect(result.runtimeEnvironment).toEqual(expectedPiRuntime);
710+
expect(result.runtimeEnvironment).toEqual({
711+
NEMOCLAW_INFERENCE_API: "openai-completions",
712+
NEMOCLAW_INFERENCE_PROVIDER_ID: "inference",
713+
NEMOCLAW_MODEL: "nvidia/nemotron-3-super-120b-a12b",
714+
NEMOCLAW_TOOL_DISCLOSURE: "progressive",
715+
NEMOCLAW_UPSTREAM_PROVIDER: "nvidia",
716+
});
726717
expect(result.materials).toEqual([
727718
{
728719
kind: "corporate-ca-handoff",
@@ -770,17 +761,17 @@ describe("managed startup agent environment", () => {
770761
expect(result.configurationEnvironment).toMatchObject({
771762
NEMOCLAW_CONTEXT_WINDOW: "262144",
772763
NEMOCLAW_MAX_TOKENS: "32000",
773-
NEMOCLAW_REASONING: "1",
764+
NEMOCLAW_REASONING: "true",
774765
});
775-
for (const name of ["NEMOCLAW_CONTEXT_WINDOW", "NEMOCLAW_MAX_TOKENS", "NEMOCLAW_REASONING"]) {
776-
expect(result.runtimeEnvironment).not.toHaveProperty(name);
777-
}
766+
expect(result.runtimeEnvironment).not.toHaveProperty("NEMOCLAW_CONTEXT_WINDOW");
767+
expect(result.runtimeEnvironment).not.toHaveProperty("NEMOCLAW_MAX_TOKENS");
768+
expect(result.runtimeEnvironment).not.toHaveProperty("NEMOCLAW_REASONING");
778769
expect(
779770
mapManagedStartupProfileToAgentEnvironment({
780771
...base,
781772
tuning: { ...base.tuning, reasoning: false },
782773
}).configurationEnvironment.NEMOCLAW_REASONING,
783-
).toBe("0");
774+
).toBe("false");
784775
});
785776

786777
it("rebuilds the Pi generator inputs from the current route without retaining the previous one (#7930)", () => {
@@ -810,14 +801,10 @@ describe("managed startup agent environment", () => {
810801
{ ...before.materials[2], contents: "3129\n" },
811802
]);
812803
const serialized = JSON.stringify(after);
813-
for (const stale of [
814-
"https://inference.local/v1",
815-
"nvidia/nemotron-3-super-120b-a12b",
816-
"10.200.0.1",
817-
"3128",
818-
]) {
819-
expect(serialized).not.toContain(stale);
820-
}
804+
expect(serialized).not.toContain("https://inference.local/v1");
805+
expect(serialized).not.toContain("nvidia/nemotron-3-super-120b-a12b");
806+
expect(serialized).not.toContain("10.200.0.1");
807+
expect(serialized).not.toContain("3128");
821808
expect(after.actions).toEqual(before.actions);
822809
});
823810

src/lib/onboard/managed-startup/agent-environment.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ function mapPiProfile(
571571
NEMOCLAW_CONTEXT_WINDOW:
572572
profile.tuning.contextWindow === null ? "" : String(profile.tuning.contextWindow),
573573
NEMOCLAW_MAX_TOKENS: profile.tuning.maxTokens === null ? "" : String(profile.tuning.maxTokens),
574-
NEMOCLAW_REASONING: profile.tuning.reasoning === null ? "" : booleanFlag(profile.tuning.reasoning),
574+
NEMOCLAW_REASONING:
575+
profile.tuning.reasoning === null ? "" : String(profile.tuning.reasoning),
575576
};
576577
appendHostProxyEnvironment(configurationEnvironment, profile);
577578
const runtimeEnvironment: MutableEnvironment = { ...configurationEnvironment };

0 commit comments

Comments
 (0)