Skip to content

Commit 976942d

Browse files
committed
fix(server): keep Antigravity question options and no-custom-answer flag in V2
The V2 Antigravity flavor rebuilt the question with labels only, dropping allowCustomAnswer: false and the option ids. The composer then accepted a typed answer that matched no option, and the agent received it as cancelled. The question is now passed through unchanged.
1 parent 673c5e3 commit 976942d

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,23 @@ describe("AntigravityAdapterV2 flavor", () => {
113113
);
114114
});
115115

116+
it("keeps the question card to the agent's own options so a typed answer cannot be sent", () => {
117+
const question = flavor.extractPermissionQuestion?.(
118+
permissionRequest("interaction_2", [
119+
{ optionId: "opt-main", name: "main", kind: "allow_once" },
120+
{ optionId: "opt-dev", name: "dev", kind: "allow_once" },
121+
]),
122+
);
123+
assert.strictEqual(question?.question.allowCustomAnswer, false);
124+
assert.deepEqual(
125+
question?.question.options.map((option) => option.value),
126+
["opt-main", "opt-dev"],
127+
);
128+
assert.deepEqual(question?.respond({ interaction_2: "opt-dev" }), {
129+
outcome: { outcome: "selected", optionId: "opt-dev" },
130+
});
131+
});
132+
116133
it("advertises only the approval decisions the request can honor", () => {
117134
const options = flavor.approvalOptions?.(
118135
permissionRequest("tool_1", [

‎apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,7 @@ export function makeAntigravityAcpAdapterFlavor(
196196
const question = extractAntigravityUserInputQuestion(request);
197197
if (question === undefined) return undefined;
198198
return {
199-
question: {
200-
id: question.id,
201-
header: question.header,
202-
question: question.question,
203-
options: question.options.map((option) => ({
204-
label: option.label,
205-
description: option.description,
206-
})),
207-
multiSelect: false,
208-
},
199+
question,
209200
respond: (answers) => makeAntigravityUserInputResponse(request, answers),
210201
};
211202
},

0 commit comments

Comments
 (0)