GeezerVison is showing github.com — refactor(antigravity): reuse parseElicitationForm and harden ask_question companion handling by tooooolong · Pull Request #1 · neurovariant/t3code
Conversation
tooooolong
commented
Nov 23, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Companion PR for pingdotgg#40547 (fixing pingdotgg#37111).
We ran into the same Antigravity ask_question double-card bug and went through a couple of review passes before realizing you already had pingdotgg#40547 open. Rather than opening a duplicate PR upstream, here are the structural refinements, edge-case fixes, and discussion follow-ups rebased directly onto your branch.
What this changes
-
Reuse canonical parseElicitationForm in a focused module (AntigravityElicitationForm.ts)
- Re-exports
parseElicitationForm from packages/provider-acp/src/server/adapter.ts (+1 line) and extracts the Antigravity elicitation logic out of AntigravityProtocol.ts into apps/server/src/provider/acp/AntigravityElicitationForm.ts.
- Delegates JSON Schema validation, option extraction,
minItems/maxItems enforcement, and typedAnswer validation to parseElicitationForm instead of re-implementing them, and keeps AntigravityProtocol.ts free of upward AcpAdapterV2Flavor imports.
-
Tighter native ask_question matching (protects ordinary MCP forms & cognition.ai/allowOther)
- Requires every property in the form to be a
q<N> question or its matching q<N>_other companion (title === "Other", description starting with "Optional free-form answer to:" matching the trimmed question title—tolerating leading whitespace in title), with no non-empty field.description.
- Defers requests with
_meta["cognition.ai/allowOther"] === true to the generic parser so explicit allow-other schemas keep writing free-form answers back to the primary field instead of _other.
-
Strict, co-located attachment suffix parsing (userInputAttachments.ts)
- Exports
isUserInputAttachmentReference and splitUserInputAttachmentSuffix alongside appendUserInputAttachmentPaths.
- Validates each
\n-joined attachment line with JSON.parse on the quoted label/path literals (so hand-typed incomplete quotes or invalid escapes like 1\n\nAttached file "example": "C:\docs\spec" are not falsely split as option + attachment) and splits at lastIndexOf("\n\n") so option values containing \n\n still split cleanly.
-
Explicit [], minItems/maxItems, and valid blank single-select options
- Multi-select preserves explicit
{ q1: [] } (including when attachments are appended) when minItems === 0, and cancels out-of-bounds [attachment] payloads when minItems >= 1.
- Single-select checks exact declared option matches before rejecting blank custom text.
-
Real makeAntigravityAdapterV2 stdio JSON-RPC tests (also resolves CodeRabbit's duplicate-test nitpick)
- Consolidates elicitation coverage into
AntigravityAdapterV2.test.ts (removing the duplicate assertions from AntigravityProtocol.test.ts) and adds real makeAntigravityAdapterV2 + acp-mock-agent.ts round-trip tests using real appendUserInputAttachmentPaths output, verifying both native 2-question folding and intact ordinary MCP form fallback on the same adapter.
-
Update Antigravity user docs (docs/user/providers-antigravity.md)
Scope decision
- Kept intentionally server-side only (no changes to
packages/contracts, packages/client-runtime, apps/web, or apps/mobile), preserving T3's existing mutually-exclusive option vs. custom-answer card UX.
Before / After (Web UI)
| Before (2 questions → 4 steps, duplicate optionless "Other" card) |
After (2 questions → 2 steps, question text in body) |
 |
 |
 |
 |
Verification
vp fmt --check, vp lint (0 warnings, 0 errors), vp run knip:check
vp run --filter @t3tools/provider-acp --filter t3 typecheck
vp test run: 123/123 passed (AntigravityAdapterV2.test.ts, AntigravityProtocol.test.ts, userInputAttachments.test.ts)
- Manual Web UI verification against isolated dev state (screenshots above)
Built with Gemini 4 Neon (Antigravity harness in T3 Code), reviewed with Codex GPT-6.2 Astra.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|