Skip to content

Commit fa8b306

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 ecfe4f7 commit fa8b306

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
@@ -96,6 +96,23 @@ describe("AntigravityAdapterV2 flavor", () => {
9696
),
9797
);
9898
});
99+
100+
it("keeps the question card to the agent's own options so a typed answer cannot be sent", () => {
101+
const question = flavor.extractPermissionQuestion?.(
102+
permissionRequest("interaction_2", [
103+
{ optionId: "opt-main", name: "main", kind: "allow_once" },
104+
{ optionId: "opt-dev", name: "dev", kind: "allow_once" },
105+
]),
106+
);
107+
assert.strictEqual(question?.question.allowCustomAnswer, false);
108+
assert.deepEqual(
109+
question?.question.options.map((option) => option.value),
110+
["opt-main", "opt-dev"],
111+
);
112+
assert.deepEqual(question?.respond({ interaction_2: "opt-dev" }), {
113+
outcome: { outcome: "selected", optionId: "opt-dev" },
114+
});
115+
});
99116
});
100117

101118
const layerSession = Layer.mergeAll(

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

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

0 commit comments

Comments
 (0)