Skip to content

feat(server): support multi-select elicitation forms and opt in Antigravity chat - #15926

Closed
Droyder7 wants to merge 15 commits into
pingdotgg:mainfrom
Droyder7:feat/acp-elicitation-multiselect
Closed

Droyder7 wants to merge 15 commits into
pingdotgg:mainfrom
Droyder7:feat/acp-elicitation-multiselect

Conversation

@Droyder7

@Droyder7 Droyder7 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

When ACP agents (such as Antigravity 1.3.0 or any ACP-compliant agent) send interactive form elicitation requests (session/elicitation with mode: "form") containing multi-select question items (type: "array" with items.oneOf / items.anyOf / items.enum), T3 Code:

  1. Did not parse items schemas or set multiSelect: true, leaving questions unselectable as multi-choice or with empty options.
  2. Did not enforce allowCustomAnswer: false on fixed option lists, allowing blank or arbitrary inputs when a fixed set of choices was required.
  3. Did not normalize or type-coerce answers before returning them to the agent (e.g., booleans remained strings, strings weren't wrapped into arrays for array schemas, or invalid numbers weren't dropped according to the requested schema).
  4. Did not advertise the elicitation.form client capability in Antigravity chat sessions, causing Antigravity to fall back to permission prompt cards instead of interactive elicitation question forms.
  5. Permitted schema-violating submissions: empty choice option entries with blank labels/values, unconstrained float inputs on integer fields, out-of-bounds numeric answers violating minimum/maximum, and unbounded multi-select responses on arrays with maxItems: 1 or explicit bounds.

Change

  • Capability Opt-In & Isolation:
    • Add optional elicitation?: boolean to AntigravityAcpRuntimeInput in AntigravityAcpSupport.ts.
    • When true, advertises elicitation: { form: {} } in clientCapabilities. (Leaves it omitted for installation validation and helper probes to prevent spurious prompts in headless contexts).
    • Opt into elicitation specifically for interactive Antigravity chat sessions in AntigravityAdapterV2.ts.
  • Multi-Select & Schema Option Extraction in AcpAdapterV2.ts:
    • Detect record?.type === "array" and set multiSelect: true (omitted if maxItems === 1 so UI behaves as single-select and serializes back as a 1-item array).
    • Inspect items.oneOf / items.anyOf (const, title, description) and items.enum to populate question options for multi-select.
    • Skip empty/blank option values while preserving raw values with surrounding whitespace in parseChoiceOptions and parseEnumOptions to uphold TrimmedNonEmptyString contracts.
    • Preserve single-select option extraction for non-array fields (oneOf, anyOf, enum).
    • Set allowCustomAnswer: false whenever options.length > 0 || record?.type === "boolean" to prevent invalid arbitrary user inputs on fixed option sets.
    • Track required: true when field id is present in requestedSchema.required.
  • Answer Type Coercion & Schema Boundary Enforcement in elicitationContent:
    • Coerce boolean schemas ("true" / "false" strings or arrays to native boolean).
    • Enforce integer validation (Number.isInteger(num)), rejecting floating-point values for integer fields.
    • Enforce minimum and maximum numerical boundaries, omitting non-compliant values.
    • Enforce array constraints: reject over-limit array answers exceeding propSchema.maxItems (rather than silently slicing) and omit answers failing minItems.
    • Normalize strings and fallback gracefully for untyped properties.
  • Decline Handling for Missing Required Fields:
    • If any required field in requestedSchema.required is missing from content (due to validation rejection or user omission), return { action: "decline" } rather than { action: "accept" }, preventing agent-side schema validation crashes.
  • Tests:
    • Added unit test suite in AcpAdapterV2.test.ts verifying multi-select parsing, single-select preservation, choice sanitization, whitespace preservation, schema constraints, array rejection, allowCustomAnswer: false, decline on missing required fields, and answer type coercion.
    • Added test in AntigravityAcpSupport.test.ts verifying conditional elicitation.form capability negotiation.
    • Added assertion in AntigravityAdapterV2.test.ts verifying Antigravity chat sessions pass elicitation: true to the ACP runtime.

Stacked on PR 1 (#15746).
Closes #15743.

Side-Effects & Compatibility Analysis

  • Interactive vs. Helper Runtimes: Non-interactive runtimes (installation verification, credential check, setup probes) do not set elicitation: true. This prevents the agent from hanging on an elicitation request in headless operations.
  • Cross-Provider Isolation: AntigravityAcpSupport.ts isolates capability negotiation to Antigravity. Other ACP agents (Grok, Devin, generic ACP registry providers) maintain their existing capability declarations. If a registry agent emits form elicitation, AcpAdapterV2 now safely handles its schema and enforces bounds without regressions.
  • Decline Behavior vs. RPC Errors: Returning { action: "decline" } when required fields are missing conforms to ACP semantics and allows the agent to recover with a follow-up turn, avoiding remote JSON-RPC -32602 invalid params exceptions.
  • Client UI Parity: Verified with web (ComposerPendingUserInputPanel, pendingUserInput) and mobile (pendingUserInputLayout). Supports single-select radio auto-advance (200ms debounce), multi-select checkbox toggling in place, numeric keyboard shortcuts 1-9, and displacement of typed text back to composer.

Scope and approval

Verification

  • pnpm vp test run apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts -t "ACP elicitation question parsing and answer serialization" (all passed).
  • pnpm vp test run apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts (120/120 passed).
  • pnpm vp test run apps/server/src/provider/acp/AntigravityAcpSupport.test.ts (37/37 passed).
  • pnpm vp test run apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts (8/8 passed).
  • pnpm vp test run apps/server/src/provider/AntigravityInstallation.test.ts (33/33 passed).
  • pnpm --filter @t3tools/web test src/pendingUserInput.test.ts (23/23 passed).
  • pnpm --filter @t3tools/mobile test src/features/threads/pendingUserInputLayout.test.ts (3/3 passed).
  • Full monorepo typecheck passed cleanly with 0 errors (pnpm --filter t3 typecheck).

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Antigravity ACP agent cannot use native elicitation or multi-select questions

2 participants