Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/lib/cloudAgent/baseAgent.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { randomBytes } from "node:crypto";
import type {
CloudAgentTask,
CloudAgentStatus,
Expand Down Expand Up @@ -86,10 +87,12 @@ export abstract class CloudAgentBase {
}

protected generateTaskId(): string {
return `task_${Date.now()}_${crypto.randomUUID().replace(/-/g, "").substring(0, 9)}`;
// Cryptographically secure suffix (not Math.random) — task IDs flow into
// session/external identifiers, so they must be unpredictable (CodeQL js/insecure-randomness).
return `task_${Date.now()}_${randomBytes(8).toString("hex")}`;
}

protected generateActivityId(): string {
return `act_${Date.now()}_${crypto.randomUUID().replace(/-/g, "").substring(0, 9)}`;
return `act_${Date.now()}_${randomBytes(8).toString("hex")}`;
}
}
3 changes: 3 additions & 0 deletions tests/unit/antigravity-discovery-bootstrap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ describe("ensureAntigravityProjectAssigned", () => {

const mockFetch = async (url: string, _init?: RequestInit): Promise<Response> => {
hitUrls.push(url);
// Exact hostname match (not substring .includes) so the check can't be fooled by a
// look-alike host like daily-cloudcode-pa.googleapis.com.evil.com (CodeQL
// js/incomplete-url-substring-sanitization).
if (new URL(url).hostname === "daily-cloudcode-pa.googleapis.com") {
// First URL fails
return new Response("not found", { status: 404 });
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/t31-t33-t34-t38-model-specs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ test("T38: modelSpecs exposes centralized helpers with alias and prefix lookup",
assert.equal(getDefaultThinkingBudget("gemini-3.1-pro-high"), 24576);
assert.equal(capThinkingBudget("gemini-3.1-pro-low", 50000), 16000);
});

test("T38: MiMo V2.5 and V2 Omni models support vision", () => {
assert.equal(MODEL_SPECS["mimo-v2.5-pro"].supportsVision, true);
assert.equal(MODEL_SPECS["mimo-v2.5"].supportsVision, true);
assert.equal(MODEL_SPECS["mimo-v2-omni"].supportsVision, true);
assert.equal(MODEL_SPECS["mimo-v2-flash"].supportsVision, undefined);
});