feat(ai): add support for antigravity, opencode, and pi CLI integrations - #1265
feat(ai): add support for antigravity, opencode, and pi CLI integrations#1265Paslestrange wants to merge 21 commits into
Conversation
## Summary - replace the overloaded local `isolated` switch with explicit `safeguarded` and `full-local` execution profiles - default Claude CLI and Codex to Radar safeguards while allowing users to opt out into their normal agent setup; Cursor exposes only its full local setup because Radar cannot reliably isolate it - centralize profile capabilities, defaults, validation, persistence, and agent/profile-scoped consent in `internal/ai` - apply profile-specific driver behavior: strict Radar-only MCP/tool constraints in safeguarded mode, normal user configuration in full-local mode, and explicit rejection of unsupported combinations - explain the selected behavior in AI settings and require just-in-time consent in the diagnose drawer for each exact agent/profile surface - deep-link the diagnose drawer’s settings action to the AI settings section and size the dialog to show the full profile configuration without routine scrolling - probe the installed Cursor Agent for the anchored `--trust` flag rather than assuming version-specific support - reconcile agents found on `PATH` with the drivers Radar actually initialized, including `RADAR_AI_CLI_BIN` overrides in both the server API and standalone pre-boot consent - preserve Radar Hub hosted-agent consent while keeping local execution profiles separate ## Product and security model `Radar safeguards` is the default wherever the installed agent can enforce Radar’s restrictions. `Your <agent> setup` is an explicit opt-out that uses the agent’s normal configuration, tools, and MCP servers. The disclosure is agent-specific: - Claude CLI full-local uses the permissions from the user’s setup; Radar does not override them - Codex full-local retains the CLI’s own sandbox, but Radar cannot constrain external MCP servers - Cursor is full-local only and always loads global MCP servers, so Radar cannot exclude them Consent is versioned per exact agent/profile surface. Supported agents must advertise at least one profile, every advertised surface must have a configured disclosure version, and unsupported combinations are rejected centrally and by each driver. There is intentionally no compatibility translation for the removed `isolated` field, and profileless persisted local runs are not resumed under an implied security posture. ## Verification - `make tsc` - `make test` - `make build` - focused AI, diagnose CLI, server, and frontend tests - `git diff --check` - manual live UI verification of profile switching, agent-specific warnings, consent, settings deep-linking, and dialog sizing - live real-cluster diagnosis of the same crash-looping pod with: - Claude CLI safeguarded - Codex safeguarded - Codex full-local - Cursor full-local - every live run completed and called Radar MCP tools; no cluster writes were performed - driver tests cover both Claude CLI profiles, including the full-local command, environment, and MCP behavior - standalone regression coverage verifies that pre-boot consent honors a `RADAR_AI_CLI_BIN` override - installed versions exercised: Claude CLI 2.1.220, Codex 0.145.0, Cursor 2026.07.23-e383d2b ## Release note This intentionally changes the public diagnose customization context from `isolated` / `setIsolated` to `profile` / `setProfile`. The next `@skyhook-io/radar-app` publication containing this PR must use a major tag (`radar-app-v2.0.0`), rather than changing the source package placeholder version. ## Follow-up The additional CLIs in #1265 can rebase on this framework and declare their supported profiles, defaults, driver enforcement, and disclosure copy individually. Fixes #1272
nadaverell
left a comment
There was a problem hiding this comment.
Thanks again for pushing these integrations forward. We’ve now merged #1273, which adds the execution-profile and consent framework we wanted in place before adding more active diagnosis runners. Could you rebase this PR on main and adapt each new CLI to that framework?
For each agent, please declare only the execution profiles the CLI can honestly enforce. “Radar safeguards” requires verified isolation from the user’s other tools and MCP servers; otherwise expose only “Your setup,” validate that profile in the driver, and preserve the agent’s normal configuration/environment with the corresponding warning. In particular, Antigravity’s unconditional --dangerously-skip-permissions should not be presented as safeguarded unless the CLI also provides verified controls that disable its built-in and external tooling.
Please also address the current functional gaps before marking the agents supported: OpenCode should obtain its resumable sessionID from structured JSON output, and Pi’s Radar MCP access needs a verified/configured MCP extension rather than only writing a file Pi does not natively load.
Because these CLIs have independent config, tool-loading, streaming, and session semantics, please consider splitting them into one PR per agent if validating all three together becomes unwieldy. That isn’t required if you can verify each one thoroughly in this PR, but smaller PRs would let us review and land the proven integrations independently rather than blocking the whole contribution on the least-certain CLI.
The framework should keep each adaptation fairly contained: profile declaration, driver validation/behavior, and consent copy/tests for that agent. Happy to help clarify the intended contract.
… OpenCode, and Pi
…are more than 3 agents
…igravity, OpenCode, and Pi drivers
…OpenCode, Antigravity, and Pi drivers
…i/mcp.json for Pi driver
… mode and expand config locations
…solution, and correct Antigravity config path in UI
…sion ID regex parsing
…ty permission skip to apply turns
…profiles framework
e6d8281 to
b7a0a83
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b7a0a83. Configure here.
…n-Claude model TextField branching
|
thanks for rebasing and taking another pass at this. i took another look and i think there are still a few things to sort out before this is ready:
maybe it makes sense to split these up? opencode looks closest to working end-to-end, while pi and antigravity seem to need a bit more integration work / upstream verification. for each one, could you include a quick real smoke test covering MCP discovery, initial diagnosis, capturing the session id, a resumed follow-up, and an apply turn? then add tests around whatever args/config/output format that test confirms. happy to help with the small radar-side cleanup once those behaviors are verified, but i’m a little wary of us filling in the missing pieces based only on the CLI docs. |

