Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.
feat(computer): run Agents on the Antigravity CLI through ACP
jeffrey599e5f633931
diff --git a/apps/computer/README.md b/apps/computer/README.mdindex 64f517cb..b385ca56 100644--- a/apps/computer/README.md+++ b/apps/computer/README.md@@ -26,7 +26,7 @@ linger-computer login`linger-computer login` authorizes the computer in the browser and starts theDaemon. A server connection token from the Web app works too:`linger-computer login --token-stdin`. Then use `linger-computer daemon status`,-`linger-computer runtime check <codex|claude|pi>`, and `linger-computer doctor`;+`linger-computer runtime check <codex|claude|pi|antigravity>`, and `linger-computer doctor`;`linger-computer --help` lists every command.Conventions and boundaries are in [AGENTS.md](./AGENTS.md).diff --git a/apps/computer/local-daemon/README.md b/apps/computer/local-daemon/README.mdindex fef59ee1..e3402758 100644--- a/apps/computer/local-daemon/README.md+++ b/apps/computer/local-daemon/README.md@@ -9,7 +9,7 @@ control through Linger's Runner Gateway.- `internal/daemon`: daemon lifecycle and local reconciliation loop.- `internal/process`: process ownership, cancellation, and cleanup.-- `internal/provider`: Codex/Claude/Pi execution adapters.+- `internal/provider`: Codex/Claude/Pi/Antigravity execution adapters.- `internal/workspace`: local workspace and Runtime-home preparation.- `internal/protocol`: the Daemon's routed command/event model. The wire shapescome from the generated `contracts/generated/go/runnergateway` module@@ -44,7 +44,7 @@ stops and names the open file.`linger-computer-daemon --config <path>` reads the owner-only config emitted bythe `linger-computer login` flow. It discovers and version-gates the-configured Codex, Claude, and Pi installations.+configured Codex, Claude, Pi, and Antigravity installations.It performs bounded protocol and authentication probes.It periodically refreshes authentication and unavailable Runtimes without a restart.The Claude check also probes idle Context homes, because each one can hold its@@ -63,7 +63,7 @@ from an Operation wire request.Opening the local Registration store deletes records of retired Runtimes such asHermes; connecting and reconnecting report Registration observations only for-Codex, Claude and Pi.+Codex, Claude, Pi and Antigravity.The owner-only control socket supports Runner inspection and local stop, plusmanaged service start/list/stop. Managed services retain PID, process-group,@@ -219,10 +219,54 @@ Computer user's own instruction files:from the projected `config.toml` and its profiles.- Pi runs with `--no-context-files` and an empty `--system-prompt`, so it keepsits built-in prompt instead of the user's `SYSTEM.md`.+- Antigravity is the exception: its ACP server has no switch that turns off+ the user's own rules, skills and `~/.gemini/config/mcp_config.json`, so an+ Antigravity run sees them next to the Daemon's instructions and servers.The user's own Claude Skills and the Skills of plugins they installed are stilloffered to Agents (`internal/workspace/claude_skills.go`).+## Antigravity++The Antigravity CLI (`agy`) runs through its Agent Client Protocol (ACP)+server, `agy acp`: JSON-RPC 2.0 over stdio, one object per line. Its print+mode (`agy -p`) is not used, because it signs in only with Google and waits+for a browser sign-in when signed out.++- Discovery runs `agy --version`, then an ACP `initialize`, then an empty+ `session/new` in HOME. ACP's authentication-required error (`-32000`) on+ `session/new` means signed out. No prompt is sent, so a probe stores no+ conversation.+- When `session/new` needs authentication and the environment carries+ `GEMINI_API_KEY` or `GOOGLE_API_KEY`, the adapter selects the+ `gemini-api-key` method once and retries. A Google sign-in is never+ replaced by a key.+- The model catalog is the session's `model` config option: one model per+ family. A family's reasoning efforts are the levels its+ `<family>-<level>` entries in `availableModels` name. A Run selects them+ with `session/set_config_option` (`model`, then `thought_level`).+- Each Operation runs in its own `agy acp` process; nothing is parked. A+ first Run opens `session/new`, and its turn-started event reports the+ session id as the checkpoint, like a Codex thread. Later Runs reopen it with+ `session/load` and drop the history it replays. An id Antigravity has not+ stored is not a usable session: `session/load` accepts it, but the prompt+ then fails, so Linger never assigns one. A stored session replays at least+ the prompt that made it, so a load that replays no prompt, or that+ Antigravity refuses, ends as `session_not_found` before anything is+ emitted, and the Run continues once in a new session. A Run yields to the+ scheduler only after native work, because its session holds no prompt+ before that.+- The Daemon's instructions go in `_meta.antigravity.systemPrompt.append`, and+ its MCP servers in the session's `mcpServers`.+- `session/request_permission` goes to the Run's permission review when the+ Context has one, with `execute` calls reviewed as shell commands. Otherwise+ the adapter selects the allow option, as Pi runs without review.+- Antigravity reports a model error, such as a rejected API key, as reply text+ and ends the turn with `end_turn`. With no structured signal, such a Run+ completes and the Room shows the text.+- History reads, provider prepare, Local Skill scans and local models do not+ support Antigravity.+## Frozen sourceThe daemon implementation is intentionally maintained as a frozen in-repositorydiff --git a/apps/computer/local-daemon/internal/computercli/arguments.go b/apps/computer/local-daemon/internal/computercli/arguments.goindex d297b1aa..958c005e 100644--- a/apps/computer/local-daemon/internal/computercli/arguments.go+++ b/apps/computer/local-daemon/internal/computercli/arguments.go@@ -8,7 +8,7 @@ import ("strings")-var runtimeTypes = []string{"codex", "claude", "pi"}+var runtimeTypes = []string{"codex", "claude", "pi", "antigravity"}// command is one parsed command line.type command struct {@@ -257,7 +257,7 @@ func parseArguments(rawArgs []string, options parseOptions) (command, error) {return command{}, unknown()}-var runtimeAliases = map[string]string{"codex": "codex", "claude": "claude", "claude-code": "claude", "pi": "pi"}+var runtimeAliases = map[string]string{"codex": "codex", "claude": "claude", "claude-code": "claude", "pi": "pi", "antigravity": "antigravity", "agy": "antigravity"}func parseLogin(args []string, configPath string, options parseOptions) (command, error) {parsed := command{name: "login", configPath: configPath}diff --git a/apps/computer/local-daemon/internal/computercli/arguments_test.go b/apps/computer/local-daemon/internal/computercli/arguments_test.goindex 90c57940..873c026b 100644--- a/apps/computer/local-daemon/internal/computercli/arguments_test.go+++ b/apps/computer/local-daemon/internal/computercli/arguments_test.go@@ -85,6 +85,7 @@ Options:--codex-path <path> Use this Codex executable--claude-path <path> Use this Claude Code executable--pi-path <path> Use this Pi executable+ --antigravity-path <path> Use this Antigravity (agy) executable--config <path> Use another Computer config file`if commandHelp["login"] != want {diff --git a/apps/computer/local-daemon/internal/computercli/cli_test.go b/apps/computer/local-daemon/internal/computercli/cli_test.goindex 57fd0ff2..cc0e7e3a 100644--- a/apps/computer/local-daemon/internal/computercli/cli_test.go+++ b/apps/computer/local-daemon/internal/computercli/cli_test.go@@ -504,15 +504,16 @@ func TestRuntimeCheckWorksWithoutLoginOrDaemon(t *testing.T) {t.Fatalf("exit=%d", code)}output := f.stdout.String()- contains(t, output, "Checking Codex, Claude Code, Pi...\n")- for _, progress := range []string{" Codex READY (1.2.3)\n", " Claude Code NOT_INSTALLED\n", " Pi NOT_INSTALLED\n"} {+ contains(t, output, "Checking Codex, Claude Code, Pi, Antigravity...\n")+ for _, progress := range []string{" Codex READY (1.2.3)\n", " Claude Code NOT_INSTALLED\n", " Pi NOT_INSTALLED\n", " Antigravity NOT_INSTALLED\n"} {contains(t, output, progress)}want := "\nRuntime Status Next step\n" +"Codex READY —\n" +"Claude Code NOT_INSTALLED Install: curl -fsSL https://claude.ai/install.sh | bash\n" +"Pi NOT_INSTALLED Install: npm install -g @earendil-works/pi-coding-agent\n" +- "\n1/3 runtimes ready. This computer can run agents.\n" ++ "Antigravity NOT_INSTALLED Install: curl -fsSL https://antigravity.google/cli/install.sh | bash\n" ++ "\n1/4 runtimes ready. This computer can run agents.\n" +"Model reply not verified. Run linger-computer runtime check <name> --live to verify it.\n"if !strings.HasSuffix(output, want) {t.Fatalf("runtime check=%q", output)@@ -628,12 +629,12 @@ func TestDoctorReportsEveryCheck(t *testing.T) {for _, check := range report.Checks {names = append(names, check.Name+"="+check.Status)}- want := []string{"product-runtime=pass", "config=pass", "credential=pass", "state-directory=pass", "gateway-network=pass", "daemon=pass", "runtime:codex=pass", "runtime:claude=warn", "runtime:pi=warn", "enrollment=pass"}+ want := []string{"product-runtime=pass", "config=pass", "credential=pass", "state-directory=pass", "gateway-network=pass", "daemon=pass", "runtime:codex=pass", "runtime:claude=warn", "runtime:pi=warn", "runtime:antigravity=warn", "enrollment=pass"}if !report.OK || !reflect.DeepEqual(names[:len(want)], want) || report.Checks[len(want)].Name != "browser" {t.Fatalf("checks=%v", names)}if report.Checks[0].Detail != "Bundled Node 26.5.0" || report.Checks[6].Detail != "/usr/local/bin/codex (1.2.3); Runtime preflight passed; remote model access not verified" ||- report.Checks[7].Detail != "Runtime executable not found" || !strings.Contains(report.Checks[9].Detail, "computer_id=computer-local tenant_id=tenant-acme gateway=wss://gateway.example.test/v1/runner-gateway") {+ report.Checks[7].Detail != "Runtime executable not found" || !strings.Contains(report.Checks[10].Detail, "computer_id=computer-local tenant_id=tenant-acme gateway=wss://gateway.example.test/v1/runner-gateway") {t.Fatalf("details=%+v", report.Checks)}f.clear()diff --git a/apps/computer/local-daemon/internal/computercli/config.go b/apps/computer/local-daemon/internal/computercli/config.goindex b2dbd286..9cbffed7 100644--- a/apps/computer/local-daemon/internal/computercli/config.go+++ b/apps/computer/local-daemon/internal/computercli/config.go@@ -152,7 +152,7 @@ func readEnabledRuntimes(value any) ([]string, error) {types = append(types, text)}if !ok || !validRuntimeSelection(types) {- return nil, errors.New("enabled_runtimes must be a nonempty unique subset of codex, claude, pi")+ return nil, errors.New("enabled_runtimes must be a nonempty unique subset of codex, claude, pi, antigravity")}return types, nil}diff --git a/apps/computer/local-daemon/internal/computercli/fixture_test.go b/apps/computer/local-daemon/internal/computercli/fixture_test.goindex 6bb13143..d041be7e 100644--- a/apps/computer/local-daemon/internal/computercli/fixture_test.go+++ b/apps/computer/local-daemon/internal/computercli/fixture_test.go@@ -224,7 +224,8 @@ func runtimeFixtures(configuredPaths map[string]string) []runtimeDiagnostic {claude = runtimeDiagnostic{Type: "claude", Status: "ready", Available: true, EntryPath: configuredPaths["claude"], ExecutablePath: "/canonical/claude"}}pi := runtimeDiagnostic{Type: "pi", Status: "not_installed", ErrorMessage: "Runtime executable not found"}- return []runtimeDiagnostic{codex, claude, pi}+ antigravity := runtimeDiagnostic{Type: "antigravity", Status: "not_installed", ErrorMessage: "Runtime executable not found"}+ return []runtimeDiagnostic{codex, claude, pi, antigravity}}func onlyRuntime(runtimeType string) []runtimeDiagnostic {diff --git a/apps/computer/local-daemon/internal/computercli/help.go b/apps/computer/local-daemon/internal/computercli/help.goindex e68fc796..115ddf5f 100644--- a/apps/computer/local-daemon/internal/computercli/help.go+++ b/apps/computer/local-daemon/internal/computercli/help.go@@ -4,7 +4,8 @@ import "strings"const runtimePathOptions = ` --codex-path <path> Use this Codex executable--claude-path <path> Use this Claude Code executable- --pi-path <path> Use this Pi executable`+ --pi-path <path> Use this Pi executable+ --antigravity-path <path> Use this Antigravity (agy) executable`const configOption = ` --config <path> Use another Computer config file`@@ -97,13 +98,13 @@ Options:linger-computer daemon service stop <name>`,"runtime": `Usage:- linger-computer runtime check [codex|claude|pi] [options]+ linger-computer runtime check [codex|claude|pi|antigravity] [options]Commands:- check Check Codex, Claude Code, and Pi on this computer+ check Check Codex, Claude Code, Pi, and Antigravity on this computer`,"runtime check": `Usage:- linger-computer runtime check [codex|claude|pi] [options]+ linger-computer runtime check [codex|claude|pi|antigravity] [options]Check whether each runtime is installed, signed in, and compatible.Works without login and without a running daemon.@@ -148,7 +149,7 @@ Commands:daemon start|stop|restart Manage the background daemondaemon status Show the connection and runtime summarydaemon logs [-f] Show daemon logs- runtime check [name] Check Codex, Claude Code, and Pi+ runtime check [name] Check Codex, Claude Code, Pi, and Antigravitydoctor Check installation, connection, and runtimesversion Show the CLI versiondiff --git a/apps/computer/local-daemon/internal/computercli/preflight.go b/apps/computer/local-daemon/internal/computercli/preflight.goindex b81d6e25..262812f4 100644--- a/apps/computer/local-daemon/internal/computercli/preflight.go+++ b/apps/computer/local-daemon/internal/computercli/preflight.go@@ -51,7 +51,7 @@ func resolveUsableRuntimePaths(diagnostics []runtimeDiagnostic, requested map[stif slices.ContainsFunc(diagnostics, func(diagnostic runtimeDiagnostic) bool { return diagnostic.ExecutablePath != "" }) {category = categoryCapabilityProbe}- return nil, newError(category, "No supported Runtime passed capability probing (codex, claude, pi)")+ return nil, newError(category, "No supported Runtime passed capability probing (codex, claude, pi, antigravity)")}return paths, nil}diff --git a/apps/computer/local-daemon/internal/computercli/runtime_check.go b/apps/computer/local-daemon/internal/computercli/runtime_check.goindex 2704ce06..9fd3d8c0 100644--- a/apps/computer/local-daemon/internal/computercli/runtime_check.go+++ b/apps/computer/local-daemon/internal/computercli/runtime_check.go@@ -5,7 +5,7 @@ import ("strings")-var runtimeNames = map[string]string{"codex": "Codex", "claude": "Claude Code", "pi": "Pi"}+var runtimeNames = map[string]string{"codex": "Codex", "claude": "Claude Code", "pi": "Pi", "antigravity": "Antigravity"}var runtimeStatuses = map[string]string{"ready": "READY",@@ -38,6 +38,11 @@ func installStep(runtimeType, goos string) string {return "Install: curl -fsSL https://claude.ai/install.sh | bash"case "codex":return "Install Codex: https://github.com/openai/codex"+ case "antigravity":+ if goos == "windows" {+ return "Install: irm https://antigravity.google/cli/install.ps1 | iex"+ }+ return "Install: curl -fsSL https://antigravity.google/cli/install.sh | bash"default:return "Install: npm install -g @earendil-works/pi-coding-agent"}@@ -47,6 +52,8 @@ var signInSteps = map[string]string{"codex": "Run codex login","claude": "Run claude auth login","pi": "Run pi, then /login",+ // agy signs in on its first interactive start.+ "antigravity": "Run agy and sign in with Google, or set GEMINI_API_KEY",}func newRuntimeCheckRow(check runtimeCheck, goos string) runtimeCheckRow {diff --git a/apps/computer/local-daemon/internal/computerconfig/config.go b/apps/computer/local-daemon/internal/computerconfig/config.goindex f2153bf0..326f361c 100644--- a/apps/computer/local-daemon/internal/computerconfig/config.go+++ b/apps/computer/local-daemon/internal/computerconfig/config.go@@ -180,7 +180,7 @@ func Load(path string, environment map[string]string) (Config, error) {return Config{}, errors.New("max_concurrent_operations is invalid")}for runtimeType, runtimePath := range value.RuntimePaths {- if (runtimeType != "codex" && runtimeType != "claude" && runtimeType != "pi") || !filepath.IsAbs(runtimePath) {+ if (runtimeType != "codex" && runtimeType != "claude" && runtimeType != "pi" && runtimeType != "antigravity") || !filepath.IsAbs(runtimePath) {return Config{}, errors.New("runtime_paths is invalid")}}diff --git a/apps/computer/local-daemon/internal/daemon/operations.go b/apps/computer/local-daemon/internal/daemon/operations.goindex 498fabab..cb7244a1 100644--- a/apps/computer/local-daemon/internal/daemon/operations.go+++ b/apps/computer/local-daemon/internal/daemon/operations.go@@ -308,7 +308,7 @@ func terminalPayload(spec provider.OperationSpec, result provider.Result) json.R}var session map[string]anyswitch spec.Provider {- case "codex":+ case "codex", "antigravity":session = map[string]any{"threadId": sessionID}case "claude", "pi":session = map[string]any{"provider": spec.Provider, "sessionId": sessionID, "lingerMaterialized": true}diff --git a/apps/computer/local-daemon/internal/provider/antigravity_probe.go b/apps/computer/local-daemon/internal/provider/antigravity_probe.gonew file mode 100644index 00000000..85f1ffef--- /dev/null+++ b/apps/computer/local-daemon/internal/provider/antigravity_probe.go@@ -0,0 +1,51 @@+package provider++import (+ "context"+ "errors"+ "time"++ "github.com/simplexai-labs/linger/apps/computer/local-daemon/internal/provider/native"+)++// probeAntigravityAuthentication opens an empty ACP session: Antigravity+// answers session/new with ACP's authentication-required error when neither+// a Google sign-in nor a Gemini API key is available.+func probeAntigravityAuthentication(ctx context.Context, executable string, environment map[string]string, timeout time.Duration) runtimeProbeOutcome {+ ctx, cancel := context.WithTimeout(ctx, boundedAuthTimeout(timeout))+ defer cancel()+ probe, err := native.ProbeAntigravity(ctx, native.NewInvocation(executable, nil).WithEnvironment(environment))+ if err != nil {+ message := "Antigravity authentication could not be verified"+ if errors.Is(err, context.DeadlineExceeded) || errors.Is(ctx.Err(), context.DeadlineExceeded) {+ message = "Antigravity authentication check timed out"+ }+ return runtimeProbeOutcome{Status: "error", Code: "RUNTIME_DIAGNOSTIC_FAILED", Message: message}+ }+ if probe.AuthenticationRequired {+ return runtimeProbeOutcome{Status: "authentication_required", Code: "RUNTIME_AUTHENTICATION_REQUIRED", Message: "Open agy and sign in with Google, or set GEMINI_API_KEY, as the Computer user"}+ }+ return runtimeProbeOutcome{Status: "ready"}+}++// antigravityLiveReply runs the live-check prompt as one ACP turn in HOME.+func antigravityLiveReply(ctx context.Context, executable string, environment map[string]string, timeout time.Duration) (string, error) {+ backend, err := native.Open("antigravity", native.Profile{Program: executable, Env: environment})+ if err != nil {+ return "", err+ }+ run, err := backend.Start(ctx, liveCheckPrompt, native.RunSpec{Dir: environment["HOME"], Budget: timeout})+ if err != nil {+ return "", err+ }+ for range run.Events {+ }+ outcome, ok := <-run.Outcome+ if !ok {+ return "", errors.New("Antigravity live check ended without a result")+ }+ if outcome.Status != "completed" {+ return "", errors.New(outcome.Error)+ }+ return outcome.Output, nil+}diff --git a/apps/computer/local-daemon/internal/provider/detection_policy.go b/apps/computer/local-daemon/internal/provider/detection_policy.goindex 62f58490..982a610a 100644--- a/apps/computer/local-daemon/internal/provider/detection_policy.go+++ b/apps/computer/local-daemon/internal/provider/detection_policy.go@@ -32,5 +32,6 @@ var runtimeDetectionPolicies = map[string]runtimeDetectionPolicy{authenticationBeforeProtocol: true,authenticationRefresh: true,},- "pi": {authenticationProbe: probePiAuthentication, authenticationRefresh: true},+ "pi": {authenticationProbe: probePiAuthentication, authenticationRefresh: true},+ "antigravity": {authenticationProbe: probeAntigravityAuthentication, authenticationRefresh: true},}diff --git a/apps/computer/local-daemon/internal/provider/discovery.go b/apps/computer/local-daemon/internal/provider/discovery.goindex 0e1053f5..2434e255 100644--- a/apps/computer/local-daemon/internal/provider/discovery.go+++ b/apps/computer/local-daemon/internal/provider/discovery.go@@ -81,6 +81,7 @@ var runtimeDefinitions = []runtimeDefinition{{"codex", "codex", "app-server"},{"claude", "claude", "stream-json"},{"pi", "pi", "rpc"},+ {"antigravity", "agy", "acp"},}// ValidateRuntimeSelection accepts an omitted scope or a nonempty unique supported subset.diff --git a/apps/computer/local-daemon/internal/provider/discovery_test.go b/apps/computer/local-daemon/internal/provider/discovery_test.goindex 230e9022..f761c4fc 100644--- a/apps/computer/local-daemon/internal/provider/discovery_test.go+++ b/apps/computer/local-daemon/internal/provider/discovery_test.go@@ -45,7 +45,7 @@ esacif err != nil {t.Fatal(err)}- if len(result.Diagnostics) != 3 || result.Diagnostics[0].Status != "ready" || result.Installations["codex"].ExecutablePath != canonical {+ if len(result.Diagnostics) != 4 || result.Diagnostics[0].Status != "ready" || result.Installations["codex"].ExecutablePath != canonical {t.Fatalf("result=%+v", result)}}diff --git a/apps/computer/local-daemon/internal/provider/executor.go b/apps/computer/local-daemon/internal/provider/executor.goindex 8a4b5610..56b12ef7 100644--- a/apps/computer/local-daemon/internal/provider/executor.go+++ b/apps/computer/local-daemon/internal/provider/executor.go@@ -580,7 +580,7 @@ func (e Executor) Start(ctx context.Context, spec OperationSpec, emit EmitFunc)var providerResult native.Outcomevar ok boolfreshSession := false- if spec.OperationKind == "run.start" && spec.Provider != "codex" && spec.Provider != "claude" && spec.Provider != "pi" {+ if spec.OperationKind == "run.start" && spec.Provider != "codex" && spec.Provider != "claude" && spec.Provider != "pi" && spec.Provider != "antigravity" {payload, marshalErr := json.Marshal(map[string]any{"type": "run.started", "turn_id": stableEventID("turn", spec.TaskID),})diff --git a/apps/computer/local-daemon/internal/provider/live_check.go b/apps/computer/local-daemon/internal/provider/live_check.goindex e11d43dc..2453bf7b 100644--- a/apps/computer/local-daemon/internal/provider/live_check.go+++ b/apps/computer/local-daemon/internal/provider/live_check.go@@ -51,7 +51,15 @@ func DiscoverLive(ctx context.Context, options DiscoveryOptions, timeout time.Dufunc checkLive(ctx context.Context, diagnostic RuntimeDiagnostic, environment map[string]string, timeout time.Duration) LiveCheck {started := time.Now()- stdout, stderr, err := runBoundedProbeExchange(ctx, diagnostic.ExecutablePath, liveCheckArgs[diagnostic.Type], environment, "", timeout, nil)+ var stdout, stderr string+ var err error+ if diagnostic.Type == "antigravity" {+ // agy's print mode signs in only with Google; ACP, which Runs use,+ // also accepts a Gemini API key.+ stdout, err = antigravityLiveReply(ctx, diagnostic.ExecutablePath, environment, timeout)+ } else {+ stdout, stderr, err = runBoundedProbeExchange(ctx, diagnostic.ExecutablePath, liveCheckArgs[diagnostic.Type], environment, "", timeout, nil)+ }check := LiveCheck{DurationMS: time.Since(started).Milliseconds(), Reply: truncateRunes(redact.Text(strings.TrimSpace(stdout)), 200)}switch {case err != nil && ctx.Err() == nil && time.Since(started) >= timeout:diff --git a/apps/computer/local-daemon/internal/provider/native/antigravity_acp.go b/apps/computer/local-daemon/internal/provider/native/antigravity_acp.gonew file mode 100644index 00000000..7626edfc--- /dev/null+++ b/apps/computer/local-daemon/internal/provider/native/antigravity_acp.go@@ -0,0 +1,228 @@+package native++import (+ "bytes"+ "context"+ "encoding/json"+ "errors"+ "fmt"+ "io"+ "strconv"+ "sync"+)++// Antigravity speaks the Agent Client Protocol (ACP): JSON-RPC 2.0, one+// object per line, over the stdio of `agy acp`.+const (+ acpProtocolVersion = 1+ // acpAuthRequired is the error code ACP reserves for a request that needs+ // the client to authenticate first.+ acpAuthRequired = -32000+)++var errACPClosed = errors.New("Antigravity ACP stream closed")++// acpError is a JSON-RPC error object.+type acpError struct {+ Code int `json:"code"`+ Message string `json:"message"`+}++func (e *acpError) Error() string {+ return fmt.Sprintf("Antigravity ACP error %d: %s", e.Code, e.Message)+}++// acpFrame is the union of the request, response and notification fields.+type acpFrame struct {+ ID json.RawMessage `json:"id,omitempty"`+ Method string `json:"method,omitempty"`+ Params json.RawMessage `json:"params,omitempty"`+ Result json.RawMessage `json:"result,omitempty"`+ Error *acpError `json:"error,omitempty"`+}++// acpConn is one ACP client connection. Responses go to the call that sent+// the request; notifications and agent requests go to handle, in stream+// order, on the reader goroutine.+type acpConn struct {+ writer io.Writer+ handle func(acpFrame)++ writeMu sync.Mutex+ mu sync.Mutex+ nextID int64+ pending map[string]chan acpFrame+ closed chan struct{}+ readErr error+}++func newACPConn(writer io.Writer, handle func(acpFrame)) *acpConn {+ return &acpConn{writer: writer, handle: handle, pending: map[string]chan acpFrame{}, closed: make(chan struct{})}+}++// serve reads frames until the stream ends. It returns after closed is+// closed, so a pending call never waits on a dead stream.+func (c *acpConn) serve(reader io.Reader) {+ defer close(c.closed)+ scanner := newFrameScanner(reader)+ for scanner.Scan() {+ var frame acpFrame+ if json.Unmarshal(scanner.Bytes(), &frame) != nil {+ continue+ }+ if frame.Method == "" && len(frame.ID) > 0 {+ c.mu.Lock()+ pending := c.pending[string(frame.ID)]+ delete(c.pending, string(frame.ID))+ c.mu.Unlock()+ if pending != nil {+ pending <- frame+ }+ continue+ }+ if frame.Method != "" && c.handle != nil {+ c.handle(frame)+ }+ }+ c.readErr = scanner.Err()+}++func (c *acpConn) write(value any) error {+ var encoded bytes.Buffer+ encoder := json.NewEncoder(&encoded)+ encoder.SetEscapeHTML(false)+ if err := encoder.Encode(value); err != nil {+ return err+ }+ c.writeMu.Lock()+ defer c.writeMu.Unlock()+ _, err := c.writer.Write(encoded.Bytes())+ return err+}++// call sends one request and waits for its response. A JSON-RPC error is+// returned as *acpError.+func (c *acpConn) call(ctx context.Context, method string, params any) (json.RawMessage, error) {+ c.mu.Lock()+ c.nextID+++ id := strconv.FormatInt(c.nextID, 10)+ reply := make(chan acpFrame, 1)+ c.pending[id] = reply+ c.mu.Unlock()+ defer func() {+ c.mu.Lock()+ delete(c.pending, id)+ c.mu.Unlock()+ }()+ if err := c.write(map[string]any{"jsonrpc": "2.0", "id": json.RawMessage(id), "method": method, "params": params}); err != nil {+ return nil, err+ }+ select {+ case frame := <-reply:+ if frame.Error != nil {+ return nil, frame.Error+ }+ return frame.Result, nil+ case <-ctx.Done():+ return nil, ctx.Err()+ case <-c.closed:+ select {+ case frame := <-reply:+ if frame.Error != nil {+ return nil, frame.Error+ }+ return frame.Result, nil+ default:+ }+ return nil, errACPClosed+ }+}++func (c *acpConn) notify(method string, params any) error {+ return c.write(map[string]any{"jsonrpc": "2.0", "method": method, "params": params})+}++// respond answers an agent request.+func (c *acpConn) respond(id json.RawMessage, result any) error {+ return c.write(map[string]any{"jsonrpc": "2.0", "id": id, "result": result})+}++func (c *acpConn) respondError(id json.RawMessage, code int, message string) error {+ return c.write(map[string]any{"jsonrpc": "2.0", "id": id, "error": acpError{Code: code, Message: message}})+}++// acpInitialize performs the ACP handshake and checks the protocol version.+func acpInitialize(ctx context.Context, conn *acpConn) error {+ raw, err := conn.call(ctx, "initialize", map[string]any{+ "protocolVersion": acpProtocolVersion,+ "clientCapabilities": map[string]any{"fs": map[string]any{"readTextFile": false, "writeTextFile": false}, "terminal": false},+ "clientInfo": map[string]any{"name": "linger-computer", "version": "1.0.0"},+ })+ if err != nil {+ return err+ }+ var result struct {+ ProtocolVersion int `json:"protocolVersion"`+ }+ if json.Unmarshal(raw, &result) != nil || result.ProtocolVersion != acpProtocolVersion {+ return errors.New("Antigravity ACP protocol version is unsupported")+ }+ return nil+}++// antigravityAPIKeyEnv are the variables Antigravity reads a Gemini API key+// from when the Google sign-in is absent.+var antigravityAPIKeyEnv = []string{"GEMINI_API_KEY", "GOOGLE_API_KEY"}++// acpOpenSession runs open; when Antigravity reports that it needs+// authentication and the environment carries a Gemini API key, it selects+// the API-key method once and runs open again. A Google sign-in is used+// as is, so a key in the environment never replaces it.+func acpOpenSession(ctx context.Context, conn *acpConn, env map[string]string, open func() (json.RawMessage, error)) (json.RawMessage, error) {+ raw, err := open()+ if !acpNeedsAuth(err) || !antigravityHasAPIKey(env) {+ return raw, err+ }+ if _, authErr := conn.call(ctx, "authenticate", map[string]any{"methodId": "gemini-api-key"}); authErr != nil {+ return nil, err+ }+ return open()+}++func acpNeedsAuth(err error) bool {+ var rpc *acpError+ return errors.As(err, &rpc) && rpc.Code == acpAuthRequired+}++func antigravityHasAPIKey(env map[string]string) bool {+ for _, key := range antigravityAPIKeyEnv {+ if env[key] != "" {+ return true+ }+ }+ return false+}++// acpSession is the part of a session/new or session/load result the+// adapter reads.+type acpSession struct {+ SessionID string `json:"sessionId"`+ Models *struct {+ AvailableModels []struct {+ ModelID string `json:"modelId"`+ Name string `json:"name"`+ } `json:"availableModels"`+ CurrentModelID string `json:"currentModelId"`+ } `json:"models"`+ ConfigOptions []acpConfigOption `json:"configOptions"`+}++type acpConfigOption struct {+ ID string `json:"id"`+ Category string `json:"category"`+ CurrentValue string `json:"currentValue"`+ Options []struct {+ Value string `json:"value"`+ Name string `json:"name"`+ } `json:"options"`+}diff --git a/apps/computer/local-daemon/internal/provider/native/antigravity_catalog.go b/apps/computer/local-daemon/internal/provider/native/antigravity_catalog.gonew file mode 100644index 00000000..3d679bbf--- /dev/null+++ b/apps/computer/local-daemon/internal/provider/native/antigravity_catalog.go@@ -0,0 +1,138 @@+package native++import (+ "context"+ "encoding/json"+ "errors"+ "os"+ "slices"+ "strings"+)++// AntigravityProbe is what one ACP session/new tells about the signed-in+// account: whether a session opens and which models it offers.+type AntigravityProbe struct {+ AuthenticationRequired bool+ Models ModelList+}++// ProbeAntigravity opens an empty ACP session in the invocation's HOME and+// closes it again; no prompt is sent, so Antigravity stores no conversation.+func ProbeAntigravity(ctx context.Context, inv Invocation) (AntigravityProbe, error) {+ env := invocationEnvironment(inv)+ home := env["HOME"]+ if home == "" {+ return AntigravityProbe{}, errors.New("Antigravity probe requires HOME")+ }+ var result AntigravityProbe+ err := withACPProcess(ctx, inv, home, nil, func(conn *acpConn) error {+ if err := acpInitialize(ctx, conn); err != nil {+ return err+ }+ raw, err := acpOpenSession(ctx, conn, env, func() (json.RawMessage, error) {+ return conn.call(ctx, "session/new", map[string]any{"cwd": home, "mcpServers": []any{}})+ })+ if acpNeedsAuth(err) {+ result.AuthenticationRequired = true+ return nil+ }+ if err != nil {+ return err+ }+ var session acpSession+ if json.Unmarshal(raw, &session) != nil || session.SessionID == "" {+ return errors.New("Antigravity session/new returned no session")+ }+ result.Models = antigravityCatalog(session)+ return nil+ })+ return result, err+}++// DiscoverAntigravityModels lists the models of the signed-in account.+func DiscoverAntigravityModels(ctx context.Context, inv Invocation) (ModelList, error) {+ probe, err := ProbeAntigravity(ctx, inv)+ if err != nil {+ return ModelList{}, err+ }+ if probe.AuthenticationRequired {+ return ModelList{}, errors.New("Antigravity sign-in is required to list models")+ }+ return probe.Models, nil+}++// antigravityCatalog turns a session's model selector into the catalog.+// Antigravity selects a model family and a thinking level separately, and+// names each family-and-level pair "<family>-<level>" in availableModels;+// the levels a family offers are the suffixes of its pairs.+func antigravityCatalog(session acpSession) ModelList {+ var families *acpConfigOption+ for i := range session.ConfigOptions {+ if session.ConfigOptions[i].Category == "model" {+ families = &session.ConfigOptions[i]+ break+ }+ }+ var catalog catalogModels+ if families == nil {+ return catalog.list()+ }+ var pairs []string+ current := ""+ if session.Models != nil {+ for _, model := range session.Models.AvailableModels {+ pairs = append(pairs, model.ModelID)+ }+ current = session.Models.CurrentModelID+ }+ for _, family := range families.Options {+ var efforts effortCatalog+ for _, level := range antigravityLevels {+ if slices.Contains(pairs, family.Value+"-"+level) {+ efforts.add(level, "")+ }+ }+ defaultEffort := ""+ if family.Value == families.CurrentValue {+ defaultEffort, _ = strings.CutPrefix(current, family.Value+"-")+ }+ catalog.add(ModelOption{+ ID: family.Value, Label: family.Name, Provider: "antigravity",+ Default: family.Value == families.CurrentValue, Effort: efforts.support(defaultEffort),+ })+ }+ return catalog.list()+}++// antigravityLevels are the product reasoning efforts Antigravity also+// names, in ascending order.+var antigravityLevels = []string{"low", "medium", "high", "xhigh", "max"}++// withACPProcess runs exchange against a fresh `agy acp` in dir, then+// reaps the process tree. ctx bounds the exchange only.+func withACPProcess(ctx context.Context, inv Invocation, dir string, handle func(acpFrame), exchange func(*acpConn) error) error {+ proc, err := startACP(inv, dir, nil, handle)+ if err != nil {+ return err+ }+ exchangeErr := exchange(proc.conn)+ if !proc.stop() && exchangeErr == nil {+ exchangeErr = errors.New("Antigravity probe process did not exit")+ }+ return exchangeErr+}++// invocationEnvironment reads back the environment an Invocation carries.+func invocationEnvironment(inv Invocation) map[string]string {+ env := map[string]string{}+ entries := inv.Env+ if entries == nil {+ entries = os.Environ()+ }+ for _, entry := range entries {+ if key, value, ok := strings.Cut(entry, "="); ok {+ env[key] = value+ }+ }+ return env+}diff --git a/apps/computer/local-daemon/internal/provider/native/antigravity_fake_test.go b/apps/computer/local-daemon/internal/provider/native/antigravity_fake_test.gonew file mode 100644index 00000000..980dba61--- /dev/null+++ b/apps/computer/local-daemon/internal/provider/native/antigravity_fake_test.go@@ -0,0 +1,183 @@+package native++import (+ "bufio"+ "encoding/json"+ "fmt"+ "os"+ "sync"+)++// The test binary doubles as a fake `agy acp` when agyFakeEnv names a mode.+// Every request it reads is appended to agyFakeRecordEnv as one JSON line.+const (+ agyFakeEnv = "NATIVE_AGY_FAKE"+ agyFakeRecordEnv = "AGY_FAKE_RECORD"+ // agyFakeCommandEnv names the command a permission request asks for.+ agyFakeCommandEnv = "AGY_FAKE_COMMAND"+)++func init() {+ if mode := os.Getenv(agyFakeEnv); mode != "" {+ os.Exit(agyFake(mode, os.Args[1:]))+ }+}++type agyFakeProcess struct {+ mode string+ out sync.Mutex+ record *os.File+ authed bool+ // answers carries the client's responses to the fake's own requests.+ answers chan map[string]any+}++func (f *agyFakeProcess) send(value any) {+ encoded, _ := json.Marshal(value)+ f.out.Lock()+ defer f.out.Unlock()+ _, _ = os.Stdout.Write(append(encoded, '\n'))+}++func (f *agyFakeProcess) result(id json.RawMessage, result any) {+ f.send(map[string]any{"jsonrpc": "2.0", "id": id, "result": result})+}++func (f *agyFakeProcess) fail(id json.RawMessage, code int, message string) {+ f.send(map[string]any{"jsonrpc": "2.0", "id": id, "error": map[string]any{"code": code, "message": message}})+}++func (f *agyFakeProcess) update(sessionID string, update map[string]any) {+ f.send(map[string]any{"jsonrpc": "2.0", "method": "session/update", "params": map[string]any{"sessionId": sessionID, "update": update}})+}++func agyFakeSession(id string) map[string]any {+ return map[string]any{+ "sessionId": id,+ "models": map[string]any{+ "availableModels": []any{+ map[string]any{"modelId": "gemini-pro-high", "name": "Gemini Pro (High)"},+ map[string]any{"modelId": "gemini-pro-low", "name": "Gemini Pro (Low)"},+ map[string]any{"modelId": "gemini-flash-medium", "name": "Gemini Flash (Medium)"},+ },+ "currentModelId": "gemini-pro-low",+ },+ "configOptions": []any{+ map[string]any{"id": "model", "category": "model", "currentValue": "gemini-pro", "options": []any{+ map[string]any{"value": "gemini-pro", "name": "Gemini Pro"},+ map[string]any{"value": "gemini-flash", "name": "Gemini Flash"},+ }},+ map[string]any{"id": "thought_level", "category": "thought_level", "currentValue": "low", "options": []any{}},+ },+ }+}++func agyFake(mode string, args []string) int {+ if len(args) != 1 || args[0] != "acp" {+ fmt.Fprintln(os.Stderr, "unexpected argv")+ return 2+ }+ f := &agyFakeProcess{mode: mode, answers: make(chan map[string]any, 1)}+ if path := os.Getenv(agyFakeRecordEnv); path != "" {+ f.record, _ = os.OpenFile(path, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o600)+ }+ scanner := bufio.NewScanner(os.Stdin)+ scanner.Buffer(make([]byte, 1<<20), 1<<20)+ for scanner.Scan() {+ line := scanner.Bytes()+ if f.record != nil {+ _, _ = f.record.Write(append(append([]byte{}, line...), '\n'))+ }+ var frame struct {+ ID json.RawMessage `json:"id"`+ Method string `json:"method"`+ Params map[string]any `json:"params"`+ Result map[string]any `json:"result"`+ }+ if json.Unmarshal(line, &frame) != nil {+ return 3+ }+ if frame.Method == "" {+ f.answers <- frame.Result+ continue+ }+ f.handle(frame.ID, frame.Method, frame.Params)+ }+ return 0+}++func (f *agyFakeProcess) handle(id json.RawMessage, method string, params map[string]any) {+ switch method {+ case "initialize":+ f.result(id, map[string]any{"protocolVersion": 1, "agentInfo": map[string]any{"name": "fake"}})+ case "authenticate":+ f.authed = params["methodId"] == "gemini-api-key"+ f.result(id, map[string]any{})+ case "session/new", "session/load":+ if f.mode == "signed-out" && !f.authed {+ f.fail(id, acpAuthRequired, "Authentication required")+ return+ }+ sessionID := "fake-session"+ if method == "session/load" {+ sessionID, _ = params["sessionId"].(string)+ if f.mode == "load-error" {+ f.fail(id, -32603, "session could not be loaded")+ return+ }+ // Loading replays the stored conversation before answering; an+ // id Antigravity never stored loads with nothing to replay.+ if f.mode != "unknown-session" {+ f.update(sessionID, map[string]any{"sessionUpdate": "user_message_chunk", "content": map[string]any{"type": "text", "text": "earlier prompt"}})+ f.update(sessionID, map[string]any{"sessionUpdate": "agent_message_chunk", "content": map[string]any{"type": "text", "text": "earlier reply"}})+ }+ }+ f.result(id, agyFakeSession(sessionID))+ case "session/set_config_option":+ if params["value"] == "unknown-model" {+ f.fail(id, -32602, "Unknown model ID: unknown-model")+ return+ }+ f.result(id, map[string]any{"configOptions": []any{}})+ case "session/prompt":+ go f.prompt(id, params["sessionId"].(string))+ case "session/cancel":+ default:+ f.fail(id, -32601, "method not found")+ }+}++func (f *agyFakeProcess) prompt(id json.RawMessage, sessionID string) {+ f.update(sessionID, map[string]any{"sessionUpdate": "agent_thought_chunk", "content": map[string]any{"type": "text", "text": "**Looking** around"}})+ f.update(sessionID, map[string]any{"sessionUpdate": "agent_message_chunk", "content": map[string]any{"type": "text", "text": "Let me check."}})+ f.update(sessionID, map[string]any{"sessionUpdate": "plan", "entries": []any{+ map[string]any{"content": "List files", "status": "in_progress", "priority": "high"},+ map[string]any{"content": "Report", "status": "pending", "priority": "low"},+ }})+ f.update(sessionID, map[string]any{"sessionUpdate": "tool_call", "toolCallId": "call-1", "title": "ls", "kind": "execute", "status": "pending", "rawInput": map[string]any{"command": "ls"}})+ if f.mode == "permission" || f.mode == "permission-no-reject" {+ command := os.Getenv(agyFakeCommandEnv)+ if command == "" {+ command = "ls"+ }+ options := []any{map[string]any{"optionId": "allow", "name": "Allow", "kind": "allow_once"}}+ if f.mode == "permission" {+ options = append([]any{map[string]any{"optionId": "deny", "name": "Deny", "kind": "reject_once"}}, options...)+ }+ f.send(map[string]any{"jsonrpc": "2.0", "id": 900, "method": "session/request_permission", "params": map[string]any{+ "sessionId": sessionID,+ "toolCall": map[string]any{"toolCallId": "call-1", "title": command, "kind": "execute", "rawInput": map[string]any{"command": command}},+ "options": options,+ }})+ <-f.answers+ }+ if f.mode == "hang" {+ select {}+ }+ f.update(sessionID, map[string]any{"sessionUpdate": "tool_call_update", "toolCallId": "call-1", "status": "completed", "content": []any{+ map[string]any{"type": "content", "content": map[string]any{"type": "text", "text": "a.txt"}},+ }})+ f.update(sessionID, map[string]any{"sessionUpdate": "agent_message_chunk", "content": map[string]any{"type": "text", "text": "Found "}})+ f.update(sessionID, map[string]any{"sessionUpdate": "agent_message_chunk", "content": map[string]any{"type": "text", "text": "a.txt"}})+ f.result(id, map[string]any{"stopReason": "end_turn", "usage": map[string]any{"inputTokens": 10, "outputTokens": 4, "thoughtTokens": 2, "cachedReadTokens": 3}})+}diff --git a/apps/computer/local-daemon/internal/provider/native/antigravity_process.go b/apps/computer/local-daemon/internal/provider/native/antigravity_process.gonew file mode 100644index 00000000..ae164fc2--- /dev/null+++ b/apps/computer/local-daemon/internal/provider/native/antigravity_process.go@@ -0,0 +1,110 @@+package native++import (+ "context"+ "fmt"+ "log/slog"+ "os"+ "os/exec"+ "syscall"+ "time"++ "github.com/simplexai-labs/linger/apps/computer/local-daemon/internal/process"+)++const (+ antigravityExitWait = 3 * time.Second+ antigravityTermWait = time.Second+ antigravityGroupWait = 3 * time.Second+ antigravityPipeDrain = time.Second+)++// acpProcess is one `agy acp` child and its ACP connection. Stderr is+// discarded: a signed-out Antigravity prints its OAuth URL there.+type acpProcess struct {+ cmd *exec.Cmd+ stdin *os.File+ stdout *os.File+ conn *acpConn+ exited chan struct{}+ waitErr error+ // cancel ends the process context, which outlives every caller.+ cancel context.CancelFunc+}++// startACP launches `agy acp` in dir. handle receives the agent's+// notifications and requests.+func startACP(inv Invocation, dir string, logger *slog.Logger, handle func(acpFrame)) (*acpProcess, error) {+ stdinRead, stdinWrite, err := os.Pipe()+ if err != nil {+ return nil, err+ }+ stdoutRead, stdoutWrite, err := os.Pipe()+ if err != nil {+ _ = stdinRead.Close()+ _ = stdinWrite.Close()+ return nil, err+ }+ procCtx, cancel := context.WithCancel(context.Background())+ cmd := ownedCommand(procCtx, inv, "acp")+ cmd.Dir = dir+ cmd.WaitDelay = antigravityPipeDrain+ cmd.Stdin, cmd.Stdout, cmd.Stderr = stdinRead, stdoutWrite, nil+ startErr := process.Start(cmd)+ _ = stdinRead.Close()+ _ = stdoutWrite.Close()+ if startErr != nil {+ cancel()+ _ = stdinWrite.Close()+ _ = stdoutRead.Close()+ return nil, fmt.Errorf("Antigravity could not be started: %w", ExplainExecError(startErr))+ }+ if logger != nil {+ logRuntimeLaunch(logger, "antigravity", "acp", cmd)+ }+ p := &acpProcess{cmd: cmd, stdin: stdinWrite, stdout: stdoutRead, exited: make(chan struct{}), cancel: cancel}+ p.conn = newACPConn(stdinWrite, handle)+ go func() {+ p.waitErr = cmd.Wait()+ close(p.exited)+ }()+ go p.conn.serve(stdoutRead)+ return p, nil+}++// stop closes stdin and escalates until the process tree is gone. It+// reports whether the exit of the whole tree was confirmed.+func (p *acpProcess) stop() bool {+ go func() { _ = p.stdin.Close() }()+ if !acpWait(p.exited, antigravityExitWait) {+ _ = process.Signal(p.cmd, syscall.SIGTERM)+ if !acpWait(p.exited, antigravityTermWait) {+ _ = process.Signal(p.cmd, syscall.SIGKILL)+ go func() { _ = p.stdout.Close() }()+ <-p.exited+ }+ }+ if !process.WaitEmpty(p.cmd, 100*time.Millisecond) {+ _ = process.Signal(p.cmd, syscall.SIGKILL)+ }+ confirmed := process.WaitEmpty(p.cmd, antigravityGroupWait)+ if !acpWait(p.conn.closed, antigravityPipeDrain) {+ go func() { _ = p.stdout.Close() }()+ }+ if confirmed {+ p.cancel()+ process.Release(p.cmd)+ }+ return confirmed+}++func acpWait(done <-chan struct{}, budget time.Duration) bool {+ timer := time.NewTimer(budget)+ defer timer.Stop()+ select {+ case <-done:+ return true+ case <-timer.C:+ return false+ }+}diff --git a/apps/computer/local-daemon/internal/provider/native/antigravity_runtime.go b/apps/computer/local-daemon/internal/provider/native/antigravity_runtime.gonew file mode 100644index 00000000..dd20723c--- /dev/null+++ b/apps/computer/local-daemon/internal/provider/native/antigravity_runtime.go@@ -0,0 +1,620 @@+package native++import (+ "context"+ "crypto/sha256"+ "encoding/hex"+ "encoding/json"+ "errors"+ "fmt"+ "os/exec"+ "path/filepath"+ "sort"+ "strings"+ "sync"+ "time"++ "github.com/simplexai-labs/linger/apps/computer/local-daemon/internal/permission"+)++const (+ // antigravityDefaultModel keeps the model the account already selects.+ antigravityDefaultModel = "antigravity-default"+ antigravityEventBuffer = 256+)++// antigravityRuntime runs each Operation in its own `agy acp` process. The+// conversation lives in Antigravity's own store and is reopened by id with+// session/load, so no process is parked between turns.+type antigravityRuntime struct{ profile Profile }++func newAntigravityRuntime(profile Profile) Runtime { return &antigravityRuntime{profile: profile} }++func (r *antigravityRuntime) Start(ctx context.Context, prompt string, spec RunSpec) (*Run, error) {+ if spec.PrepareOnly {+ return nil, errors.New("Antigravity has no provider prepare")+ }+ if spec.AssignSessionID != "" {+ return nil, errors.New("Antigravity names its own sessions")+ }+ if strings.TrimSpace(prompt) == "" {+ return nil, errors.New("Antigravity requires a non-empty prompt")+ }+ if len(spec.ComputerArgs) > 0 || len(spec.AgentArgs) > 0 {+ return nil, errors.New("Antigravity accepts no custom launch arguments")+ }+ if spec.Dir == "" || !filepath.IsAbs(spec.Dir) {+ return nil, errors.New("Antigravity requires an absolute working directory")+ }+ servers, err := acpMCPServers(mcpNamespace(spec.MCPServers))+ if err != nil {+ return nil, err+ }+ program := r.profile.Program+ if program == "" {+ program = "agy"+ }+ if !filepath.IsAbs(program) {+ if program, err = exec.LookPath(program); err != nil {+ return nil, err+ }+ }+ var releaseTemp func() error+ if r.profile.RetainProcessTemp != nil {+ if releaseTemp, err = r.profile.RetainProcessTemp(); err != nil {+ return nil, fmt.Errorf("Antigravity process temp directory could not be retained: %w", err)+ }+ }+ runCtx, cancel := budgetContext(ctx, spec.Budget)+ turn := &antigravityTurn{+ profile: r.profile, spec: spec, runCtx: runCtx, cancel: cancel,+ events: make(chan Event, antigravityEventBuffer), outcome: make(chan Outcome, 1),+ tools: map[string]bool{}, requests: newModelRequestClock(GranularityDelta),+ }+ proc, err := startACP(profileInvocation(program, nil, r.profile.Env), spec.Dir, r.profile.Logger, turn.handle)+ if err != nil {+ cancel()+ if releaseTemp != nil {+ _ = releaseTemp()+ }+ return nil, err+ }+ turn.proc = proc+ spec.Readiness.spawned()+ spec.Readiness.session(spec.ResumeID != "")+ go turn.drive(prompt, servers, releaseTemp)+ return &Run{Events: turn.events, Outcome: turn.outcome}, nil+}++// antigravityTurn is the one prompt of an Operation.+type antigravityTurn struct {+ profile Profile+ spec RunSpec+ proc *acpProcess+ runCtx context.Context+ cancel context.CancelFunc++ events chan Event+ outcome chan Outcome+ emitMu sync.RWMutex+ eventsClosed bool+ requests *modelRequestClock++ mu sync.Mutex+ // prompting is set once session/prompt is sent; updates before it are+ // the history session/load replays and belong to earlier turns.+ prompting bool+ // replayedPrompts counts the user prompts session/load replayed.+ replayedPrompts int+ sessionID string+ textID string+ output strings.Builder+ tools map[string]bool+}++func (t *antigravityTurn) emit(event Event) {+ t.emitMu.RLock()+ defer t.emitMu.RUnlock()+ if t.eventsClosed || t.runCtx.Err() != nil {+ return+ }+ select {+ case t.events <- event:+ case <-t.runCtx.Done():+ }+}++func (t *antigravityTurn) drive(prompt string, servers []any, releaseTemp func() error) {+ outcome := t.exchange(prompt, servers)+ if status := interruptedStatus(t.runCtx); status != "" && outcome.Status != statusCompleted {+ outcome.Status, outcome.FailureCode = status, ""+ if outcome.Error == "" {+ outcome.Error = "Antigravity turn was " + status+ }+ }+ if t.proc.stop() {+ outcome.ExitConfirmed = true+ if releaseTemp != nil {+ _ = releaseTemp()+ }+ } else {+ outcome.ExitUnconfirmed = true+ }+ if outcome.Status == statusFailed && outcome.Diagnostics.empty() && t.proc.cmd.ProcessState != nil {+ outcome.Diagnostics = processExitDiagnostics(t.proc.cmd.ProcessState)+ }+ t.mu.Lock()+ outcome.SessionID = t.sessionID+ t.mu.Unlock()+ t.cancel()+ t.emitMu.Lock()+ t.eventsClosed = true+ close(t.events)+ t.emitMu.Unlock()+ t.outcome <- outcome+ close(t.outcome)+}++// exchange opens the session, applies the model selection, and runs the+// prompt to its stop reason.+func (t *antigravityTurn) exchange(prompt string, servers []any) Outcome {+ started := time.Now()+ conn, spec := t.proc.conn, t.spec+ failed := func(code, message string) Outcome {+ return Outcome{Status: statusFailed, FailureCode: code, Error: message, ElapsedMs: time.Since(started).Milliseconds()}+ }+ if err := acpInitialize(t.runCtx, conn); err != nil {+ return failed("protocol_incompatible", "Antigravity ACP handshake failed: "+err.Error())+ }+ params := map[string]any{"cwd": spec.Dir, "mcpServers": servers}+ if spec.AppendPrompt != "" {+ params["_meta"] = map[string]any{"antigravity": map[string]any{"systemPrompt": map[string]any{"append": spec.AppendPrompt}}}+ }+ // Antigravity names a new session itself. session/load reopens a stored+ // one and replays it as updates, which the turn drops until its own+ // prompt is sent.+ method := "session/new"+ if spec.ResumeID != "" {+ method, params["sessionId"] = "session/load", spec.ResumeID+ }+ raw, err := acpOpenSession(t.runCtx, conn, t.profile.Env, func() (json.RawMessage, error) {+ return conn.call(t.runCtx, method, params)+ })+ if acpNeedsAuth(err) {+ return failed("authentication_required", "Antigravity sign-in is required")+ }+ var refused *acpError+ if spec.ResumeID != "" && errors.As(err, &refused) {+ return t.resumeRefused(failed("session_not_found", "Antigravity could not load session "+spec.ResumeID+": "+err.Error()))+ }+ if err != nil {+ return failed("", "Antigravity "+method+" failed: "+err.Error())+ }+ t.mu.Lock()+ replayed := t.replayedPrompts+ t.mu.Unlock()+ // session/load accepts an id Antigravity never stored and only the+ // prompt fails. A stored session holds at least the prompt of the turn+ // that made it, so a load that replays no prompt found no session.+ if spec.ResumeID != "" && replayed == 0 {+ return t.resumeRefused(failed("session_not_found", "Antigravity has no stored session "+spec.ResumeID))+ }+ var session acpSession+ if json.Unmarshal(raw, &session) != nil || session.SessionID == "" {+ if spec.ResumeID == "" {+ return failed("", "Antigravity "+method+" returned no session")+ }+ session.SessionID = spec.ResumeID+ }+ t.mu.Lock()+ t.sessionID = session.SessionID+ t.mu.Unlock()+ if spec.Model != "" && spec.Model != antigravityDefaultModel {+ if err := t.configure(session.SessionID, "model", spec.Model); err != nil {+ return failed(acpOptionFailure(err), "Antigravity model "+spec.Model+" could not be selected: "+err.Error())+ }+ }+ if spec.Effort != "" {+ if err := t.configure(session.SessionID, "thought_level", spec.Effort); err != nil {+ return failed(acpOptionFailure(err), "Antigravity thinking level "+spec.Effort+" could not be selected: "+err.Error())+ }+ }+ t.mu.Lock()+ t.prompting = true+ t.mu.Unlock()+ dispatched := time.Now()+ t.requests.begin("", dispatched)+ if spec.ExposeTurnStarted {+ // The turn-started status carries the session, which is the+ // checkpoint a first Run reports for its new session.+ reused := false+ t.emit(Event{Kind: EventStatus, Status: "running", TurnID: "antigravity-turn-" + piRandomHex(12), SessionID: session.SessionID, ProcessReused: &reused, SentAt: dispatched})+ }+ raw, err = conn.call(t.runCtx, "session/prompt", map[string]any{+ "sessionId": session.SessionID,+ "prompt": []any{map[string]any{"type": "text", "text": prompt}},+ })+ if err != nil && t.runCtx.Err() != nil {+ raw, err = t.cancelPrompt(session.SessionID)+ }+ if err != nil {+ if errors.Is(err, errACPClosed) {+ return failed("", "Antigravity exited before the turn finished")+ }+ return failed("", "Antigravity session/prompt failed: "+err.Error())+ }+ var result struct {+ StopReason string `json:"stopReason"`+ Usage *antigravityTokens `json:"usage"`+ }+ _ = json.Unmarshal(raw, &result)+ outcome := Outcome{ElapsedMs: time.Since(started).Milliseconds()}+ t.mu.Lock()+ outcome.Output = strings.TrimSpace(t.output.String())+ t.mu.Unlock()+ if result.Usage != nil {+ model := spec.Model+ if model == "" {+ model = antigravityDefaultModel+ }+ count := result.Usage.count()+ outcome.Usage = map[string]TokenCount{model: count}+ outcome.LastUsage = map[string]TokenCount{model: count}+ response := t.requests.respond(ModelResponse{Model: model, Usage: count}, time.Now())+ t.emit(Event{Kind: EventModelResponse, ObservedAt: time.Now(), Response: &response})+ }+ switch result.StopReason {+ case "end_turn":+ outcome.Status = statusCompleted+ case "cancelled":+ outcome.Status, outcome.Error = statusAborted, "Antigravity turn was cancelled"+ default:+ outcome.Status, outcome.Error = statusFailed, "Antigravity stopped the turn: "+result.StopReason+ }+ return outcome+}++// cancelPrompt asks Antigravity to end the running prompt. The process is+// stopped right after, so the cancelled stop reason is not awaited.+func (t *antigravityTurn) cancelPrompt(sessionID string) (json.RawMessage, error) {+ _ = t.proc.conn.notify("session/cancel", map[string]any{"sessionId": sessionID})+ return nil, t.runCtx.Err()+}++func (t *antigravityTurn) configure(sessionID, option, value string) error {+ _, err := t.proc.conn.call(t.runCtx, "session/set_config_option", map[string]any{"sessionId": sessionID, "configId": option, "value": value})+ return err+}++// acpOptionFailure classifies a refused model or level: Antigravity answers+// an unknown value with invalid params.+func acpOptionFailure(err error) string {+ var rpc *acpError+ if errors.As(err, &rpc) && rpc.Code == -32602 {+ return "model_not_offered"+ }+ return ""+}++type antigravityTokens struct {+ InputTokens int64 `json:"inputTokens"`+ OutputTokens int64 `json:"outputTokens"`+ ThoughtTokens int64 `json:"thoughtTokens"`+ CachedReadTokens int64 `json:"cachedReadTokens"`+ CachedWriteTokens int64 `json:"cachedWriteTokens"`+}++// count maps ACP usage onto TokenCount, where Input excludes cache reads and+// writes and Reasoning is part of Output.+func (u antigravityTokens) count() TokenCount {+ return TokenCount{+ Input: max(u.InputTokens-u.CachedReadTokens-u.CachedWriteTokens, 0),+ Output: u.OutputTokens + u.ThoughtTokens,+ CacheRead: u.CachedReadTokens,+ CacheWrite: u.CachedWriteTokens,+ Reasoning: u.ThoughtTokens,+ }+}++// handle runs on the ACP reader for every notification and agent request.+func (t *antigravityTurn) handle(frame acpFrame) {+ switch frame.Method {+ case "session/update":+ t.update(frame.Params, time.Now())+ case "session/request_permission":+ go t.permission(frame)+ default:+ if len(frame.ID) > 0 {+ _ = t.proc.conn.respondError(frame.ID, -32601, "method not supported by Linger")+ }+ }+}++type acpUpdate struct {+ SessionUpdate string `json:"sessionUpdate"`+ Content json.RawMessage `json:"content"`+ MessageID string `json:"messageId"`+ ToolCallID string `json:"toolCallId"`+ Title string `json:"title"`+ Kind string `json:"kind"`+ Status string `json:"status"`+ RawInput json.RawMessage `json:"rawInput"`+ RawOutput json.RawMessage `json:"rawOutput"`+ Entries []struct {+ Content string `json:"content"`+ Status string `json:"status"`+ } `json:"entries"`+}++// resumeRefused marks an outcome whose retained session Antigravity does+// not hold; nothing was emitted, so the executor may start a fresh session.+func (t *antigravityTurn) resumeRefused(outcome Outcome) Outcome {+ outcome.ResumeRefused = true+ return outcome+}++func (t *antigravityTurn) update(params json.RawMessage, observed time.Time) {+ var envelope struct {+ Update acpUpdate `json:"update"`+ }+ if json.Unmarshal(params, &envelope) != nil {+ return+ }+ update := envelope.Update+ t.mu.Lock()+ prompting := t.prompting+ if !prompting && update.SessionUpdate == "user_message_chunk" {+ t.replayedPrompts+++ }+ t.mu.Unlock()+ if !prompting {+ return+ }+ switch update.SessionUpdate {+ case "agent_message_chunk":+ text := acpContentText(update.Content)+ if text == "" {+ return+ }+ t.requests.item("", observed)+ t.mu.Lock()+ if t.textID == "" {+ t.textID = "antigravity-text-" + piRandomHex(12)+ }+ id := t.textID+ t.output.WriteString(text)+ t.mu.Unlock()+ t.emit(Event{Kind: EventText, ObservedAt: observed, ID: id, ModelMessageID: update.MessageID, Body: text})+ case "agent_thought_chunk":+ if text := acpContentText(update.Content); text != "" {+ t.requests.item("", observed)+ t.emit(Event{Kind: EventReasoning, ObservedAt: observed, ModelMessageID: update.MessageID, Body: text})+ }+ case "tool_call":+ // Text after a tool call is a new message; the reply is the last one.+ t.mu.Lock()+ t.textID = ""+ t.output.Reset()+ t.tools[update.ToolCallID] = true+ t.mu.Unlock()+ var input map[string]any+ if json.Unmarshal(update.RawInput, &input) != nil {+ input = nil+ }+ t.emit(Event{+ Kind: EventToolCall, ObservedAt: observed, ToolName: antigravityToolName(update), InvocationID: antigravityInvocationID(update.ToolCallID),+ Input: input, ActivityKind: antigravityActivity(update.Kind), ActivityTitle: update.Title,+ })+ t.toolResult(update, observed)+ case "tool_call_update":+ t.toolResult(update, observed)+ case "plan":+ steps := make([]any, 0, len(update.Entries))+ for _, entry := range update.Entries {+ if entry.Content == "" {+ continue+ }+ status := entry.Status+ if status != "in_progress" && status != "completed" {+ status = "pending"+ }+ steps = append(steps, map[string]any{"content": entry.Content, "status": status})+ }+ t.emit(Event{Kind: EventPlan, Input: map[string]any{"steps": steps}})+ }+}++// toolResult emits a tool call's result once, when it reaches a terminal+// status.+func (t *antigravityTurn) toolResult(update acpUpdate, observed time.Time) {+ if update.Status != "completed" && update.Status != "failed" {+ return+ }+ t.mu.Lock()+ open := t.tools[update.ToolCallID]+ delete(t.tools, update.ToolCallID)+ t.mu.Unlock()+ if !open {+ return+ }+ t.requests.ready("", observed)+ output := acpToolOutput(update.Content)+ if output == "" && len(update.RawOutput) > 0 && string(update.RawOutput) != "null" {+ output = piText(update.RawOutput)+ }+ t.emit(Event{Kind: EventToolOutput, ObservedAt: observed, Status: update.Status, InvocationID: antigravityInvocationID(update.ToolCallID), Output: output})+}++// permission answers session/request_permission: through the Run's+// permission review when it has one, otherwise with the allow option, as+// the Runtime runs with the Agent's full local authority.+func (t *antigravityTurn) permission(frame acpFrame) {+ var request struct {+ ToolCall acpUpdate `json:"toolCall"`+ Options []struct {+ OptionID string `json:"optionId"`+ Kind string `json:"kind"`+ } `json:"options"`+ }+ if json.Unmarshal(frame.Params, &request) != nil {+ _ = t.proc.conn.respondError(frame.ID, -32602, "invalid permission request")+ return+ }+ allow := true+ if reviewer := t.spec.PermissionReviewer; reviewer != nil {+ allow = reviewer.Review(t.runCtx, antigravityReview(request.ToolCall, t.spec.Dir)).Decision == permission.Allow+ }+ wanted := []string{"reject_once", "reject_always"}+ if allow {+ wanted = []string{"allow_once", "allow_always"}+ }+ for _, kind := range wanted {+ for _, option := range request.Options {+ if option.Kind == kind {+ _ = t.proc.conn.respond(frame.ID, map[string]any{"outcome": map[string]any{"outcome": "selected", "optionId": option.OptionID}})+ return+ }+ }+ }+ _ = t.proc.conn.respond(frame.ID, map[string]any{"outcome": map[string]any{"outcome": "cancelled"}})+}++// antigravityReview builds the permission review of one tool call. A+// command is reviewed as a shell command so the shared shell rules apply.+func antigravityReview(call acpUpdate, workspace string) permission.Request {+ var input map[string]any+ _ = json.Unmarshal(call.RawInput, &input)+ encoded, _ := json.Marshal(input)+ tool := antigravityToolName(call)+ command := ""+ if call.Kind == "execute" {+ command, _ = input["command"].(string)+ tool = "Bash"+ }+ request := permission.Request{Action: permission.Action{+ Runtime: "antigravity", Surface: permission.Surface(tool, command), Tool: tool,+ Command: command, Input: string(encoded),+ }}+ if tool == "Bash" {+ request.Evidence = permission.ScriptEvidence(command, workspace)+ }+ return request+}++// antigravityToolName is the tool's own title, or its kind without one.+func antigravityToolName(update acpUpdate) string {+ if update.Title != "" {+ return update.Title+ }+ if update.Kind != "" {+ return update.Kind+ }+ return "tool"+}++// antigravityActivity maps an ACP tool kind to the Runtime-neutral class.+func antigravityActivity(kind string) string {+ switch kind {+ case "read":+ return ActivityRead+ case "edit", "delete", "move":+ return ActivityFileChange+ case "search":+ return ActivitySearch+ case "execute":+ return ActivityCommand+ case "fetch":+ return ActivityBrowse+ }+ return ActivityTool+}++func antigravityInvocationID(native string) string {+ sum := sha256.Sum256([]byte(native))+ return "antigravity-call-" + hex.EncodeToString(sum[:])+}++// acpContentText is the text of one ACP content block.+func acpContentText(raw json.RawMessage) string {+ var block struct {+ Type string `json:"type"`+ Text string `json:"text"`+ }+ if json.Unmarshal(raw, &block) != nil || block.Type != "text" {+ return ""+ }+ return block.Text+}++// acpToolOutput joins the text of a tool call's content list.+func acpToolOutput(raw json.RawMessage) string {+ var items []struct {+ Type string `json:"type"`+ Content json.RawMessage `json:"content"`+ }+ if json.Unmarshal(raw, &items) != nil {+ return ""+ }+ var text strings.Builder+ for _, item := range items {+ if item.Type == "content" {+ text.WriteString(acpContentText(item.Content))+ }+ }+ return text.String()+}++// acpMCPServers turns the Operation's {"mcpServers":{...}} document into+// ACP's server list: stdio servers with name/value environment pairs, and+// HTTP servers with name/value headers.+func acpMCPServers(config json.RawMessage) ([]any, error) {+ _, servers, ok := decodeMCPDocument(config)+ if !ok {+ return nil, errors.New("MCP configuration must be an object with an mcpServers object")+ }+ names := make([]string, 0, len(servers))+ for name := range servers {+ names = append(names, name)+ }+ sort.Strings(names)+ out := make([]any, 0, len(names))+ for _, name := range names {+ server, ok := servers[name].(map[string]any)+ if name == "" || !ok {+ return nil, errors.New("MCP server requires a name and object configuration")+ }+ kind, _ := server["type"].(string)+ url, _ := server["url"].(string)+ command, _ := server["command"].(string)+ switch {+ case command != "":+ args := []any{}+ if list, ok := server["args"].([]any); ok {+ args = list+ }+ out = append(out, map[string]any{"name": name, "command": command, "args": args, "env": acpPairs(server["env"])})+ case url != "":+ if kind == "" || strings.EqualFold(kind, "streamable-http") {+ kind = "http"+ }+ out = append(out, map[string]any{"type": strings.ToLower(kind), "name": name, "url": url, "headers": acpPairs(server["headers"])})+ default:+ return nil, fmt.Errorf("MCP server %s has neither a command nor a URL", name)+ }+ }+ return out, nil+}++func acpPairs(value any) []any {+ object, _ := value.(map[string]any)+ keys := make([]string, 0, len(object))+ for key := range object {+ keys = append(keys, key)+ }+ sort.Strings(keys)+ pairs := make([]any, 0, len(keys))+ for _, key := range keys {+ pairs = append(pairs, map[string]any{"name": key, "value": fmt.Sprint(object[key])})+ }+ return pairs+}diff --git a/apps/computer/local-daemon/internal/provider/native/antigravity_runtime_test.go b/apps/computer/local-daemon/internal/provider/native/antigravity_runtime_test.gonew file mode 100644index 00000000..ac3885b3--- /dev/null+++ b/apps/computer/local-daemon/internal/provider/native/antigravity_runtime_test.go@@ -0,0 +1,359 @@+package native++import (+ "bufio"+ "encoding/json"+ "os"+ "path/filepath"+ "reflect"+ "testing"+ "time"++ "github.com/simplexai-labs/linger/apps/computer/local-daemon/internal/permission"+)++type agyHarness struct {+ dir string+ record string+ runtime Runtime+ inv Invocation+}++func newAgyHarness(t *testing.T, mode string, extra map[string]string) agyHarness {+ t.Helper()+ program, err := os.Executable()+ if err != nil {+ t.Fatal(err)+ }+ dir := t.TempDir()+ record := filepath.Join(t.TempDir(), "requests.jsonl")+ env := map[string]string{agyFakeEnv: mode, agyFakeRecordEnv: record, "HOME": dir}+ for key, value := range extra {+ env[key] = value+ }+ return agyHarness{+ dir: dir, record: record,+ runtime: newAntigravityRuntime(Profile{Program: program, Env: env}),+ inv: NewInvocation(program, nil).WithEnvironment(env),+ }+}++// requests returns the recorded client requests by method, in order.+func (h agyHarness) requests(t *testing.T) map[string][]map[string]any {+ t.Helper()+ file, err := os.Open(h.record)+ if err != nil {+ t.Fatal(err)+ }+ defer file.Close()+ out := map[string][]map[string]any{}+ scanner := bufio.NewScanner(file)+ scanner.Buffer(make([]byte, 1<<20), 1<<20)+ for scanner.Scan() {+ var frame map[string]any+ if json.Unmarshal(scanner.Bytes(), &frame) != nil {+ t.Fatalf("recorded frame is not JSON: %s", scanner.Text())+ }+ method, _ := frame["method"].(string)+ out[method] = append(out[method], frame)+ }+ return out+}++func drainAgy(t *testing.T, run *Run) ([]Event, Outcome) {+ t.Helper()+ var events []Event+ timeout := time.After(30 * time.Second)+ for {+ select {+ case event, ok := <-run.Events:+ if !ok {+ outcome, ok := <-run.Outcome+ if !ok {+ t.Fatal("outcome closed without a value")+ }+ return events, outcome+ }+ events = append(events, event)+ case <-timeout:+ t.Fatal("Antigravity run did not finish")+ }+ }+}++func TestAntigravityRunsOneTurnOverACP(t *testing.T) {+ h := newAgyHarness(t, "turn", nil)+ run, err := h.runtime.Start(t.Context(), "list files", RunSpec{+ Dir: h.dir, Model: "gemini-flash", Effort: "medium", AppendPrompt: "Be brief.",+ MCPServers: json.RawMessage(`{"mcpServers":{"teamhub":{"type":"http","url":"http://127.0.0.1:9/mcp","headers":{"Authorization":"Bearer x"}},"local":{"command":"/bin/tool","args":["--stdio"],"env":{"A":"1"}}}}`),+ })+ if err != nil {+ t.Fatal(err)+ }+ events, outcome := drainAgy(t, run)+ if outcome.Status != statusCompleted || outcome.SessionID != "fake-session" || outcome.Output != "Found a.txt" || !outcome.ExitConfirmed {+ t.Fatalf("outcome=%+v", outcome)+ }+ if usage := outcome.Usage["gemini-flash"]; usage != (TokenCount{Input: 7, Output: 6, CacheRead: 3, Reasoning: 2}) {+ t.Fatalf("usage=%+v", outcome.Usage)+ }+ var kinds []EventKind+ var call, result Event+ for _, event := range events {+ kinds = append(kinds, event.Kind)+ switch event.Kind {+ case EventToolCall:+ call = event+ case EventToolOutput:+ result = event+ }+ }+ want := []EventKind{EventReasoning, EventText, EventPlan, EventToolCall, EventToolOutput, EventText, EventText, EventModelResponse}+ if !reflect.DeepEqual(kinds, want) {+ t.Fatalf("kinds=%v", kinds)+ }+ if call.ActivityKind != ActivityCommand || call.InvocationID != result.InvocationID || call.Input["command"] != "ls" || result.Output != "a.txt" || result.Status != "completed" {+ t.Fatalf("call=%+v result=%+v", call, result)+ }+ if events[1].ID == events[5].ID || events[5].ID != events[6].ID {+ t.Fatal("text after a tool call must start a new message")+ }++ requests := h.requests(t)+ open := requests["session/new"][0]["params"].(map[string]any)+ if open["cwd"] != h.dir {+ t.Fatalf("cwd=%v", open["cwd"])+ }+ if appended := open["_meta"].(map[string]any)["antigravity"].(map[string]any)["systemPrompt"].(map[string]any)["append"]; appended != "Be brief." {+ t.Fatalf("append=%v", appended)+ }+ servers, _ := json.Marshal(open["mcpServers"])+ if string(servers) != `[{"args":["--stdio"],"command":"/bin/tool","env":[{"name":"A","value":"1"}],"name":"local"},{"headers":[{"name":"Authorization","value":"Bearer x"}],"name":"teamhub","type":"http","url":"http://127.0.0.1:9/mcp"}]` {+ t.Fatalf("mcpServers=%s", servers)+ }+ var options []string+ for _, frame := range requests["session/set_config_option"] {+ params := frame["params"].(map[string]any)+ options = append(options, params["configId"].(string)+"="+params["value"].(string))+ }+ if !reflect.DeepEqual(options, []string{"model=gemini-flash", "thought_level=medium"}) {+ t.Fatalf("options=%v", options)+ }+ if len(requests["authenticate"]) != 0 {+ t.Fatal("a signed-in Antigravity must not be re-authenticated")+ }+}++func TestAntigravityResumesWithSessionLoadAndDropsTheReplay(t *testing.T) {+ h := newAgyHarness(t, "turn", nil)+ run, err := h.runtime.Start(t.Context(), "again", RunSpec{Dir: h.dir, ResumeID: "earlier-session"})+ if err != nil {+ t.Fatal(err)+ }+ events, outcome := drainAgy(t, run)+ if outcome.Status != statusCompleted || outcome.SessionID != "earlier-session" {+ t.Fatalf("outcome=%+v", outcome)+ }+ for _, event := range events {+ if event.Kind == EventText && event.Body == "earlier reply" {+ t.Fatal("the replayed history reached the turn's events")+ }+ }+ requests := h.requests(t)+ if len(requests["session/load"]) != 1 || len(requests["session/new"]) != 0 || len(requests["session/set_config_option"]) != 0 {+ t.Fatalf("requests=%v", requests)+ }+}++func TestAntigravityAnswersPermissionRequestsWithoutReview(t *testing.T) {+ h := newAgyHarness(t, "permission", nil)+ run, err := h.runtime.Start(t.Context(), "list files", RunSpec{Dir: h.dir})+ if err != nil {+ t.Fatal(err)+ }+ if _, outcome := drainAgy(t, run); outcome.Status != statusCompleted {+ t.Fatalf("outcome=%+v", outcome)+ }+ answers := h.requests(t)[""]+ if len(answers) != 1 {+ t.Fatalf("answers=%v", answers)+ }+ selected := answers[0]["result"].(map[string]any)["outcome"].(map[string]any)+ if selected["outcome"] != "selected" || selected["optionId"] != "allow" {+ t.Fatalf("selected=%v", selected)+ }+}++// agyDenyingRequester answers every permission review with a denial.+type agyDenyingRequester struct{ asked chan string }++func (r agyDenyingRequester) Request(id string, _ map[string]any, respond func(json.RawMessage) error) error {+ r.asked <- id+ return respond(json.RawMessage(`{"decision":"deny","message":"not now"}`))+}++func (agyDenyingRequester) Forget(string) {}++func TestAntigravityAnswersADeniedPermissionReview(t *testing.T) {+ for _, c := range []struct{ mode, outcome, option string }{+ {mode: "permission", outcome: "selected", option: "deny"},+ {mode: "permission-no-reject", outcome: "cancelled"},+ } {+ t.Run(c.mode, func(t *testing.T) {+ h := newAgyHarness(t, c.mode, map[string]string{agyFakeCommandEnv: "git push"})+ requester := agyDenyingRequester{asked: make(chan string, 1)}+ reviewer := &permission.Reviewer{Requester: requester, Timeout: time.Minute}+ run, err := h.runtime.Start(t.Context(), "push it", RunSpec{Dir: h.dir, PermissionReviewer: reviewer})+ if err != nil {+ t.Fatal(err)+ }+ if _, outcome := drainAgy(t, run); outcome.Status != statusCompleted {+ t.Fatalf("outcome=%+v", outcome)+ }+ if len(requester.asked) != 1 {+ t.Fatal("the command was not reviewed")+ }+ answers := h.requests(t)[""]+ if len(answers) != 1 {+ t.Fatalf("answers=%v", answers)+ }+ selected := answers[0]["result"].(map[string]any)["outcome"].(map[string]any)+ if selected["outcome"] != c.outcome || (c.option != "" && selected["optionId"] != c.option) {+ t.Fatalf("selected=%v", selected)+ }+ })+ }+}++func TestAntigravityReportsAnUnknownRetainedSessionAsNotFound(t *testing.T) {+ for _, mode := range []string{"unknown-session", "load-error"} {+ t.Run(mode, func(t *testing.T) {+ h := newAgyHarness(t, mode, nil)+ run, err := h.runtime.Start(t.Context(), "again", RunSpec{Dir: h.dir, ResumeID: "moved-session", ExposeTurnStarted: true})+ if err != nil {+ t.Fatal(err)+ }+ events, outcome := drainAgy(t, run)+ if outcome.Status != statusFailed || outcome.FailureCode != "session_not_found" || !outcome.ResumeRefused || outcome.SessionID != "" {+ t.Fatalf("outcome=%+v", outcome)+ }+ // Nothing reached the Room, so the executor may start afresh.+ if len(events) != 0 {+ t.Fatalf("events=%+v", events)+ }+ if requests := h.requests(t); len(requests["session/prompt"]) != 0 {+ t.Fatalf("requests=%v", requests)+ }+ })+ }+}++func TestAntigravityReportsStructuredFailures(t *testing.T) {+ signedOut := newAgyHarness(t, "signed-out", nil)+ run, err := signedOut.runtime.Start(t.Context(), "hi", RunSpec{Dir: signedOut.dir})+ if err != nil {+ t.Fatal(err)+ }+ if _, outcome := drainAgy(t, run); outcome.Status != statusFailed || outcome.FailureCode != "authentication_required" {+ t.Fatalf("signed out outcome=%+v", outcome)+ }++ unknown := newAgyHarness(t, "turn", nil)+ run, err = unknown.runtime.Start(t.Context(), "hi", RunSpec{Dir: unknown.dir, Model: "unknown-model"})+ if err != nil {+ t.Fatal(err)+ }+ if _, outcome := drainAgy(t, run); outcome.Status != statusFailed || outcome.FailureCode != "model_not_offered" {+ t.Fatalf("unknown model outcome=%+v", outcome)+ }+}++func TestAntigravityUsesAGeminiAPIKeyOnlyWhenSignedOut(t *testing.T) {+ h := newAgyHarness(t, "signed-out", map[string]string{"GEMINI_API_KEY": "fixture-key"})+ run, err := h.runtime.Start(t.Context(), "hi", RunSpec{Dir: h.dir})+ if err != nil {+ t.Fatal(err)+ }+ if _, outcome := drainAgy(t, run); outcome.Status != statusCompleted {+ t.Fatalf("outcome=%+v", outcome)+ }+ requests := h.requests(t)+ if len(requests["authenticate"]) != 1 || len(requests["session/new"]) != 2 {+ t.Fatalf("requests=%v", requests)+ }+}++func TestAntigravityTimeoutStopsTheProcess(t *testing.T) {+ h := newAgyHarness(t, "hang", nil)+ run, err := h.runtime.Start(t.Context(), "hi", RunSpec{Dir: h.dir, Budget: 500 * time.Millisecond})+ if err != nil {+ t.Fatal(err)+ }+ _, outcome := drainAgy(t, run)+ if outcome.Status != statusTimeout || !outcome.ExitConfirmed {+ t.Fatalf("outcome=%+v", outcome)+ }+ if len(h.requests(t)["session/cancel"]) != 1 {+ t.Fatal("a timed-out prompt must be cancelled")+ }+}++func TestAntigravityProbeListsModelFamiliesWithTheirLevels(t *testing.T) {+ h := newAgyHarness(t, "turn", nil)+ probe, err := ProbeAntigravity(t.Context(), h.inv)+ if err != nil {+ t.Fatal(err)+ }+ if probe.AuthenticationRequired || len(probe.Models.Models) != 2 {+ t.Fatalf("probe=%+v", probe)+ }+ pro, flash := probe.Models.Models[0], probe.Models.Models[1]+ if pro.ID != "gemini-pro" || pro.Label != "Gemini Pro" || !pro.Default || pro.Effort == nil || pro.Effort.Default != "low" || len(pro.Effort.Options) != 2 || pro.Effort.Options[0].Value != "low" {+ t.Fatalf("pro=%+v effort=%+v", pro, pro.Effort)+ }+ if flash.ID != "gemini-flash" || flash.Default || flash.Effort == nil || flash.Effort.Default != "" || flash.Effort.Options[0].Value != "medium" {+ t.Fatalf("flash=%+v effort=%+v", flash, flash.Effort)+ }+ if len(h.requests(t)["session/prompt"]) != 0 {+ t.Fatal("a probe must not send a prompt")+ }++ signedOut := newAgyHarness(t, "signed-out", nil)+ if probe, err := ProbeAntigravity(t.Context(), signedOut.inv); err != nil || !probe.AuthenticationRequired {+ t.Fatalf("signed out probe=%+v err=%v", probe, err)+ }+}++func TestAntigravityRefusesWhatItCannotRun(t *testing.T) {+ h := newAgyHarness(t, "turn", nil)+ for name, spec := range map[string]RunSpec{+ "prepare": {Dir: h.dir, PrepareOnly: true},+ "arguments": {Dir: h.dir, AgentArgs: []string{"--sandbox"}},+ "relative": {Dir: "relative"},+ } {+ if _, err := h.runtime.Start(t.Context(), "hi", spec); err == nil {+ t.Fatalf("%s: Start accepted the spec", name)+ }+ }+ if _, err := h.runtime.Start(t.Context(), " ", RunSpec{Dir: h.dir}); err == nil {+ t.Fatal("Start accepted an empty prompt")+ }+}++func TestAntigravityReportsTheSessionItStartsAsTheTurnCheckpoint(t *testing.T) {+ h := newAgyHarness(t, "turn", nil)+ run, err := h.runtime.Start(t.Context(), "first", RunSpec{Dir: h.dir, ExposeTurnStarted: true})+ if err != nil {+ t.Fatal(err)+ }+ events, outcome := drainAgy(t, run)+ if outcome.Status != statusCompleted || len(events) == 0 {+ t.Fatalf("outcome=%+v", outcome)+ }+ if started := events[0]; started.Kind != EventStatus || started.TurnID == "" || started.SessionID != "fake-session" {+ t.Fatalf("first event=%+v", started)+ }+ if _, err := h.runtime.Start(t.Context(), "first", RunSpec{Dir: h.dir, AssignSessionID: "assigned"}); err == nil {+ t.Fatal("Start accepted an assigned session id")+ }+}diff --git a/apps/computer/local-daemon/internal/provider/native/catalog.go b/apps/computer/local-daemon/internal/provider/native/catalog.goindex 7058819c..0c36fddf 100644--- a/apps/computer/local-daemon/internal/provider/native/catalog.go+++ b/apps/computer/local-daemon/internal/provider/native/catalog.go@@ -47,6 +47,8 @@ func DiscoverModels(ctx context.Context, kind string, inv Invocation) (ModelListreturn codexCatalog(ctx, inv)case "pi":return DiscoverPiModels(ctx, inv)+ case "antigravity":+ return DiscoverAntigravityModels(ctx, inv)}return ModelList{}, fmt.Errorf("model discovery is unsupported for Runtime %q", kind)}diff --git a/apps/computer/local-daemon/internal/provider/native/runtime.go b/apps/computer/local-daemon/internal/provider/native/runtime.goindex c2aba476..3e4e24e1 100644--- a/apps/computer/local-daemon/internal/provider/native/runtime.go+++ b/apps/computer/local-daemon/internal/provider/native/runtime.go@@ -1,5 +1,5 @@// Package native adapts locally installed coding CLIs (Codex, Claude Code,-// Pi) to the Computer Daemon's Operation model.+// Pi, Antigravity) to the Computer Daemon's Operation model.package nativeimport (@@ -13,7 +13,7 @@ import ()// Kinds lists the Runtime kinds this package can open.-var Kinds = []string{"claude", "codex", "pi"}+var Kinds = []string{"claude", "codex", "pi", "antigravity"}func Supports(kind string) bool {for _, known := range Kinds {@@ -36,6 +36,8 @@ func Open(kind string, profile Profile) (Runtime, error) {return newCodexRuntime(profile), nilcase "pi":return newPiRuntime(profile), nil+ case "antigravity":+ return newAntigravityRuntime(profile), nil}return nil, fmt.Errorf("native runtime %q is unsupported", kind)}diff --git a/apps/computer/local-daemon/internal/provider/native/version.go b/apps/computer/local-daemon/internal/provider/native/version.goindex ee6cc9e5..cc321719 100644--- a/apps/computer/local-daemon/internal/provider/native/version.go+++ b/apps/computer/local-daemon/internal/provider/native/version.go@@ -17,6 +17,9 @@ var MinimumVersions = map[string]string{"codex": "0.100.0","claude": "2.1.282","pi": "1.2.0",+ // The first release whose ACP server was verified to offer model and+ // thinking-level options and the system prompt append.+ "antigravity": "1.5.12",}const (diff --git a/apps/computer/local-daemon/internal/provider/protocol_probe.go b/apps/computer/local-daemon/internal/provider/protocol_probe.goindex 8b86e5d2..0b19954c 100644--- a/apps/computer/local-daemon/internal/provider/protocol_probe.go+++ b/apps/computer/local-daemon/internal/provider/protocol_probe.go@@ -76,6 +76,9 @@ func probeRuntimeProtocol(ctx context.Context, runtimeType, executable string, e// make the probe report a false protocol incompatibility.payload = `{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"linger-computer-doctor","title":"Linger Computer Doctor","version":"1.0.0"},"capabilities":null}}` + "\n"+ case "antigravity":+ args = []string{"acp"}+ payload = `{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{}}}` + "\n"case "claude":args = []string{"-p", "--output-format", "stream-json", "--input-format", "stream-json", "--verbose",@@ -125,6 +128,9 @@ func protocolProbeResponseMatches(runtimeType string, response map[string]any) bcase "codex":_, result := response["result"].(map[string]any)return response["id"] == float64(1) && result+ case "antigravity":+ result, ok := response["result"].(map[string]any)+ return ok && response["id"] == float64(1) && result["protocolVersion"] == float64(1)default:return falsediff --git a/apps/computer/local-daemon/internal/provider/runtime_monitor.go b/apps/computer/local-daemon/internal/provider/runtime_monitor.goindex f45d70db..e14c4b4a 100644--- a/apps/computer/local-daemon/internal/provider/runtime_monitor.go+++ b/apps/computer/local-daemon/internal/provider/runtime_monitor.go@@ -186,7 +186,7 @@ func refreshRuntimeAuthentication(ctx context.Context, current DiscoveryResult,// validate a replacement executable, never an auth-only probe.continue}- if (diagnostic.Type == "codex" || diagnostic.Type == "pi") && diagnostic.Status == "error" && diagnostic.ModelCatalogError != "" {+ if (diagnostic.Type == "codex" || diagnostic.Type == "pi" || diagnostic.Type == "antigravity") && diagnostic.Status == "error" && diagnostic.ModelCatalogError != "" {continue}if diagnostic.ExecutablePath == "" || (diagnostic.Status != "ready" && diagnostic.Status != "authentication_required" &&@@ -213,9 +213,9 @@ func refreshRuntimeAuthentication(ctx context.Context, current DiscoveryResult,} else {diagnostic.Error = &DiagnosticError{Code: outcome.Code, Message: outcome.Message}}- if diagnostic.Type == "pi" && diagnostic.Status == "ready" {+ if (diagnostic.Type == "pi" || diagnostic.Type == "antigravity") && diagnostic.Status == "ready" {catalogCtx, cancel := context.WithTimeout(ctx, boundedAuthTimeout(options.Timeout))- diagnostic.Models, diagnostic.ModelCatalogError = discoverRuntimeModels(catalogCtx, "pi", diagnostic.ExecutablePath, environment)+ diagnostic.Models, diagnostic.ModelCatalogError = discoverRuntimeModels(catalogCtx, diagnostic.Type, diagnostic.ExecutablePath, environment)cancel()if diagnostic.ModelCatalogError != "" {diagnostic.Status, diagnostic.authProbeFailed = "error", falsediff --git a/apps/node-services/src/agent/AGENTS.md b/apps/node-services/src/agent/AGENTS.mdindex 6e2a93f1..890f7359 100644--- a/apps/node-services/src/agent/AGENTS.md+++ b/apps/node-services/src/agent/AGENTS.md@@ -33,7 +33,9 @@ take precedence.- Keep model/provider behavior behind the existing runtime interfaces. The onlyexception is `src/runtime-model-call.ts`: a stateless prompt on the owner'sAgent Runtime (Codex, Claude or Pi, using its default model) through the- Daemon's one-shot `model.invoke`, for tool-less service work such as Agent+ Daemon's one-shot `model.invoke`. Antigravity has no `model.invoke`, so an+ Antigravity owner's call runs on Claude on the same Computer, or on Codex+ when only Codex is ready. It serves tool-less service work such as AgentMemory, also used by Memory, by the LLM Wiki, and exposedto TeamHub as `POST /v1/model-calls`.It is not a Runtime turn and never creates a Context, Local Run, ordiff --git a/apps/node-services/src/agent/agent-features/agent-memory/coordinator.ts b/apps/node-services/src/agent/agent-features/agent-memory/coordinator.tsindex 21074d3b..a3d123c6 100644--- a/apps/node-services/src/agent/agent-features/agent-memory/coordinator.ts+++ b/apps/node-services/src/agent/agent-features/agent-memory/coordinator.ts@@ -145,7 +145,7 @@ export class AgentMemoryCoordinator {*/canReadHistory?: (computerId: string,- runtimeType: "codex" | "claude" | "pi",+ runtimeType: "codex" | "claude" | "pi" | "antigravity",) => boolean;now?: () => number;},diff --git a/apps/node-services/src/agent/agent-features/agent-memory/services.ts b/apps/node-services/src/agent/agent-features/agent-memory/services.tsindex 8d908762..f01b4040 100644--- a/apps/node-services/src/agent/agent-features/agent-memory/services.ts+++ b/apps/node-services/src/agent/agent-features/agent-memory/services.ts@@ -31,7 +31,7 @@ export interface AgentMemoryServicesOptions {*/readonly canReadHistory?: (computerId: string,- runtimeType: "codex" | "claude" | "pi",+ runtimeType: "codex" | "claude" | "pi" | "antigravity",) => boolean;readonly now?: () => number;}diff --git a/apps/node-services/src/agent/executor/application.ts b/apps/node-services/src/agent/executor/application.tsindex 2cacc504..bc06d4a6 100644--- a/apps/node-services/src/agent/executor/application.ts+++ b/apps/node-services/src/agent/executor/application.ts@@ -216,11 +216,11 @@ export interface AgentManagerApplicationOptions {readonly isLocalComputerExecutionReady: (computerId: string) => boolean;readonly canReadDetachedHistory?: (computerId: string,- runtimeType: "codex" | "claude" | "pi",+ runtimeType: "codex" | "claude" | "pi" | "antigravity",) => boolean;readonly supportsSessionCompaction?: (computerId: string,- runtimeType: "codex" | "claude" | "pi",+ runtimeType: "codex" | "claude" | "pi" | "antigravity",) => boolean;readonly subscribeLocalComputerReady?: (listener: (computerId: string) => void,diff --git a/apps/node-services/src/agent/executor/provider.ts b/apps/node-services/src/agent/executor/provider.tsindex 34e2d51c..774901a6 100644--- a/apps/node-services/src/agent/executor/provider.ts+++ b/apps/node-services/src/agent/executor/provider.ts@@ -466,7 +466,7 @@ export interface RuntimeExecutionFailure {| "response_too_large"| "unclassified";/** Absent when the failure was observed without a selected Runtime. */- runtime_type?: "codex" | "claude" | "pi";+ runtime_type?: "codex" | "claude" | "pi" | "antigravity";runtime_version?: string;}diff --git a/apps/node-services/src/agent/executor/run-loop.ts b/apps/node-services/src/agent/executor/run-loop.tsindex b66d1d2e..61f668ac 100644--- a/apps/node-services/src/agent/executor/run-loop.ts+++ b/apps/node-services/src/agent/executor/run-loop.ts@@ -378,7 +378,8 @@ export class RunLoop {this.#runtimeType =options.runtimeName === "codex" ||options.runtimeName === "claude" ||- options.runtimeName === "pi"+ options.runtimeName === "pi" ||+ options.runtimeName === "antigravity"? options.runtimeName: undefined;this.#runtimeSession = options.runtimeSession;diff --git a/apps/node-services/src/agent/runner-gateway/local-computer-management.ts b/apps/node-services/src/agent/runner-gateway/local-computer-management.tsindex 757518cf..abe1df61 100644--- a/apps/node-services/src/agent/runner-gateway/local-computer-management.ts+++ b/apps/node-services/src/agent/runner-gateway/local-computer-management.ts@@ -12,12 +12,15 @@ import type {ModelSourceStatus,} from "@linger/wire-contracts/runner-gateway/types";-export type LocalRuntimeType = "claude" | "codex" | "pi";+export type LocalRuntimeType = "claude" | "codex" | "pi" | "antigravity";export const isSupportedLocalRuntimeType = (value: unknown,): value is LocalRuntimeType =>- value === "codex" || value === "claude" || value === "pi";+ value === "codex" ||+ value === "claude" ||+ value === "pi" ||+ value === "antigravity";// A Computer below this release is refused with `upgrade_required` and the// user reruns the installer.export const MINIMUM_COMPUTER_VERSION = "0.22.0";@@ -110,6 +113,13 @@ export const DEFAULT_LOCAL_RUNTIME_MODELS: LocalRuntimeModelCatalog = {codex: [{ id: "codex-default", label: "Codex default", allowedReasoningEffort: [] },],+ antigravity: [+ {+ id: "antigravity-default",+ label: "Antigravity default",+ allowedReasoningEffort: [],+ },+ ],};export interface LocalPlacementRequirement {@@ -483,7 +493,7 @@ export const runtimeModelCatalogForComputer = (LocalRuntimeType,readonly LocalRuntimeModelDefinition[]>;- for (const runtimeType of ["claude", "codex", "pi"] as const) {+ for (const runtimeType of ["claude", "codex", "pi", "antigravity"] as const) {const diagnostic = hello.runtime_diagnostics.find(({ type }) => type === runtimeType,);@@ -527,7 +537,7 @@ export const validateRuntimeModelCatalog = (LocalRuntimeType,readonly LocalRuntimeModelDefinition[]>;- for (const runtimeType of ["claude", "codex", "pi"] as const) {+ for (const runtimeType of ["claude", "codex", "pi", "antigravity"] as const) {const models = catalog[runtimeType];const ids = new Set<string>();if (!Array.isArray(models) || models.length > 100) {diff --git a/apps/node-services/src/agent/runner-gateway/remote-codex-provider.ts b/apps/node-services/src/agent/runner-gateway/remote-codex-provider.tsindex 5445d7f6..450ba35b 100644--- a/apps/node-services/src/agent/runner-gateway/remote-codex-provider.ts+++ b/apps/node-services/src/agent/runner-gateway/remote-codex-provider.ts@@ -368,13 +368,15 @@ export class RemoteRuntimeProvider implements AgentProvider {: options,);// Every Runtime defers its native session to the first run.start. Codex's- // "" threadId, and Claude's and Pi's UUID, are the first-run markers, so- // activation needs no Daemon round trip. A retry after a failed first+ // and Antigravity's "" threadId, and Claude's and Pi's UUID, are the+ // first-run markers, so activation needs no Daemon round trip. A retry after a failed first// run.start reuses the same pending or UUID identity. CLI installation is// awaited by run.start (#start), off the activation path.this.#sessionOptions = sessionOptions;+ // Antigravity, like Codex, names its own session, which the first+ // run.start reports as its checkpoint.const session: RuntimeSession =- this.#runtime.type === "codex"+ this.#runtime.type === "codex" || this.#runtime.type === "antigravity"? { threadId: "" }: {provider: this.#runtime.type,@@ -394,7 +396,8 @@ export class RemoteRuntimeProvider implements AgentProvider {options: ProviderSessionOptions,): Promise<RuntimeSession> {if (- this.#runtime.type === "codex" &&+ (this.#runtime.type === "codex" ||+ this.#runtime.type === "antigravity") &&requireOpaqueObject(session, "session").threadId === "") {return this.createSession(options);@@ -420,7 +423,10 @@ export class RemoteRuntimeProvider implements AgentProvider {this.#sessionOptions = sessionOptions;return retained;}- if (this.#runtime.type === "codex") {+ if (+ this.#runtime.type === "codex" ||+ this.#runtime.type === "antigravity"+ ) {const retained = requireOpaqueObject(session, "session");if (typeof retained.threadId !== "string") {throw new TypeError("Retained native session identity is invalid");diff --git a/apps/node-services/src/agent/runner-gateway/runner-connections.ts b/apps/node-services/src/agent/runner-gateway/runner-connections.tsindex e7a66931..fe5bc1d3 100644--- a/apps/node-services/src/agent/runner-gateway/runner-connections.ts+++ b/apps/node-services/src/agent/runner-gateway/runner-connections.ts@@ -779,7 +779,7 @@ export class RunnerConnections {/** Whether the Computer can compact a parked session of this Runtime now. */supportsSessionCompaction(runnerId: string,- runtimeType: "codex" | "claude" | "pi",+ runtimeType: "codex" | "claude" | "pi" | "antigravity",): boolean {const connection = this.#connections.get(runnerId);return (@@ -810,7 +810,7 @@ export class RunnerConnections {/** Whether the Computer can run a model invocation on this Runtime now. */supportsModelInvoke(runnerId: string,- runtimeType: "codex" | "claude" | "pi",+ runtimeType: "codex" | "claude" | "pi" | "antigravity",): boolean {const connection = this.#connections.get(runnerId);return (diff --git a/apps/node-services/src/agent/runner-gateway/runner-debug-inspection.ts b/apps/node-services/src/agent/runner-gateway/runner-debug-inspection.tsindex 0172a669..afe28293 100644--- a/apps/node-services/src/agent/runner-gateway/runner-debug-inspection.ts+++ b/apps/node-services/src/agent/runner-gateway/runner-debug-inspection.ts@@ -111,7 +111,7 @@ export class RunnerDebugInspection {/** Whether detached native history can be read from this Computer now. */canReadDetachedHistory(computerId: string,- runtimeType: "codex" | "claude" | "pi",+ runtimeType: "codex" | "claude" | "pi" | "antigravity",): boolean {const connection = this.owners.connections().getConnection(computerId);if (!isServingConnection(connection)) return false;diff --git a/apps/node-services/src/agent/runner-gateway/runner-gateway-context.ts b/apps/node-services/src/agent/runner-gateway/runner-gateway-context.tsindex d75ad33a..7881f1af 100644--- a/apps/node-services/src/agent/runner-gateway/runner-gateway-context.ts+++ b/apps/node-services/src/agent/runner-gateway/runner-gateway-context.ts@@ -152,7 +152,7 @@ export interface RunnerRunOperationRecord {readonly epoch: string;readonly runId: string;readonly operationId: string;- readonly runtimeType: "codex" | "claude" | "pi";+ readonly runtimeType: "codex" | "claude" | "pi" | "antigravity";/** The Runtime turn the Operation started, once the Daemon reported it. */readonly turnId?: string;readonly usage?: readonly Record<string, unknown>[];diff --git a/apps/node-services/src/agent/runner-gateway/runner-gateway.ts b/apps/node-services/src/agent/runner-gateway/runner-gateway.tsindex 0a38f14a..64ea460a 100644--- a/apps/node-services/src/agent/runner-gateway/runner-gateway.ts+++ b/apps/node-services/src/agent/runner-gateway/runner-gateway.ts@@ -311,7 +311,7 @@ export class RunnerGatewaycanReadDetachedHistory(computerId: string,- runtimeType: "codex" | "claude" | "pi",+ runtimeType: "codex" | "claude" | "pi" | "antigravity",): boolean {return this.#debug.canReadDetachedHistory(computerId, runtimeType);}@@ -402,7 +402,7 @@ export class RunnerGatewaysupportsSessionCompaction(computerId: string,- runtimeType: "codex" | "claude" | "pi",+ runtimeType: "codex" | "claude" | "pi" | "antigravity",): boolean {return this.#connections.supportsSessionCompaction(computerId, runtimeType);}@@ -435,7 +435,7 @@ export class RunnerGatewaysupportsModelInvoke(computerId: string,- runtimeType: "codex" | "claude" | "pi",+ runtimeType: "codex" | "claude" | "pi" | "antigravity",): boolean {return this.#connections.supportsModelInvoke(computerId, runtimeType);}diff --git a/apps/node-services/src/agent/runner-gateway/runner-operation.ts b/apps/node-services/src/agent/runner-gateway/runner-operation.tsindex 6558861f..39a27187 100644--- a/apps/node-services/src/agent/runner-gateway/runner-operation.ts+++ b/apps/node-services/src/agent/runner-gateway/runner-operation.ts@@ -621,12 +621,13 @@ export class RunnerOperationState {}get resumable(): boolean {- // Codex announces its thread before the first input is durably in its- // history. Any model output, thinking included, comes after Codex- // recorded that input.+ // Codex and Antigravity announce their session before the first input+ // is durably in its history; an Antigravity session with no prompt yet+ // cannot be loaded at all. Any model output, thinking included, comes+ // after the runtime recorded that input.return (Boolean(this.#yieldSessionId) &&- (this.start.runtime_type !== "codex" || this.#observedNativeWork)+ (!namesOwnSession(this.start.runtime_type) || this.#observedNativeWork));}@@ -977,7 +978,7 @@ export class RunnerOperationState {const error =this.#yieldRequested && id && envelope.reason === "scheduler_yield"? new ProviderRunYieldedError(- runtime === "codex"+ namesOwnSession(runtime)? { threadId: id }: {provider: runtime,@@ -1385,6 +1386,12 @@ const encodedBytes = (value: unknown): number => {}};+// Codex and Antigravity name their own sessions and keep them as a thread+// id; Claude and Pi run a session id that Linger materialized.+function namesOwnSession(runtime: string): boolean {+ return runtime === "codex" || runtime === "antigravity";+}+const assertNever = (value: never): never => {throw new RunnerGatewayProtocolError(`Unsupported Runner envelope: ${JSON.stringify(value)}`,diff --git a/apps/node-services/src/runtime-model-call.ts b/apps/node-services/src/runtime-model-call.tsindex f411751f..88dd39cd 100644--- a/apps/node-services/src/runtime-model-call.ts+++ b/apps/node-services/src/runtime-model-call.ts@@ -31,7 +31,7 @@ export const modelCallEfforts: readonly ModelCallEffort[] = ["high",];-export type LocalRuntimeType = "codex" | "claude" | "pi";+export type LocalRuntimeType = "codex" | "claude" | "pi" | "antigravity";export interface ModelOwner {readonly tenantId: string;@@ -712,7 +712,9 @@ async function resolvePlacement(}/** Pi stays on Pi, even when it is unavailable. Codex and Claude retain- * their same-Computer fallback. Invocations use the selected Runtime's default. */+ * their same-Computer fallback. Antigravity has no model.invoke, so it uses+ * Claude, falling back to Codex. Invocations use the selected Runtime's+ * default. */function resolveTarget(gateway: RuntimeModelGateway,placement: ModelPlacement,@@ -721,7 +723,8 @@ function resolveTarget(readonly offline: boolean;readonly model?: RuntimeModelInfo;} {- const preferred = placement.runtimeType;+ const preferred =+ placement.runtimeType === "antigravity" ? "claude" : placement.runtimeType;const fallback = preferred === "claude" ? "codex" : "claude";const runtimeType =preferred !== "pi" &&@@ -1310,6 +1313,7 @@ function isPlacementItem(item: unknown): item is AnotherMePlacement {typeof item.computer_id === "string" &&(item.local_runtime_type === "codex" ||item.local_runtime_type === "claude" ||- item.local_runtime_type === "pi")+ item.local_runtime_type === "pi" ||+ item.local_runtime_type === "antigravity"));}diff --git a/apps/node-services/tests/agent/runner-gateway/go-local-daemon-process.test.ts b/apps/node-services/tests/agent/runner-gateway/go-local-daemon-process.test.tsindex 32db5968..a6d4a842 100644--- a/apps/node-services/tests/agent/runner-gateway/go-local-daemon-process.test.ts+++ b/apps/node-services/tests/agent/runner-gateway/go-local-daemon-process.test.ts@@ -1122,7 +1122,7 @@ processTest();}const registrations = connections.at(-1)?.hello.runtime_registrations;- expect(registrations).toHaveLength(3);+ expect(registrations).toHaveLength(4);const claude = registrations?.find(({ provider_type }) => provider_type === "claude",);diff --git a/apps/node-services/tests/agent/runner-gateway/runner-operations-public.test.ts b/apps/node-services/tests/agent/runner-gateway/runner-operations-public.test.tsindex 4f5f9190..4777dca7 100644--- a/apps/node-services/tests/agent/runner-gateway/runner-operations-public.test.ts+++ b/apps/node-services/tests/agent/runner-gateway/runner-operations-public.test.ts@@ -284,6 +284,105 @@ describe("RunnerGateway", () => {},);+ it("yields an Antigravity Run only after native work, keeping its session as a thread", async () => {+ const gateway = createTestRunnerGateway({+ createId: sequenceIds(),+ operationCancelTimeoutMs: 10,+ });+ const peer = new RecordingPeer();+ const connection = await acceptReadyConnection(+ gateway,+ peer,+ {+ ...hello([], 1),+ runtimes: ["antigravity"],+ runtime_diagnostics: runtimeDiagnostics({+ link: "api",+ ready: ["antigravity"],+ }),+ },+ { ...defaultAgentPlacement(), runtime: { type: "antigravity" } },+ );+ try {+ const target = runTarget();+ const task = await gateway.startOperation({+ ...target,+ request: { ...target.request, runtime: { type: "antigravity" } },+ runKind: "task",+ });+ const start = peer.sent.find(+ (command) => command.type === "operation.start",+ )!;+ const chat = gateway.startOperation({+ ...target,+ ...readyContextScope("chat"),+ request: { ...target.request, runtime: { type: "antigravity" } },+ runKind: "chat",+ });+ chat.then(+ (interactive) => interactive.result.catch(() => undefined),+ () => undefined,+ );+ await connection.receive(+ event(start, 1, {+ type: "operation.accepted",+ command_id: start.command_id,+ runner_pid: 100,+ }),+ );+ await connection.receive(+ event(start, 2, {+ type: "operation.event",+ event: {+ type: "run.started",+ turn_id: "turn-task",+ session: { threadId: "task-session", canYield: true },+ },+ }),+ );+ // The session exists before its prompt, which Antigravity cannot load.+ expect(await settlesWithin(chat, 10)).toBe(false);+ expect(peer.sent.some((command) => command.type === "cancel")).toBe(+ false,+ );+ await connection.receive(+ event(start, 3, {+ type: "operation.event",+ event: {+ type: "tool.called",+ call_id: "read",+ tool_name: "read",+ input: {},+ },+ }),+ );+ await vi.waitFor(() =>+ expect(+ peer.sent.find((command) => command.type === "cancel"),+ ).toMatchObject({+ operation_id: start.operation_id,+ reason: "scheduler_yield",+ }),+ );+ const yielded = task.result.then(+ () => undefined,+ (error: unknown) => error,+ );+ await connection.receive(+ event(start, 4, {+ type: "operation.cancelled",+ reason: "scheduler_yield",+ }),+ );+ expect(await yielded).toMatchObject({+ session: { threadId: "task-session" },+ });+ expect(await yielded).not.toHaveProperty("session.sessionId");+ } finally {+ connection.disconnect();+ }+ });+it("keeps a user-stopped Task's place through the cancel timeout and a later chat", async () => {const gateway = createTestRunnerGateway({createId: sequenceIds(),diff --git a/apps/node-services/tests/agent/runner-gateway/runtime-diagnostics-fixture.ts b/apps/node-services/tests/agent/runner-gateway/runtime-diagnostics-fixture.tsindex 58360cb7..f8059b35 100644--- a/apps/node-services/tests/agent/runner-gateway/runtime-diagnostics-fixture.ts+++ b/apps/node-services/tests/agent/runner-gateway/runtime-diagnostics-fixture.ts@@ -7,16 +7,23 @@ export const runtimeDiagnostics = (options?: {readonly ready?: readonly RuntimeDiagnostic["type"][];/** How every model is reached; subscription runs several units at once. */readonly link?: "api" | "subscription";-}): [RuntimeDiagnostic, RuntimeDiagnostic, RuntimeDiagnostic] => {+}): [+ RuntimeDiagnostic,+ RuntimeDiagnostic,+ RuntimeDiagnostic,+ RuntimeDiagnostic,+] => {const ready = new Set(options?.ready ?? ["codex"]);const authenticationRequired = new Set(options?.authenticationRequired ?? []);- return (["codex", "claude", "pi"] as const).map((type) => {+ return (["codex", "claude", "pi", "antigravity"] as const).map((type) => {const protocol =type === "codex"? ("app-server" as const): type === "claude"? ("stream-json" as const)- : ("rpc" as const);+ : type === "pi"+ ? ("rpc" as const)+ : ("acp" as const);// A current Computer reports each ready Runtime's model catalog.const models: NonNullable<RuntimeDiagnostic["models"]> = [{@@ -59,5 +66,10 @@ export const runtimeDiagnostics = (options?: {message: `${type} is not installed`,},};- }) as [RuntimeDiagnostic, RuntimeDiagnostic, RuntimeDiagnostic];+ }) as [+ RuntimeDiagnostic,+ RuntimeDiagnostic,+ RuntimeDiagnostic,+ RuntimeDiagnostic,+ ];};diff --git a/apps/node-services/tests/runtime-model-call.test.ts b/apps/node-services/tests/runtime-model-call.test.tsindex f1bff2ac..8aa932bc 100644--- a/apps/node-services/tests/runtime-model-call.test.ts+++ b/apps/node-services/tests/runtime-model-call.test.ts@@ -330,6 +330,23 @@ describe("Runtime model call", () => {expect(none.invokeModel.mock.calls[0]![1].runtimeType).toBe("codex");});+ it("calls an Antigravity Agent's model through Claude, else Codex", async () => {+ const antigravity: ModelPlacement = {+ ...alice,+ runtimeType: "antigravity",+ };+ const claude = setup({ placements: [antigravity], ready: () => true });+ await claude.modelCall.call({ ...ask, input: "x" });+ expect(claude.invokeModel.mock.calls[0]![1].runtimeType).toBe("claude");++ const codex = setup({+ placements: [antigravity],+ ready: (_computer, runtime) => runtime === "codex",+ });+ await codex.modelCall.call({ ...ask, input: "x" });+ expect(codex.invokeModel.mock.calls[0]![1].runtimeType).toBe("codex");+ });+it("caches an owner's placement for 30 seconds and drops it when the Computer is offline", async () => {const { modelCall, placements, advance } = setup({placements: [alice],diff --git a/apps/teamhub/internal/agentregistry/agent_registration.go b/apps/teamhub/internal/agentregistry/agent_registration.goindex 92793329..8a945c2f 100644--- a/apps/teamhub/internal/agentregistry/agent_registration.go+++ b/apps/teamhub/internal/agentregistry/agent_registration.go@@ -194,7 +194,8 @@ func ValidAgentRuntimeConfig(runtime httpapi.AgentRuntimeConfig) bool {func validLocalRuntimeType(runtimeType httpapi.LocalRuntimeType) bool {return runtimeType == httpapi.LocalRuntimeTypeCodex ||runtimeType == httpapi.LocalRuntimeTypeClaude ||- runtimeType == httpapi.LocalRuntimeTypePi+ runtimeType == httpapi.LocalRuntimeTypePi ||+ runtimeType == httpapi.LocalRuntimeTypeAntigravity}func agentRuntimeConfig(registration store.AgentRegistration) httpapi.AgentRuntimeConfig {diff --git a/apps/teamhub/internal/agentregistry/local_computer_inventory.go b/apps/teamhub/internal/agentregistry/local_computer_inventory.goindex 88a3403a..da3570f4 100644--- a/apps/teamhub/internal/agentregistry/local_computer_inventory.go+++ b/apps/teamhub/internal/agentregistry/local_computer_inventory.go@@ -15,9 +15,10 @@ import (// defaultLocalRuntimeModels stands in for a Runtime diagnostic that reported// no model catalog of its own; the Runtime then uses its host default model.var defaultLocalRuntimeModels = map[string]httpapi.AgentModel{- "claude": {Id: "claude-default", Label: "Claude default"},- "codex": {Id: "codex-default", Label: "Codex default"},- "pi": {Id: "pi-default", Label: "Pi default"},+ "claude": {Id: "claude-default", Label: "Claude default"},+ "codex": {Id: "codex-default", Label: "Codex default"},+ "pi": {Id: "pi-default", Label: "Pi default"},+ "antigravity": {Id: "antigravity-default", Label: "Antigravity default"},}type storedRuntimeDiagnostic struct {diff --git a/apps/teamhub/internal/agentruntimestate/runner.go b/apps/teamhub/internal/agentruntimestate/runner.goindex 0e42e364..f7c8b4ed 100644--- a/apps/teamhub/internal/agentruntimestate/runner.go+++ b/apps/teamhub/internal/agentruntimestate/runner.go@@ -603,7 +603,7 @@ func canonicalJSONArray(raw json.RawMessage) ([]byte, error) {// IsSupportedLocalRuntimeType excludes historical providers from active reads and admission.func IsSupportedLocalRuntimeType(runtimeType string) bool {- return slices.Contains([]string{"codex", "claude", "pi"}, runtimeType)+ return slices.Contains([]string{"codex", "claude", "pi", "antigravity"}, runtimeType)}func localComputerEnrollmentFromRow(row store.LocalComputerEnrollment) (LocalComputerEnrollment, error) {diff --git a/apps/teamhub/internal/agentruntimestate/runtime_failure.go b/apps/teamhub/internal/agentruntimestate/runtime_failure.goindex bca77f32..40af75f0 100644--- a/apps/teamhub/internal/agentruntimestate/runtime_failure.go+++ b/apps/teamhub/internal/agentruntimestate/runtime_failure.go@@ -39,7 +39,7 @@ func terminalRuntimeFailure(raw json.RawMessage) (*PublicRuntimeFailure, error)}// A failure observed without a selected Runtime names none.switch failure.RuntimeType {- case "", "codex", "claude", "pi":+ case "", "codex", "claude", "pi", "antigravity":default:return nil, ErrInvalid}diff --git a/apps/teamhub/migrations/00884_allow_antigravity_local_runtime.sql b/apps/teamhub/migrations/00884_allow_antigravity_local_runtime.sqlnew file mode 100644index 00000000..85537fc5--- /dev/null+++ b/apps/teamhub/migrations/00884_allow_antigravity_local_runtime.sql@@ -0,0 +1,19 @@+-- +goose Up+-- An Agent may run on a Computer's Antigravity CLI.+ALTER TABLE agent_registrations DROP CONSTRAINT agent_registrations_placement_check;+ALTER TABLE agent_registrations ADD CONSTRAINT agent_registrations_placement_check CHECK (+ status = 'revoked'+ OR (+ computer_id IS NOT NULL+ AND computer_id ~ '^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$'+ AND local_runtime_type IS NOT NULL+ AND local_runtime_type = ANY (ARRAY['codex', 'claude', 'pi', 'antigravity'])+ AND workspace_grant_id IS NOT NULL+ AND workspace_grant_id ~ '^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$'+ )+);++-- +goose Down+-- +goose StatementBegin+DO $$ BEGIN RAISE EXCEPTION 'the Antigravity local runtime is forward-only'; END $$;+-- +goose StatementEnddiff --git a/apps/web/src/features/local-computer/computer-app-icons.ts b/apps/web/src/features/local-computer/computer-app-icons.tsindex 2759f312..d049a68c 100644--- a/apps/web/src/features/local-computer/computer-app-icons.ts+++ b/apps/web/src/features/local-computer/computer-app-icons.ts@@ -1,4 +1,9 @@-import { ChatGptIcon, ClaudeIcon, PiIcon } from "@hugeicons/core-free-icons";+import {+ ChatGptIcon,+ ClaudeIcon,+ GoogleGeminiIcon,+ PiIcon,+} from "@hugeicons/core-free-icons";import type { IconSvgElement } from "@/components/ui/icon";import type { TeamHubLocalRuntimeType } from "@/features/teamhub/teamhub-types";@@ -7,4 +12,5 @@ export const appIcons = {claude: ClaudeIcon,codex: ChatGptIcon,pi: PiIcon,+ antigravity: GoogleGeminiIcon,} satisfies Record<TeamHubLocalRuntimeType, IconSvgElement>;diff --git a/apps/web/src/features/local-computer/computer-readiness.ts b/apps/web/src/features/local-computer/computer-readiness.tsindex c5ee82a4..b68c07bc 100644--- a/apps/web/src/features/local-computer/computer-readiness.ts+++ b/apps/web/src/features/local-computer/computer-readiness.ts@@ -13,18 +13,21 @@ export const appOrder: readonly TeamHubLocalRuntimeType[] = ["claude","codex","pi",+ "antigravity",];export const appNames = {claude: "Claude Code",codex: "Codex",pi: "Pi",+ antigravity: "Antigravity",} satisfies Record<TeamHubLocalRuntimeType, string>;export const appDescriptions = {claude: "Anthropic's coding agent",codex: "OpenAI's coding agent",pi: "Open-source coding agent",+ antigravity: "Google's coding agent",} satisfies Record<TeamHubLocalRuntimeType, string>;export const runtimeStatusLabels = {diff --git a/apps/web/src/features/local-computer/local-runtime-authentication-guidance.tsx b/apps/web/src/features/local-computer/local-runtime-authentication-guidance.tsxindex 0e13e394..e54474cb 100644--- a/apps/web/src/features/local-computer/local-runtime-authentication-guidance.tsx+++ b/apps/web/src/features/local-computer/local-runtime-authentication-guidance.tsx@@ -26,6 +26,12 @@ export function LocalRuntimeAuthenticationGuidance({auth.json.</p>)}+ {runtimeType === "antigravity" && (+ <p className="mt-1 text-muted-foreground">+ Antigravity can also use a Gemini API key set as GEMINI_API_KEY for+ Local Computer.+ </p>+ )}</>);}diff --git a/apps/web/src/features/local-computer/local-runtime-commands.ts b/apps/web/src/features/local-computer/local-runtime-commands.tsindex 796bab0d..460b7579 100644--- a/apps/web/src/features/local-computer/local-runtime-commands.ts+++ b/apps/web/src/features/local-computer/local-runtime-commands.ts@@ -2,11 +2,15 @@ import type { TeamHubLocalRuntimeType } from "@/features/teamhub/teamhub-types";import type { ComputerPlatform } from "./computer-platform";-/** The command that signs in to each AI app; Pi signs in with /login inside it. */+/**+ * The command that signs in to each AI app; Pi signs in with /login inside it,+ * and Antigravity opens its Google sign-in on its first start.+ */export const loginCommands = {codex: "codex login",claude: "claude auth login",pi: "pi",+ antigravity: "agy",} satisfies Record<TeamHubLocalRuntimeType, string>;// Local Computer finds these installs in its default search folders@@ -19,6 +23,10 @@ export function installCommand(return platform === "win32"? "irm https://claude.ai/install.ps1 | iex": "curl -fsSL https://claude.ai/install.sh | bash";+ if (runtimeType === "antigravity")+ return platform === "win32"+ ? "irm https://antigravity.google/cli/install.ps1 | iex"+ : "curl -fsSL https://antigravity.google/cli/install.sh | bash";return runtimeType === "codex"? "npm install -g @openai/codex": "npm install -g @earendil-works/pi-coding-agent";diff --git a/apps/web/src/features/rooms/members/actor-profile.tsx b/apps/web/src/features/rooms/members/actor-profile.tsxindex e4c526a2..b9ea0da6 100644--- a/apps/web/src/features/rooms/members/actor-profile.tsx+++ b/apps/web/src/features/rooms/members/actor-profile.tsx@@ -712,7 +712,12 @@ function PanelAgentRuntimeDetails({onEdit: (field?: AgentRuntimeField) => void;}) {const type = placement?.runtime_type ?? "codex";- const name = { codex: "Codex", claude: "Claude Code", pi: "Pi" }[type];+ const name = {+ codex: "Codex",+ claude: "Claude Code",+ pi: "Pi",+ antigravity: "Antigravity",+ }[type];const computer =localRuntime?.display_name || placement?.computer_id || "Local Computer";const status = localRuntime?.computer_status ?? "unknown";diff --git a/apps/web/src/features/rooms/members/agent-move-target.ts b/apps/web/src/features/rooms/members/agent-move-target.tsindex 652f33bb..38e85527 100644--- a/apps/web/src/features/rooms/members/agent-move-target.ts+++ b/apps/web/src/features/rooms/members/agent-move-target.ts@@ -16,6 +16,7 @@ export const runtimeLabels: Record<TeamHubLocalRuntimeType, string> = {claude: "Claude Code",codex: "Codex",pi: "Pi",+ antigravity: "Antigravity",};/** The full placement plus model an Agent moves to on another Local Computer. */diff --git a/apps/web/src/features/rooms/quick-create-local-agent-dialog.tsx b/apps/web/src/features/rooms/quick-create-local-agent-dialog.tsxindex 6de092ee..012e5910 100644--- a/apps/web/src/features/rooms/quick-create-local-agent-dialog.tsx+++ b/apps/web/src/features/rooms/quick-create-local-agent-dialog.tsx@@ -33,6 +33,7 @@ const localRuntimeLabels: Record<TeamHubLocalRuntimeType, string> = {claude: "Claude Code",codex: "Codex",pi: "Pi",+ antigravity: "Antigravity",};const effortLabels: Record<TeamHubAgentReasoningEffort, string> = {diff --git a/apps/web/src/features/rooms/runtime-status/runtime-failure-message.ts b/apps/web/src/features/rooms/runtime-status/runtime-failure-message.tsindex f5278db2..e28d7210 100644--- a/apps/web/src/features/rooms/runtime-status/runtime-failure-message.ts+++ b/apps/web/src/features/rooms/runtime-status/runtime-failure-message.ts@@ -51,6 +51,7 @@ export function runtimeFailureMessage(codex: "Codex",claude: "Claude",pi: "Pi",+ antigravity: "Antigravity",}[failure.runtime_type];if (!runtime) return "Run failed";const version =diff --git a/apps/web/src/features/teamhub/teamhub-agent-client.ts b/apps/web/src/features/teamhub/teamhub-agent-client.tsindex 2f806f94..6a458741 100644--- a/apps/web/src/features/teamhub/teamhub-agent-client.ts+++ b/apps/web/src/features/teamhub/teamhub-agent-client.ts@@ -37,7 +37,10 @@ export function createTeamHubAgentClient(...computer,runtimes: computer.runtimes.filter(({ type }) =>- type === "codex" || type === "claude" || type === "pi",+ type === "codex" ||+ type === "claude" ||+ type === "pi" ||+ type === "antigravity",),})),};diff --git a/contracts/generated/go/teamhubinternal/openapi.gen.go b/contracts/generated/go/teamhubinternal/openapi.gen.goindex a762d038..13ecbac6 100644--- a/contracts/generated/go/teamhubinternal/openapi.gen.go+++ b/contracts/generated/go/teamhubinternal/openapi.gen.go@@ -436,14 +436,17 @@ func (e AgentRuntimeLocalComputerPlatform) Valid() bool {// Defines values for AgentRuntimeLocalComputerRuntimes.const (- AgentRuntimeLocalComputerRuntimesClaude AgentRuntimeLocalComputerRuntimes = "claude"- AgentRuntimeLocalComputerRuntimesCodex AgentRuntimeLocalComputerRuntimes = "codex"- AgentRuntimeLocalComputerRuntimesPi AgentRuntimeLocalComputerRuntimes = "pi"+ AgentRuntimeLocalComputerRuntimesAntigravity AgentRuntimeLocalComputerRuntimes = "antigravity"+ AgentRuntimeLocalComputerRuntimesClaude AgentRuntimeLocalComputerRuntimes = "claude"+ AgentRuntimeLocalComputerRuntimesCodex AgentRuntimeLocalComputerRuntimes = "codex"+ AgentRuntimeLocalComputerRuntimesPi AgentRuntimeLocalComputerRuntimes = "pi")// Valid indicates whether the value is a known member of the AgentRuntimeLocalComputerRuntimes enum.func (e AgentRuntimeLocalComputerRuntimes) Valid() bool {switch e {+ case AgentRuntimeLocalComputerRuntimesAntigravity:+ return truecase AgentRuntimeLocalComputerRuntimesClaude:return truecase AgentRuntimeLocalComputerRuntimesCodex:@@ -679,14 +682,17 @@ func (e ConnectAgentRuntimeLocalComputerRequestPlatform) Valid() bool {// Defines values for ConnectAgentRuntimeLocalComputerRequestRuntimes.const (- ConnectAgentRuntimeLocalComputerRequestRuntimesClaude ConnectAgentRuntimeLocalComputerRequestRuntimes = "claude"- ConnectAgentRuntimeLocalComputerRequestRuntimesCodex ConnectAgentRuntimeLocalComputerRequestRuntimes = "codex"- ConnectAgentRuntimeLocalComputerRequestRuntimesPi ConnectAgentRuntimeLocalComputerRequestRuntimes = "pi"+ ConnectAgentRuntimeLocalComputerRequestRuntimesAntigravity ConnectAgentRuntimeLocalComputerRequestRuntimes = "antigravity"+ ConnectAgentRuntimeLocalComputerRequestRuntimesClaude ConnectAgentRuntimeLocalComputerRequestRuntimes = "claude"+ ConnectAgentRuntimeLocalComputerRequestRuntimesCodex ConnectAgentRuntimeLocalComputerRequestRuntimes = "codex"+ ConnectAgentRuntimeLocalComputerRequestRuntimesPi ConnectAgentRuntimeLocalComputerRequestRuntimes = "pi")// Valid indicates whether the value is a known member of the ConnectAgentRuntimeLocalComputerRequestRuntimes enum.func (e ConnectAgentRuntimeLocalComputerRequestRuntimes) Valid() bool {switch e {+ case ConnectAgentRuntimeLocalComputerRequestRuntimesAntigravity:+ return truecase ConnectAgentRuntimeLocalComputerRequestRuntimesClaude:return truecase ConnectAgentRuntimeLocalComputerRequestRuntimesCodex:@@ -1129,14 +1135,17 @@ func (e LocalModelsUnavailableCode) Valid() bool {// Defines values for LocalRuntimeType.const (- LocalRuntimeTypeClaude LocalRuntimeType = "claude"- LocalRuntimeTypeCodex LocalRuntimeType = "codex"- LocalRuntimeTypePi LocalRuntimeType = "pi"+ LocalRuntimeTypeAntigravity LocalRuntimeType = "antigravity"+ LocalRuntimeTypeClaude LocalRuntimeType = "claude"+ LocalRuntimeTypeCodex LocalRuntimeType = "codex"+ LocalRuntimeTypePi LocalRuntimeType = "pi")// Valid indicates whether the value is a known member of the LocalRuntimeType enum.func (e LocalRuntimeType) Valid() bool {switch e {+ case LocalRuntimeTypeAntigravity:+ return truecase LocalRuntimeTypeClaude:return truecase LocalRuntimeTypeCodex:@@ -1678,14 +1687,17 @@ func (e TaskWorkerTransitionRequestTransition) Valid() bool {// Defines values for TouchAgentRuntimeLocalComputerRequestRuntimes.const (- TouchAgentRuntimeLocalComputerRequestRuntimesClaude TouchAgentRuntimeLocalComputerRequestRuntimes = "claude"- TouchAgentRuntimeLocalComputerRequestRuntimesCodex TouchAgentRuntimeLocalComputerRequestRuntimes = "codex"- TouchAgentRuntimeLocalComputerRequestRuntimesPi TouchAgentRuntimeLocalComputerRequestRuntimes = "pi"+ TouchAgentRuntimeLocalComputerRequestRuntimesAntigravity TouchAgentRuntimeLocalComputerRequestRuntimes = "antigravity"+ TouchAgentRuntimeLocalComputerRequestRuntimesClaude TouchAgentRuntimeLocalComputerRequestRuntimes = "claude"+ TouchAgentRuntimeLocalComputerRequestRuntimesCodex TouchAgentRuntimeLocalComputerRequestRuntimes = "codex"+ TouchAgentRuntimeLocalComputerRequestRuntimesPi TouchAgentRuntimeLocalComputerRequestRuntimes = "pi")// Valid indicates whether the value is a known member of the TouchAgentRuntimeLocalComputerRequestRuntimes enum.func (e TouchAgentRuntimeLocalComputerRequestRuntimes) Valid() bool {switch e {+ case TouchAgentRuntimeLocalComputerRequestRuntimesAntigravity:+ return truecase TouchAgentRuntimeLocalComputerRequestRuntimesClaude:return truecase TouchAgentRuntimeLocalComputerRequestRuntimesCodex:diff --git a/contracts/generated/go/teamhubpublic/openapi.gen.go b/contracts/generated/go/teamhubpublic/openapi.gen.goindex d366fffd..1e08a1f2 100644--- a/contracts/generated/go/teamhubpublic/openapi.gen.go+++ b/contracts/generated/go/teamhubpublic/openapi.gen.go@@ -2572,14 +2572,17 @@ func (e LocalRuntimeDiagnosticStatus) Valid() bool {// Defines values for LocalRuntimeType.const (- LocalRuntimeTypeClaude LocalRuntimeType = "claude"- LocalRuntimeTypeCodex LocalRuntimeType = "codex"- LocalRuntimeTypePi LocalRuntimeType = "pi"+ LocalRuntimeTypeAntigravity LocalRuntimeType = "antigravity"+ LocalRuntimeTypeClaude LocalRuntimeType = "claude"+ LocalRuntimeTypeCodex LocalRuntimeType = "codex"+ LocalRuntimeTypePi LocalRuntimeType = "pi")// Valid indicates whether the value is a known member of the LocalRuntimeType enum.func (e LocalRuntimeType) Valid() bool {switch e {+ case LocalRuntimeTypeAntigravity:+ return truecase LocalRuntimeTypeClaude:return truecase LocalRuntimeTypeCodex:diff --git a/contracts/generated/typescript/src/generated/runner-gateway/schema.ts b/contracts/generated/typescript/src/generated/runner-gateway/schema.tsindex 497f4a8b..6266fd95 100644--- a/contracts/generated/typescript/src/generated/runner-gateway/schema.ts+++ b/contracts/generated/typescript/src/generated/runner-gateway/schema.ts@@ -228,7 +228,7 @@ export const runnerGatewayEnvelopeSchema = {required: ["type", "status", "protocol", "checked_at", "models"],properties: {type: {- enum: ["codex", "claude", "pi"],+ enum: ["codex", "claude", "pi", "antigravity"],},status: {enum: [@@ -240,7 +240,7 @@ export const runnerGatewayEnvelopeSchema = {],},protocol: {- enum: ["app-server", "stream-json", "rpc"],+ enum: ["app-server", "stream-json", "rpc", "acp"],},checked_at: {$ref: "#/$defs/Timestamp",@@ -339,7 +339,7 @@ export const runnerGatewayEnvelopeSchema = {RuntimeDiagnostics: {type: "array",minItems: 1,- maxItems: 3,+ maxItems: 4,items: {$ref: "#/$defs/RuntimeDiagnostic",},@@ -449,7 +449,7 @@ export const runnerGatewayEnvelopeSchema = {$ref: "#/$defs/Id",},provider_type: {- enum: ["codex", "claude", "pi"],+ enum: ["codex", "claude", "pi", "antigravity"],},status: {enum: ["online", "offline", "unavailable"],@@ -832,7 +832,7 @@ export const runnerGatewayEnvelopeSchema = {$ref: "#/$defs/Id",},runtime_type: {- enum: ["codex", "claude", "pi"],+ enum: ["codex", "claude", "pi", "antigravity"],},kind: {const: "run.start",@@ -2995,7 +2995,7 @@ export const runnerGatewayEnvelopeSchema = {minItems: 0,uniqueItems: true,items: {- enum: ["codex", "claude", "pi"],+ enum: ["codex", "claude", "pi", "antigravity"],},},runtime_diagnostics: {@@ -3301,7 +3301,7 @@ export const runnerGatewayEnvelopeSchema = {required: ["type"],properties: {type: {- enum: ["codex", "claude", "pi"],+ enum: ["codex", "claude", "pi", "antigravity"],},model: {type: "string",@@ -4025,7 +4025,7 @@ export const runnerGatewayEnvelopeSchema = {$ref: "#/$defs/Id",},runtime_type: {- enum: ["codex", "claude", "pi"],+ enum: ["codex", "claude", "pi", "antigravity"],},host_access: {const: "trusted",@@ -4158,7 +4158,7 @@ export const runnerGatewayEnvelopeSchema = {$ref: "#/$defs/Id",},runtime_type: {- enum: ["codex", "claude", "pi"],+ enum: ["codex", "claude", "pi", "antigravity"],},},},@@ -5554,7 +5554,7 @@ export const runnerGatewayEnvelopeSchema = {],},runtime_type: {- enum: ["codex", "claude", "pi"],+ enum: ["codex", "claude", "pi", "antigravity"],},runtime_version: {type: "string",diff --git a/contracts/generated/typescript/src/generated/runner-gateway/types.ts b/contracts/generated/typescript/src/generated/runner-gateway/types.tsindex 19abad05..cfd2d1e5 100644--- a/contracts/generated/typescript/src/generated/runner-gateway/types.ts+++ b/contracts/generated/typescript/src/generated/runner-gateway/types.ts@@ -154,7 +154,7 @@ export type OperationIdentity = OperationScope & {generation: PositiveInteger;execution_lease_id: Id;workspace_grant_id: Id;- runtime_type: "codex" | "claude" | "pi";+ runtime_type: "codex" | "claude" | "pi" | "antigravity";};export type OperationStart = OperationScope & {type: "operation.start";@@ -174,7 +174,7 @@ export type OperationStart = OperationScope & {generation: PositiveInteger;execution_lease_id: Id;workspace_grant_id: Id;- runtime_type: "codex" | "claude" | "pi";+ runtime_type: "codex" | "claude" | "pi" | "antigravity";host_access?: "trusted";request: RuntimeOperationRequest;};@@ -234,12 +234,18 @@ export type DaemonToAgentEnvelope =| ComputerToolResult;/*** @minItems 1- * @maxItems 3+ * @maxItems 4*/export type RuntimeDiagnostics =| [RuntimeDiagnostic]| [RuntimeDiagnostic, RuntimeDiagnostic]- | [RuntimeDiagnostic, RuntimeDiagnostic, RuntimeDiagnostic];+ | [RuntimeDiagnostic, RuntimeDiagnostic, RuntimeDiagnostic]+ | [+ RuntimeDiagnostic,+ RuntimeDiagnostic,+ RuntimeDiagnostic,+ RuntimeDiagnostic,+ ];/*** @maxItems 100*/@@ -299,7 +305,7 @@ export type ActiveOperation = OperationScope & {generation: PositiveInteger;execution_lease_id: Id;workspace_grant_id: Id;- runtime_type: "codex" | "claude" | "pi";+ runtime_type: "codex" | "claude" | "pi" | "antigravity";kind: "run.start";last_emitted_seq: NonNegativeInteger;last_acked_seq: NonNegativeInteger;@@ -854,7 +860,7 @@ export interface RuntimeRegistration {export interface RuntimeRegistrationObservation {tenant_id: Id;owner_actor_id: Id;- provider_type: "codex" | "claude" | "pi";+ provider_type: "codex" | "claude" | "pi" | "antigravity";status: "online" | "offline" | "unavailable";revision: PositiveInteger;capabilities: Id[];@@ -874,7 +880,7 @@ export interface AgentRunnerWireIdentity {runner_revision: PositiveInteger;}export interface RuntimeConfig {- type: "codex" | "claude" | "pi";+ type: "codex" | "claude" | "pi" | "antigravity";model?: string;reasoning_effort?:| "none"@@ -1149,7 +1155,7 @@ export interface RunnerHello {/*** @minItems 0*/- runtimes: ("codex" | "claude" | "pi")[];+ runtimes: ("codex" | "claude" | "pi" | "antigravity")[];runtime_diagnostics: RuntimeDiagnostics;capabilities: RunnerCapability[];workspace_grants: WorkspaceGrant[];@@ -1157,14 +1163,14 @@ export interface RunnerHello {active_operations: ActiveOperation[];}export interface RuntimeDiagnostic {- type: "codex" | "claude" | "pi";+ type: "codex" | "claude" | "pi" | "antigravity";status:| "not_installed"| "authentication_required"| "ready"| "incompatible"| "error";- protocol: "app-server" | "stream-json" | "rpc";+ protocol: "app-server" | "stream-json" | "rpc" | "acp";checked_at: Timestamp;version?: string;/**@@ -2033,7 +2039,7 @@ export interface RuntimeExecutionFailure {| "model_service_error"| "timeout"| "execution_failed";- runtime_type: "codex" | "claude" | "pi";+ runtime_type: "codex" | "claude" | "pi" | "antigravity";runtime_version?: string;}export interface RuntimeFailureDiagnostics {diff --git a/contracts/generated/typescript/src/generated/teamhub-internal/types.ts b/contracts/generated/typescript/src/generated/teamhub-internal/types.tsindex 50b18dec..f48c798b 100644--- a/contracts/generated/typescript/src/generated/teamhub-internal/types.ts+++ b/contracts/generated/typescript/src/generated/teamhub-internal/types.ts@@ -1814,7 +1814,7 @@ export interface components {| "max"| "ultra";/** @enum {string} */- LocalRuntimeType: "codex" | "claude" | "pi";+ LocalRuntimeType: "codex" | "claude" | "pi" | "antigravity";AgentRuntimeSettingsSnapshot: {/** @constant */type: "local";@@ -2405,7 +2405,7 @@ export interface components {/** Format: date-time */last_seen_at?: string;capacity?: number;- runtimes: ("codex" | "claude" | "pi")[];+ runtimes: ("codex" | "claude" | "pi" | "antigravity")[];runtime_diagnostics: {[key: string]: unknown;}[];@@ -2436,7 +2436,7 @@ export interface components {/** @enum {string} */platform?: "darwin" | "linux" | "win32";capacity?: number;- runtimes: ("codex" | "claude" | "pi")[];+ runtimes: ("codex" | "claude" | "pi" | "antigravity")[];runtime_diagnostics: {[key: string]: unknown;}[];@@ -2472,7 +2472,7 @@ export interface components {status: "online" | "offline" | "upgrade_required";/** Format: date-time */seen_at: string;- runtimes?: ("codex" | "claude" | "pi")[];+ runtimes?: ("codex" | "claude" | "pi" | "antigravity")[];runtime_diagnostics?: {[key: string]: unknown;}[];diff --git a/contracts/generated/typescript/src/generated/teamhub-public/types.ts b/contracts/generated/typescript/src/generated/teamhub-public/types.tsindex 96d24e94..14e519f1 100644--- a/contracts/generated/typescript/src/generated/teamhub-public/types.ts+++ b/contracts/generated/typescript/src/generated/teamhub-public/types.ts@@ -4262,7 +4262,7 @@ export interface components {| "max"| "ultra";/** @enum {string} */- LocalRuntimeType: "codex" | "claude" | "pi";+ LocalRuntimeType: "codex" | "claude" | "pi" | "antigravity";/** @description Agents run on one of the Sponsor's Local Computers. Placement requires computer_id, runtime_type, and workspace_grant_id; TeamHub validates that invariant before persistence. */AgentRuntimePlacement: {/** @enum {string} */diff --git a/contracts/openapi/components/agent-runtime-state.yaml b/contracts/openapi/components/agent-runtime-state.yamlindex 3a9db324..628dc4c6 100644--- a/contracts/openapi/components/agent-runtime-state.yaml+++ b/contracts/openapi/components/agent-runtime-state.yaml@@ -1417,7 +1417,7 @@ components:type: arrayitems:type: string- enum: [codex, claude, pi]+ enum: [codex, claude, pi, antigravity]runtime_diagnostics:type: arrayitems:@@ -1491,7 +1491,7 @@ components:type: arrayitems:type: string- enum: [codex, claude, pi]+ enum: [codex, claude, pi, antigravity]runtime_diagnostics:type: arrayitems:@@ -1577,7 +1577,7 @@ components:type: arrayitems:type: string- enum: [codex, claude, pi]+ enum: [codex, claude, pi, antigravity]runtime_diagnostics:type: arrayitems:diff --git a/contracts/openapi/components/domain.yaml b/contracts/openapi/components/domain.yamlindex c55df4a4..a7716756 100644--- a/contracts/openapi/components/domain.yaml+++ b/contracts/openapi/components/domain.yaml@@ -121,9 +121,14 @@ components:default: generalLocalRuntimeType:type: string- enum: [codex, claude, pi]+ enum: [codex, claude, pi, antigravity]x-enum-varnames:- [LocalRuntimeTypeCodex, LocalRuntimeTypeClaude, LocalRuntimeTypePi]+ [+ LocalRuntimeTypeCodex,+ LocalRuntimeTypeClaude,+ LocalRuntimeTypePi,+ LocalRuntimeTypeAntigravity,+ ]AgentRuntimePlacement:type: objectadditionalProperties: falsediff --git a/contracts/runner-gateway/envelope.schema.json b/contracts/runner-gateway/envelope.schema.jsonindex 1b7f00cf..d4330a76 100644--- a/contracts/runner-gateway/envelope.schema.json+++ b/contracts/runner-gateway/envelope.schema.json@@ -225,7 +225,7 @@"required": ["type", "status", "protocol", "checked_at", "models"],"properties": {"type": {- "enum": ["codex", "claude", "pi"]+ "enum": ["codex", "claude", "pi", "antigravity"]},"status": {"enum": [@@ -237,7 +237,7 @@]},"protocol": {- "enum": ["app-server", "stream-json", "rpc"]+ "enum": ["app-server", "stream-json", "rpc", "acp"]},"checked_at": {"$ref": "#/$defs/Timestamp"@@ -332,7 +332,7 @@"RuntimeDiagnostics": {"type": "array","minItems": 1,- "maxItems": 3,+ "maxItems": 4,"items": {"$ref": "#/$defs/RuntimeDiagnostic"}@@ -442,7 +442,7 @@"$ref": "#/$defs/Id"},"provider_type": {- "enum": ["codex", "claude", "pi"]+ "enum": ["codex", "claude", "pi", "antigravity"]},"status": {"enum": ["online", "offline", "unavailable"]@@ -822,7 +822,7 @@"$ref": "#/$defs/Id"},"runtime_type": {- "enum": ["codex", "claude", "pi"]+ "enum": ["codex", "claude", "pi", "antigravity"]},"kind": {"const": "run.start"@@ -2952,7 +2952,7 @@"minItems": 0,"uniqueItems": true,"items": {- "enum": ["codex", "claude", "pi"]+ "enum": ["codex", "claude", "pi", "antigravity"]}},"runtime_diagnostics": {@@ -3256,7 +3256,7 @@"required": ["type"],"properties": {"type": {- "enum": ["codex", "claude", "pi"]+ "enum": ["codex", "claude", "pi", "antigravity"]},"model": {"type": "string",@@ -3976,7 +3976,7 @@"$ref": "#/$defs/Id"},"runtime_type": {- "enum": ["codex", "claude", "pi"]+ "enum": ["codex", "claude", "pi", "antigravity"]},"host_access": {"const": "trusted"@@ -4109,7 +4109,7 @@"$ref": "#/$defs/Id"},"runtime_type": {- "enum": ["codex", "claude", "pi"]+ "enum": ["codex", "claude", "pi", "antigravity"]}}},@@ -5495,7 +5495,7 @@]},"runtime_type": {- "enum": ["codex", "claude", "pi"]+ "enum": ["codex", "claude", "pi", "antigravity"]},"runtime_version": {"type": "string",diff --git a/docs/architecture.md b/docs/architecture.mdindex 57a34bb8..f284f974 100644--- a/docs/architecture.md+++ b/docs/architecture.md@@ -13,7 +13,7 @@ figure.| Runtime → teamhub CLI ↔ Rooms / Chat | messages / files, tasks / routines / more actions | The CLI calls the server directly, and the server checks each call against the agent's current permissions || Runtime → Guardrail → Cua, Playwright, Shell | click, type · browse · commands, as you | Rule-based checks, then an LLM review; Cua, Playwright and the Shell then act as the user |-<sub>Pi runs without review.</sub>+<sub>Pi runs without review. Antigravity is reviewed when it asks for a tool permission.</sub>## Inside Rooms / Chat@@ -73,6 +73,7 @@ and runs them.│ files from the Codex app-server · computer and browser ││ server, checked Claude stream-json · MCP servers, one set ││ by SHA-256 Pi RPC; 8 parked each per run │+│ Antigravity ACP │└───────┬───────────────────────────┬───────────────────────────┬──────────────┘▼ ▼ ▼Agent workspace Runtime Cua · Playwrightdiff --git a/docs/self-hosting.md b/docs/self-hosting.mdindex 8dc2f932..56b4645c 100644--- a/docs/self-hosting.md+++ b/docs/self-hosting.md@@ -25,8 +25,8 @@ printf '%s\n' 'choose-a-password' | docker compose exec -T teamhub \```Open <http://localhost:3000> and sign in. The app then shows the commands that-connect your computer, and it opens once Claude Code, Codex or Pi is installed-and ready there. With Pi and no model yet, open Settings › Models from+connect your computer, and it opens once Claude Code, Codex, Pi or Antigravity+is installed and ready there. With Pi and no model yet, open Settings › Models fromthat screen and load one; Settings stays reachable while the rest of the appwaits.