Conversation
… transcript Pi 0.86.0 changed a custom provider's stream input from `Context` to a normalized `TranscriptContext`: the system prompt and tool declarations are folded into a leading transcript system message. The Antigravity adapter still read `context.systemPrompt` / `context.tools`, so that system message fell through to the tool-result branch and became a `functionResponse` with no name — Cloud Code Assist rejects it as `contents[0].parts[0]`, failing every request. Even without that 400, the system prompt and all tool declarations were silently dropped. Add a shared transcript resolver that replays system messages into the prompt and tool set currently in effect, mirroring Pi's `getCurrentSystemPrompt` / `getCurrentTools` without importing helpers that do not exist before Pi 0.86, and keep the `Context` shape working unchanged. The Google converter now skips non-conversation roles and nameless tool results instead of emitting an invalid `functionResponse`. Cursor read the same two fields and silently fell back to its generic chat-only prompt with no tools; it resolves the transcript as well. Verified: - differential: resolveTranscript matches Pi 0.87.1 getCurrentSystemPrompt / getCurrentTools across five message sets - antigravity 58/58 and cursor 35/35; the new regression tests fail without the fix - real google-antigravity turns on gemini-3.8-flash-high and claude-sonnet-4-6: plain reply plus a read-tool round trip - node tests 1888 passed / 0 failed; typecheck has no new errors (the 20 pre-existing ones come from node-pty/@XTerm not being installed here)
|
CI note: That test is pre-existing and sets The Windows job is currently failing on other branches for unrelated tests — docs-only #618 failed it on |
Problem
Closes #619.
Pi 0.86.0 changed a custom provider's stream input from
Contextto a normalizedTranscriptContext: the system prompt and tool declarations are folded into a leading transcript system message, and later system messages carry prompt/tool deltas. The Antigravity adapter still readcontext.systemPrompt/context.tools, so that leading system message fell through to the tool-result branch and became afunctionResponsewith no name:Every request on Pi 0.86+ failed, and independently of the 400 the system prompt and all tool declarations were dropped. Cursor read the same two fields and silently fell back to its generic chat-only prompt with no tools.
Value
google-antigravityworks again on Pi 0.86+ while the declared Pi 0.85.1 baseline keeps working unchanged, and the failure class is closed at the shared cause rather than per provider.Approach
extensions/ai-providers/transcript.ts: replays transcript system messages into the prompt and tool set currently in effect, mirroring Pi'sgetCurrentSystemPrompt/getCurrentToolswithout importing helpers that do not exist before Pi 0.86.applyTranscriptreturns the oldContextuntouched, so Pi <= 0.85.1 behavior is preserved exactly.buildRequestBodyresolves the transcript once;convertMessagesreceives conversation messages only;buildToolstakes the resolved tool list.functionResponse.buildCursorRequest/streamCursorresolve the transcript at the entry point.Validation
getCurrentSystemPrompt/getCurrentTools) across five message sets — leading system message; later section patch withtoolsRemoved/toolsAdded; content plus sections; two system messages; no system message. Prompt text and tool set are identical in all five.tests/extensions/ai-providers/antigravity.test.ts58/58 andcursor.test.ts35/35. The four new regression tests fail when the provider changes are stashed, so they pin the regression rather than the implementation.-ne -ns -np -nc --no-session -e extensions/ai-providers/index.ts:@tt-a1i/openpi@0.8.1): the exact 400 from bug(antigravity): Pi 0.86+ 下 provider stream 收到 TranscriptContext,每次请求都以 400 失败 #619;gemini-3.8-flash-highplain reply,readtool round trip, andclaude-sonnet-4-6readtool round trip.node --test: 1888 passed / 0 failed / 5 skipped.bun run lint,format:check,check:config-contract,check:docs-contract,check:disciplinepass.tsc --noEmitreports 20 errors, identical to the baseline on this checkout (missingnode-pty/@xterm/*): 0 new.Impact
extensions/ai-providers/antigravity/google-conversion.ts, which fix(antigravity): preserve local schema refs #488 also modifies; this branch is based on43cd2e9and does not include fix(antigravity): preserve local schema refs #488.