{"record":{"id":"ba1bd6938c0d9e79","repo":"chenhg5/cc-connect","slug":"antigravity-permission-responses-are-only-availab","errorCode":null,"errorMessage":"antigravity: permission responses are only available in default mode","messagePattern":"antigravity: permission responses are only available in default mode","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agent/antigravity/session.go","lineNumber":393,"sourceCode":"\t}\n\tif len(candidates) == 0 {\n\t\treturn \"\"\n\t}\n\tsort.Slice(candidates, func(i, j int) bool {\n\t\tif candidates[i].diff == candidates[j].diff {\n\t\t\treturn candidates[i].modTime.After(candidates[j].modTime)\n\t\t}\n\t\treturn candidates[i].diff < candidates[j].diff\n\t})\n\treturn candidates[0].sessionID\n}\n\nfunc (as *antigravitySession) RespondPermission(requestID string, result core.PermissionResult) error {\n\tif !as.alive.Load() {\n\t\treturn fmt.Errorf(\"session is closed\")\n\t}\n\tif as.permissionBridge == nil {\n\t\treturn fmt.Errorf(\"antigravity: permission responses are only available in default mode\")\n\t}\n\treturn as.permissionBridge.RespondPermission(requestID, result)\n}\n\nfunc (as *antigravitySession) Events() <-chan core.Event {\n\treturn as.events\n}\n\nfunc (as *antigravitySession) CurrentSessionID() string {\n\tv, _ := as.chatID.Load().(string)\n\treturn v\n}\n\nfunc (as *antigravitySession) Alive() bool {\n\treturn as.alive.Load()\n}\n\nfunc (as *antigravitySession) Close() error {","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/antigravity/session.go#L375-L411","documentation":"RespondPermission returns this error when the session was created without a permission bridge — i.e. not in default (interactive permission) mode. In 'yolo' (permissions skipped) or 'plan' (sandbox) modes there is no TCP bridge wired up, so permission decisions have nothing to be relayed to.","triggerScenarios":"Calling RespondPermission on a session whose permissionBridge field is nil, which happens when the agent was configured with mode=\"yolo\" or mode=\"plan\" instead of default mode.","commonSituations":"Config sets mode=\"yolo\" to skip prompts, but platform UI still renders permission buttons that call RespondPermission; code assumes all antigravity sessions support interactive permissions.","solutions":["Switch the agent mode to default in config.toml so the permission bridge is created","Suppress/hide permission-request UI for yolo/plan mode sessions before calling RespondPermission","Gate the call: only invoke RespondPermission if the session advertises permission support"],"exampleFix":"// before\nreturn as.RespondPermission(requestID, result)\n// after\nif agentMode == \"yolo\" || agentMode == \"plan\" {\n    return errors.New(\"permissions not available in this mode\")\n}\nreturn as.RespondPermission(requestID, result)","handlingStrategy":"validation","validationCode":"func permissionsSupported(mode string) bool { return mode == \"\" || mode == \"default\" }\nif !permissionsSupported(cfg.Mode) { hidePermissionUI() }","typeGuard":null,"tryCatchPattern":"if err := s.RespondPermission(id, res); err != nil && strings.Contains(err.Error(), \"only available in default mode\") {\n    log.Warn(\"auto-denying: mode has no permission bridge\")\n}","preventionTips":["Only render permission UI for default-mode antigravity sessions","Document that yolo/plan modes cannot answer permission requests","Centralize mode checks where permission events are handled"],"tags":["permissions","config","unsupported-operation"],"backgroundTag":"unsupported-operation","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"}