Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ branch (`feat/pf12-protocol-rollout`); PF-10 is developed in parallel and is not

| Path | State after this unit |
|---|---|
| Chat/Messages request decode | still produces a Responses-shaped body before the IR (`responses-internal`) on every non-native path, with one exception: behind `antigravityDirect`, a Chat request to one concrete Antigravity route decodes straight into the IR (`src/protocols/codecs/chat-ir.ts`, path `chat,ir,other`; see `devlog/_plan/261014_antigravity_direct_protocols/`). Messages decode and every other route still use the named entry points over the existing translators (`chatCompletionsToResponsesBody`, `anthropicToResponsesTranslation`) |
| Chat/Messages request decode | still produces a Responses-shaped body before the IR (`responses-internal`) on every non-native path, with one exception: under `antigravityDirect` (on by default), a Chat or Messages request to one concrete Antigravity route decodes straight into the IR (`src/protocols/codecs/chat-ir.ts`, `messages-ir.ts`, paths `chat,ir,other` and `messages,ir,other`; see `devlog/_plan/261014_antigravity_direct_protocols/`). Every other route still uses the named entry points over the existing translators (`chatCompletionsToResponsesBody`, `anthropicToResponsesTranslation`) |
| Chat ↔ Messages direct codecs | not implemented: `chat,ir,messages` and `messages,ir,chat` are baseline targets only; both pairs travel `responses-internal` |
| Chat/Messages response encode (PF-09) | migrated behind `directEncoders` only where `directEncodersApply` and `clientEncoderForDelivery` both agree: one concrete, non-Responses-wire route in the streaming adapter delivery, giving response path `[upstream, ir, client]` while the request path stays the bridge path. Still through `responses-internal`: combo and policy children (`comboAttempt`, `routeKind` combo/policy), routed compaction, run-turn adapters (Cursor, Devin, coding-agent CLIs, CodeBuddy), sidecar turns, the buffered `parseResponse` branch (unused by these ingresses, which always stream internally), and every route while the switch is off. Responses-wire upstreams keep their existing codec path |
| Policy-route children | not migrated (PF-07): `routeModel` evaluates the policy and returns one concrete candidate, so a policy request never reaches the combo child loop and keeps the Chat bridge |
Expand Down
14 changes: 8 additions & 6 deletions devlog/_plan/261014_antigravity_direct_protocols/000_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ unchanged.

## Route map (eligible concrete Antigravity route)

| Inbound | Before | After (`antigravityDirect` on) |
| Inbound | Before | After (`antigravityDirect`, on by default) |
|---|---|---|
| Responses | `responses -> ir -> other`, answer `other -> ir -> responses` | unchanged; already direct (`parseRequest`, `bridgeToResponsesSSE`) |
| Chat | `chat -> responses-internal -> ir -> other`; answer `other -> ir -> responses-internal -> chat` (`other -> ir -> chat` only with `directEncoders`) | `chat -> ir -> other`; answer `other -> ir -> chat` |
| Messages | `messages -> responses-internal -> ir -> other` | unchanged in this unit (follow-up below) |
| Messages | `messages -> responses-internal -> ir -> other`; answer `other -> ir -> responses-internal -> messages` (`other -> ir -> messages` only with `directEncoders`) | `messages -> ir -> other`; answer `other -> ir -> messages` |

## Design

Expand All @@ -61,10 +61,12 @@ and the end-to-end test requires the same Antigravity wire body on both lanes.

## Follow-ups

