test(sessions): make the offline-runtime regression test discriminating

The reworked assertion ran under the file-level PI_OFFLINE=1 stub, so the
runtime was offline whether or not createOfflineModelRuntime forced it and
the test passed with the fix fully removed. Clear the stub for that case,
and rewrap a docblock line.
This commit is contained in:
Federico Jaramillo Martinez
2026-07-25 13:32:21 +02:00
parent 90dd7ce401
commit 5d632ef11d
2 changed files with 7 additions and 3 deletions
+3
View File
@@ -474,6 +474,9 @@ describe("createModelRuntimeForAgentDir", () => {
it("keeps runtime-owned refreshes local so request paths cannot stall", async () => {
// reloadConfig() is the request-path call site that regressed: it refreshes
// with allowNetwork = the construction-time network flag and no abort signal.
// The ambient PI_OFFLINE=1 stub has to go, or the runtime would be offline
// whether or not the helper forces it and this would assert nothing.
vi.stubEnv("PI_OFFLINE", undefined);
const agentDir = await tempAgentDir();
const runtime = await createModelRuntimeForAgentDir(agentDir);
const refresh = vi.spyOn(runtime, "refresh");