{"record":{"id":"9014638db4315945","repo":"chenhg5/cc-connect","slug":"antigravitysession-start-w","errorCode":null,"errorMessage":"antigravitySession: start: %w","messagePattern":"antigravitySession: start: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/antigravity/session.go","lineNumber":196,"sourceCode":"\t\tenv = core.MergeEnv(env, as.extraEnv)\n\t}\n\tif as.permissionBridge != nil {\n\t\tenv = core.MergeEnv(env, as.permissionBridge.Env())\n\t}\n\tcmd.Env = env\n\n\t// Keep stdin disconnected: agy --print consumes piped stdin to EOF before\n\t// processing the prompt, so an open pipe would deadlock the turn.\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"antigravitySession: stdout pipe: %w\", err)\n\t}\n\n\tvar stderrBuf bytes.Buffer\n\tcmd.Stderr = &stderrBuf\n\n\tif err := cmd.Start(); err != nil {\n\t\treturn fmt.Errorf(\"antigravitySession: start: %w\", err)\n\t}\n\n\tstarted = true\n\tas.wg.Add(1)\n\tgo func() {\n\t\tdefer cancel()\n\t\tas.readLoop(ctx, cmd, stdout, &stderrBuf, append(imageRefs, fileRefs...), preEntries, time.Now())\n\t}()\n\n\treturn nil\n}\n\nfunc (as *antigravitySession) buildAntigravityArgs(chatID string, isResume bool, mode, agyConfigDir, fullPrompt string) []string {\n\t// Prepend extra args from cmd so wrappers like \"timeout 3600 agy\" work.\n\t// Keep \"-p <prompt>\" at the very end because agy consumes the immediate next arg.\n\targs := append([]string{}, as.extraArgs...)\n\tif agyConfigDir != \"\" {\n\t\t// Antigravity currently names this compatibility flag --gemini_dir.","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/antigravity/session.go#L178-L214","documentation":"Send wraps errors from cmd.Start() when launching the agy binary for a turn. The command could not be started at all — the binary was not found, is not executable, or the working directory/env cannot be set up.","triggerScenarios":"cmd.Start() failing because the agy executable is missing from PATH (exec: \"agy\": executable file not found in $PATH), lacks execute permission, or its configured working directory does not exist.","commonSituations":"agy CLI not installed or not on the daemon's PATH (systemd/launchd have minimal PATH); agy upgraded/renamed; project working directory deleted while cc-connect runs; run-as-user permission issues.","solutions":["Verify the binary exists and is executable: which agy && test -x $(which agy).","Install/restore the agy CLI or fix the configured binary path in config.toml.","For daemon deployments, set the full path to agy in config or extend the service's PATH/Environment in the systemd unit.","Ensure the session's working directory exists and is accessible to the cc-connect user.","Check the wrapped cause (%w) for the exact exec error."],"exampleFix":"// config.toml\n// before\n[agents.antigravity]\n# binary found via PATH (empty in systemd)\n// after\n[agents.antigravity]\ncommand = \"/usr/local/bin/agy\"","handlingStrategy":"validation","validationCode":"bin := \"/usr/local/bin/agy\" // or from config\nif _, err := os.Stat(bin); err != nil || !isExecutable(bin) {\n    // agy missing/not executable — fail fast with install guidance\n}\nfunc isExecutable(p string) bool {\n    info, err := os.Stat(p)\n    return err == nil && !info.IsDir() && info.Mode()&0o111 != 0\n}","typeGuard":null,"tryCatchPattern":"if err := session.Send(...); err != nil && strings.Contains(err.Error(), \"antigravitySession: start:\") {\n    if strings.Contains(err.Error(), \"executable file not found\") {\n        // prompt user to install agy or fix the configured command path\n    }\n}","preventionTips":["Configure the absolute path to the agy binary instead of relying on PATH.","Remember systemd/launchd daemons have a minimal PATH — extend it in the unit file.","Pin the agy binary path in doctor checks (cc-connect doctor) at startup.","Ensure the session working directory exists before starting sessions."],"tags":["go","process","exec","antigravity","path"],"backgroundTag":"command-not-found","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}