Repository navigation
refactor(antigravity): reuse parseElicitationForm and harden ask_question companion handling - #1
Open
tooooolong wants to merge 2 commits into
Conversation
…tion companion handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Companion PR for pingdotgg#40547 (fixing pingdotgg#37111).
We ran into the same Antigravity
ask_questiondouble-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
parseElicitationFormin a focused module (AntigravityElicitationForm.ts)parseElicitationFormfrompackages/provider-acp/src/server/adapter.ts(+1 line) and extracts the Antigravity elicitation logic out ofAntigravityProtocol.tsintoapps/server/src/provider/acp/AntigravityElicitationForm.ts.minItems/maxItemsenforcement, andtypedAnswervalidation toparseElicitationForminstead of re-implementing them, and keepsAntigravityProtocol.tsfree of upwardAcpAdapterV2Flavorimports.Tighter native
ask_questionmatching (protects ordinary MCP forms &cognition.ai/allowOther)q<N>question or its matchingq<N>_othercompanion (title === "Other",descriptionstarting with"Optional free-form answer to:"matching the trimmed question title—tolerating leading whitespace intitle), with no non-emptyfield.description._meta["cognition.ai/allowOther"] === trueto 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)isUserInputAttachmentReferenceandsplitUserInputAttachmentSuffixalongsideappendUserInputAttachmentPaths.\n-joined attachment line withJSON.parseon the quoted label/path literals (so hand-typed incomplete quotes or invalid escapes like1\n\nAttached file "example": "C:\docs\spec"are not falsely split as option + attachment) and splits atlastIndexOf("\n\n")so option values containing\n\nstill split cleanly.Explicit
[],minItems/maxItems, and valid blank single-select options{ q1: [] }(including when attachments are appended) whenminItems === 0, and cancels out-of-bounds[attachment]payloads whenminItems >= 1.Real
makeAntigravityAdapterV2stdio JSON-RPC tests (also resolves CodeRabbit's duplicate-test nitpick)AntigravityAdapterV2.test.ts(removing the duplicate assertions fromAntigravityProtocol.test.ts) and adds realmakeAntigravityAdapterV2+acp-mock-agent.tsround-trip tests using realappendUserInputAttachmentPathsoutput, 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
packages/contracts,packages/client-runtime,apps/web, orapps/mobile), preserving T3's existing mutually-exclusive option vs. custom-answer card UX.Before / After (Web UI)
Verification
vp fmt --check,vp lint(0 warnings, 0 errors),vp run knip:checkvp run --filter @t3tools/provider-acp --filter t3 typecheckvp test run: 123/123 passed (AntigravityAdapterV2.test.ts,AntigravityProtocol.test.ts,userInputAttachments.test.ts)Built with Gemini 4 Neon (Antigravity harness in T3 Code), reviewed with Codex GPT-6.2 Astra.