- Messages -> Antigravity direct decode. The Messages ingress applies more bridge-body policy
(model resolution, prompt-cache key, blocked-skill elision, cache stabilization, `ocxr1`
reasoning envelopes and the native reasoning replay map), so it needs its own parity corpus and
decline rules; stack it on this branch.
- Messages -> Antigravity direct decode: done in the follow-up PR (`messages-ir.ts`,
`src/server/messages-antigravity-direct.ts`). The lane is planned before translation on the
settings-only body (resolved model, prompt-cache key) against a route preview, reproduces
blocked-skill elision, cache stabilization, envelopes and the native replay map, and declines
hosted web search, vision preprocessing, the shadow intercept and core-rewritten text. The same
PR turns `antigravityDirect` on by default for both lanes; an explicit `false` turns it off.
- Claude-on-Antigravity thinking continuity: the Google adapter sends assistant thinking parts
nowhere today; only call-bound `thoughtSignature`s survive. Carrying Claude thinking blocks as
`thought: true` parts (as CLIProxyAPI does) is an adapter change for both lanes, not part of
Expand Down
8 changes: 4 additions & 4 deletions docs-site/src/content/docs/guides/protocol-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ each candidate and skips one that cannot carry the request.

## Rollout switches

These switches stage the new paths. Each defaults to off, and a switch that is off changes nothing.
These switches stage the new paths. Each defaults to off except `antigravityDirect`, and a switch that is off changes nothing.

| Switch | When on |
| --- | --- |
| `nativeChatCombos` | An eligible Chat candidate inside a combo is sent natively from its own copy of the client body; the other candidates keep the bridge. |
| `managedMessagesNative` | A Messages request whose route is a direct, key-authenticated Anthropic provider is sent as Messages instead of through the bridge. Routes that need bridge-only behaviour (a pinned effort, blocked-skill elision, the web-search sidecar, vision preprocessing, synthetic rows) stay on the bridge. |
| `managedMessagesNativeOAuth` | Native Messages for the unpooled `anthropic` OAuth provider on `api.anthropic.com`. Effective only together with `managedMessagesNative`; a pooled Anthropic OAuth account set stays on the bridge. |
| `directEncoders` | For a non-Responses upstream, the answer to a Chat or Messages client is encoded directly from the adapter's events instead of through the internal Responses stream. The request side is unchanged. |
| `antigravityDirect` | A Chat request whose route is one Google Antigravity provider skips the internal Responses body in both directions: the conversation is decoded from the Chat body straight into what the Google adapter compiles from, and the answer is encoded directly as with `directEncoders`. The path reads `chat -> ir -> other`. Request settings (model, effort, limits, tool choice) still pass through the usual policies, so account rotation, effort rules and usage are unchanged. Combos, policies, a hosted web-search tool, images for a model marked text-only, and a model the shadow-call intercept could rewrite stay on the bridge, and the log row names the reason. |
| `antigravityDirect` | **On by default**; set it to `false` to turn it off. A Chat or Messages request whose route is one Google Antigravity provider skips the internal Responses body in both directions: the conversation is decoded from the client body straight into what the Google adapter compiles from, and the answer is encoded directly as with `directEncoders`. The path reads `chat -> ir -> other` or `messages -> ir -> other`. Request settings (model, effort, limits, tool choice) still pass through the usual policies, so account rotation, effort rules and usage are unchanged. Combos, policies, a hosted web-search tool, images for a model marked text-only, a model the shadow-call intercept could rewrite, and text the proxy rewrites (a skills catalog, a generated-image link) stay on the bridge, and the log row names the reason. |
| `shadowPlan` | At the end of each Chat or Messages request, the plan a preview would have predicted is compared with the path the request took; a disagreement adds `planMismatch: true` to the log row's path record. No second request is sent. |

Change them with the CLI or by editing `protocols` in `config.json`
Expand Down Expand Up @@ -133,8 +133,8 @@ does not display it yet.
These paths still use the internal Responses bridge or are not covered:

