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
63 changes: 60 additions & 3 deletions apps/server/scripts/antigravity-mock-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,12 @@ const program = Effect.gen(function* () {
usage: { inputTokens: 400, outputTokens: 10, totalTokens: 410 },
};
}
if (scenario === "background" || scenario === "hang" || scenario === "exit") {
if (
scenario === "background" ||
scenario === "background-log-error" ||
scenario === "hang" ||
scenario === "exit"
) {
yield* update(sessionId, { sessionUpdate: "tool_call", ...command, status: "in_progress" });
yield* say(sessionId, "I'll report once the build finishes.");
yield* modelCallEnds(sessionId);
Expand All @@ -725,7 +730,7 @@ const program = Effect.gen(function* () {
yield* Effect.sync((): void => process.exit(1));
}).pipe(Effect.forkDetach);
}
if (scenario === "background") {
if (scenario === "background" || scenario === "background-log-error") {
yield* Effect.gen(function* () {
yield* Effect.sleep("400 millis");
yield* update(sessionId, {
Expand All @@ -735,7 +740,15 @@ const program = Effect.gen(function* () {
rawOutput: { output: "Command exited with code 0.", exit_code: 0 },
});
yield* Effect.sleep("100 millis");
yield* say(sessionId, "The build passed.");
if (scenario === "background-log-error") {
appendLogSteps(sessionId, [
[15, "I'll report once the build finishes."],
[17, GATEWAY_ERROR],
]);
yield* say(sessionId, "API error: the request failed.");
} else {
yield* say(sessionId, "The build passed.");
}
yield* modelCallEnds(sessionId);
}).pipe(Effect.forkDetach);
}
Expand All @@ -750,6 +763,50 @@ const program = Effect.gen(function* () {
},
};
}
if (scenario === "ask-question") {
const answer = yield* agent.client.extRequest("elicitation/create", {
sessionId,
mode: "form",
message: "The agent has 2 questions.",
requestedSchema: {
type: "object",
properties: {
q1: {
type: "string",
title: "Which runtime should we target?",
oneOf: [
{ const: "1", title: "Node.js", description: "Default runtime" },
{ const: "2", title: "Deno" },
],
},
q1_other: {
type: "string",
title: "Other",
description: "Optional free-form answer",
},
q2: {
type: "array",
title: "Which checks should run?",
items: {
anyOf: [
{ const: "1", title: "Typecheck" },
{ const: "2", title: "Unit tests" },
{ const: "3", title: "Lint" },
],
},
},
q2_other: {
type: "string",
title: "Other",
description: "Optional free-form answer",
},
},
},
});
yield* say(sessionId, `Answers: ${JSON.stringify(answer)}`);
yield* modelCallEnds(sessionId);
return { stopReason: "end_turn" as const };
}
if (scenario === "subagent") {
yield* update(sessionId, {
sessionUpdate: "tool_call",
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/provider/Drivers/AntigravityDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export const AntigravityDriver: ProviderDriver<AntigravitySettings, AntigravityD
profileDir: paths.profileDir,
method: signIn.method,
fingerprint,
...(signIn.project ? { project: signIn.project } : {}),
});
const descriptor = makeAntigravityDescriptor({
paths,
Expand Down
Loading
Loading