chenhg5/cc-connect · error

%s

Error message

%s

What it means

When the antigravity (agy) CLI process exits non-zero, the session's readLoop emits a core.EventError whose message is the process's captured stderr output. cc-connect throws this so the messaging-platform user sees why the agent turn failed. The message text is whatever agy wrote to stderr, not a fixed string.

Source

Thrown at agent/antigravity/session.go:268

			}
			if sid != "" {
				as.chatID.Store(sid)
				slog.Debug("antigravitySession: detected session ID", "session_id", sid)
				// Emit an EventText carrying the session ID back to core.
				select {
				case as.events <- core.Event{Type: core.EventText, SessionID: sid}:
				case <-as.ctx.Done():
				}
			}
		}

		sid := as.CurrentSessionID()
		if err != nil {
			stderrMsg := strings.TrimSpace(stderrBuf.String())
			if stderrMsg != "" {
				slog.Error("antigravitySession: process failed", "error", err, "stderr", stderrMsg)
				select {
				case as.events <- core.Event{Type: core.EventError, Error: fmt.Errorf("%s", stderrMsg)}:
				case <-as.ctx.Done():
				}
			}
		}

		// Finalize turn.
		select {
		case as.events <- core.Event{Type: core.EventResult, SessionID: sid, Done: true}:
		case <-as.ctx.Done():
		}
	}()

	go func() {
		<-ctx.Done()
		_ = stdout.Close()
	}()

	reader := bufio.NewReader(stdout)

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Run the exact agy command by hand in the session workDir and read the same stderr message to see the root cause
  2. Verify agy is installed and current: `agy --version`, upgrade if outdated
  3. Re-authenticate antigravity CLI if the stderr mentions credentials/auth
  4. Check the configured mode in config.toml (yolo/plan/default) still maps to valid agy flags for your agy version
  5. Retry the turn once to rule out a transient process failure

Example fix

// before (diagnosing)
// engine logs: "antigravitySession: process failed" error="exit status 1" stderr="unknown flag: --sandbox"
// after
// remove or correct the mode in config.toml so buildSendArgs() emits only flags your agy supports
Defensive patterns

Strategy: try-catch

Validate before calling

if _, err := exec.LookPath("agy"); err != nil { log.Fatal("agy not installed/on PATH") }
out, err := exec.Command("agy", "--version").CombinedOutput()
if err != nil { log.Fatalf("agy broken: %v: %s", err, out) }

Type guard

// Go: inspect the event before surfacing
if evt.Type == core.EventError && evt.Error != nil {
    var stderrMsg string
    if errors.As(evt.Error, &stderrMsg) { /* stderr-originated */ }
}

Try / catch

for evt := range session.Events() {
    if evt.Type == core.EventError && evt.Error != nil {
        slog.Warn("agy turn failed", "err", evt.Error) // show stderr text to user
        continue
    }
}

Prevention

When it happens

Trigger: Running a turn via the antigravity session when the agy process terminates with a non-nil error from cmd.Wait() and stderrBuf contains non-empty output; e.g. bad CLI flags, missing/broken agy install, auth failure, or invalid prompt context.

Common situations: agy not installed or not on PATH; antigravity account not authenticated; unsupported --sandbox / --dangerously-skip-permissions flag after an agy version change; project state agy refuses to load.

Related errors


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/d00a6baf911f122a. Report an issue: GitHub.