- Chat and Messages requests are still decoded into a Responses-shaped body before the IR, including
on a translated path. The exception is a Chat request to a single Google Antigravity route with
`antigravityDirect` on. Messages requests to Antigravity still use the bridge.
on a translated path. The exception is a Chat or Messages request to a single Google Antigravity route,
unless `antigravityDirect` is set to `false`.
- Routing-policy candidates, combos reached through an effort row, combo candidates while
`nativeChatCombos` is off, and Messages combos.
- Direct encoding (`directEncoders`) covers only a concrete, non-Responses route in streaming
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ modes, the preview, and the per-request trace.
| `protocols.rollout.managedMessagesNative?` | `boolean` | `false` | Send Messages natively to a direct, key-authenticated Anthropic provider instead of through the internal Responses bridge. |
| `protocols.rollout.managedMessagesNativeOAuth?` | `boolean` | `false` | Native Messages for the `anthropic` OAuth provider on `api.anthropic.com`, including stored account pools. Requires `managedMessagesNative`. For the settled `anthropic` provider, an enabled pool supplies true for absent native flags when `anthropicAccountPool.nativeMessages` is absent or true. Explicit false/malformed flags and a false/malformed pool preference remain off. Other providers and pool-off keep explicit rollout behavior. Eligible pooled requests retain shared selection, affinity and bounded pre-output recovery. Recognized JSON-string `metadata.user_id` account UUIDs are aligned with the serving OAuth credential; device and session fields are preserved. |
| `protocols.rollout.directEncoders?` | `boolean` | `false` | Encode Chat and Messages answers from a non-Responses upstream directly from adapter events. |
| `protocols.rollout.antigravityDirect?` | `boolean` | `false` | Send a Chat request to a single Google Antigravity route without the internal Responses body in either direction. Request settings still pass through the usual policies. |
| `protocols.rollout.antigravityDirect?` | `boolean` | `true` | Send a Chat or Messages request to a single Google Antigravity route without the internal Responses body in either direction. Request settings still pass through the usual policies, and a request the lane cannot carry uses the bridge. Set `false` to turn it off. |
| `protocols.rollout.shadowPlan?` | `boolean` | `false` | Compare each Chat or Messages request's path with the plan a preview predicts and mark a disagreement as `planMismatch` on its log row. Sends nothing extra. |

Malformed protocol blocks retain a conservative disabled native policy when loaded from disk.
Expand Down
2 changes: 2 additions & 0 deletions scripts/test-layout/layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@
"protocol-chat-ir-parity.test.ts": "responses",
"protocol-antigravity-direct-chat.test.ts": "responses",
"protocol-antigravity-direct-eligibility.test.ts": "responses",
"protocol-messages-ir-parity.test.ts": "responses",
"protocol-antigravity-direct-messages.test.ts": "responses",
"chat-native-combo.test.ts": "responses", "jev-initial-effort-wire.test.ts": "responses",
"messages-native-eligibility.test.ts": "responses",
"responses-first-send-reservation.test.ts": "responses", "responses-first-send-spend-policy.test.ts": "responses", "responses-dispatch-receipt.test.ts": "responses", "responses-hosted-send-hop.test.ts": "responses", "responses-hosted-send-producer.test.ts": "responses", "responses-hosted-send-reservation.test.ts": "responses", "responses-hosted-send-round-parity.test.ts": "responses", "responses-hosted-send-unsent-hop.test.ts": "responses", "responses-hosted-send-ws.test.ts": "responses",
Expand Down
2 changes: 1 addition & 1 deletion skills/ocx/references/01_surface_access-remote.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ State-changing: yes.
|---|---|---|
| `--messages` | string | Open or close the Messages API: on or off. Off also turns the Claude integration off. |
| `--unrepresentable` | string | legacy keeps today's behavior; reject refuses a request its path cannot carry. |
| `--rollout` | string | One switch as name=on or name=off; repeatable. Every switch defaults off. |
| `--rollout` | string | One switch as name=on or name=off; repeatable. Every switch defaults off except antigravityDirect. |
| `--json` | boolean | Emit the resulting GET /api/protocols body. |

JSON mode: `payload`.
Expand Down
Loading
Loading