spike(server): Antigravity CLI provider protocol (#642) - #2
Conversation
Establish the wire contract for driving the Antigravity (agy) CLI as a T3 provider: bounded plan-mode launch and resume argument construction, unavailable/unauthenticated/available classification, stream-json event parsing, and terminal-outcome normalization covering cancellation and missing terminal results. Protocol functions only. Nothing spawns a process or registers a provider, so the live provider catalog is unchanged. Verified against agy 1.1.22 by bounded read-only probe: init, step_update, and result envelopes match the fixtures, and --conversation resume continues step_index and reuses cached context. Spike authored by Desktop_Codex; recovered from a disposable checkout, independently re-verified, and committed by Laptop_Cursor. Task pingdotgg#642.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds the Antigravity CLI protocol. The module builds CLI arguments, classifies availability, parses and normalizes stream events, and maps process exits to provider signals. Tests cover successful, failed, malformed, cancelled, and incomplete protocol flows. ChangesAntigravity protocol
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant AntigravityCLI
participant ProtocolParser
participant ProtocolNormalizer
participant Provider
AntigravityCLI->>ProtocolParser: Emit JSON stream line
ProtocolParser->>ProtocolNormalizer: Return parsed CLI event
ProtocolNormalizer->>Provider: Emit normalized provider signal
AntigravityCLI->>ProtocolNormalizer: Report process exit
ProtocolNormalizer->>Provider: Emit terminal abort or completion signal
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76b159486c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| typeof value.result.conversation_id === "string" && | ||
| typeof value.result.status === "string" | ||
| ) { | ||
| return value as unknown as AntigravityResultEvent; |
There was a problem hiding this comment.
Validate result payload fields before returning them
Once this protocol is wired to an adapter, a version-skewed or malformed result line such as one with response: 7 passes this cast because only conversation_id and status were checked. The normalizer then returns a number where AntigravityProviderSignal.response promises a string, and likewise trusts the duration, turn count, and usage fields, so downstream rendering or accounting can receive invalid runtime data; validate or sanitize these optional fields at the protocol boundary.
AGENTS.md reference: AGENTS.md:L131-L131
Useful? React with 👍 / 👎.
| if (processExit.signal !== null) { | ||
| return { | ||
| type: "turn.aborted", | ||
| status: "CANCELLED", |
There was a problem hiding this comment.
Distinguish crashes from requested cancellation
Once wired, if agy dies from SIGSEGV/SIGABRT or receives SIGKILL from an OOM killer or service manager, every non-null signal is labeled CANCELLED even though the user did not cancel. This hides provider crashes and can produce incorrect failure or retry behavior; carry explicit cancellation intent or classify only an expected, requested termination as cancellation.
AGENTS.md reference: AGENTS.md:L131-L131
Useful? React with 👍 / 👎.
| if (probe.models === null || probe.models.exitCode !== 0) { | ||
| return { | ||
| status: "unauthenticated", |
There was a problem hiding this comment.
Do not treat every model-probe failure as logged out
When the version probe succeeds but agy models exits nonzero because of a transient network error, crash, incompatible CLI version, or another operational failure, this always reports unauthenticated. Future consumers will therefore direct the user to log in instead of surfacing the actual availability problem; return unauthenticated only for an identified authentication error and represent other failures as unavailable or unknown.
Useful? React with 👍 / 👎.
Summary
Spike for task pingdotgg#642 — protocol-only slice for Antigravity (Agy CLI) as a future T3 provider.
AntigravityCliProtocol.ts— availability probe, bounded launch/resume args, stream-json event normalizationAntigravityCliProtocol.test.ts— 9 focused tests (availability, init/step/result parsing, exit normalization)Not a registered provider. Live
builtInProviderCatalogunchanged. Do not merge until permission-round-trip and cancel wire shapes are captured (see vault spike decision record).Verification
vp test run apps/server/src/provider/antigravity/AntigravityCliProtocol.test.ts— 9/9 passvp fmt --check+vp lintclean on both filesagy 1.1.22, plan mode + stream-json verified on DesktopUbuntuGovernance note
--mode plan --sandboxstill advertises mutating tools ininit.tools. Containment ispermission_mode: request-reviewonly — adapter + Unified-Agent approval gate must enforce boundaries.Test plan
Links
00 - Inbox/Unified-Agent and Exocortex Executive Strategy and Roadmap 2026-08-27.md76b15948Made with Cursor
Summary by CodeRabbit
New Features
Bug Fixes
Tests