This PR adds auto-detection, configuration setup, and active diagnostic runner drivers for three additional AI agent CLI tools as requested in discussion #1252:
agy/antigravitybinaries, configures~/.gemini/antigravity-cli/config.json)opencodebinary, configures~/.config/opencode/opencode.json)pibinary, configures~/.pi/agent/mcp.json)Key Changes
internal/ai/agent_antigravity.go,internal/ai/agent_opencode.go,internal/ai/agent_pi.go): Implemented theAgentinterface drivers for these CLIs, mapping target prompt/remediation variables, session continuation flag mappings, model selectors, and standard output log stream parsing.internal/ai/agent.go,internal/ai/diagnoser.go): Added the new drivers to theresolveAgentswitch-case and added them toagentCLICandidatesto mark them as fullySupportedby Radar's diagnosis executor.internal/ai/detect.go): Added the new agents toknownAgentsand resolved binary names dynamically (such as mappingantigravitytoagydynamically via LookPath).web/src/components/home/MCPSetupDialog.tsx): Consolidated configuration generation helper methods and created accurate MCP configs matching each agent's native format and schema directory path structure.Addresses discussion #1252.
Note
Medium Risk
New subprocess drivers and apply-mode flags (e.g. Antigravity
--dangerously-skip-permissions) touch the diagnosis execution path; changes are additive with tests for command/config wiring, but mis-parsed streams or wrong MCP config could break investigations for users who select these agents.Overview
Adds three new local AI agent backends so Radar can drive Antigravity (
agy), OpenCode, and Pi for AI diagnosis—not just Claude, Codex, and Cursor.Each backend implements the shared
Agentinterface: spawn CLI with Radar’s MCP URL, write per-tool config in the workdir, parse stdout into diagnoses and session IDs, and restrict execution to full-local only (no safeguarded profile).Detection and routing extend
knownAgents,agentCLICandidates, andresolveAgent(includingagy/pi-coding-agentbinary aliases). Provider env prefixes inscrubbedEnvwiden slightly for non-Claude auth.Web UI: diagnose settings use a dropdown when more than three agents are installed; model placeholders cover the new agents. MCP setup consolidates JSON helpers and documents Antigravity, OpenCode, and Pi paths and config shapes.
Reviewed by Cursor Bugbot for commit 54010f0. Bugbot is set up for automated code reviews on this repo. Configure here.