{"record":{"id":"2b6d240119c48bab","repo":"chenhg5/cc-connect","slug":"create-permission-bridge-directory-w","errorCode":null,"errorMessage":"create permission bridge directory: %w","messagePattern":"create permission bridge directory: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/antigravity/permission_bridge.go","lineNumber":56,"sourceCode":"\taddress   string\n\ttoken     string\n\trootDir   string\n\tconfigDir string\n\tevents    chan<- core.Event\n\n\tnextID    atomic.Uint64\n\tpendingMu sync.Mutex\n\tpending   map[string]chan core.PermissionResult\n\tcloseOnce sync.Once\n\twg        sync.WaitGroup\n}\n\nfunc newAgyPermissionBridge(ctx context.Context, events chan<- core.Event) (*agyPermissionBridge, error) {\n\tbridgeCtx, cancel := context.WithCancel(ctx)\n\trootDir, err := os.MkdirTemp(\"\", \"cc-connect-agy-permission-\")\n\tif err != nil {\n\t\tcancel()\n\t\treturn nil, fmt.Errorf(\"create permission bridge directory: %w\", err)\n\t}\n\n\tconfigDir, err := createAgyConfigOverlay(rootDir)\n\tif err != nil {\n\t\tcancel()\n\t\t_ = os.RemoveAll(rootDir)\n\t\treturn nil, err\n\t}\n\n\tlistener, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\tcancel()\n\t\t_ = os.RemoveAll(rootDir)\n\t\treturn nil, fmt.Errorf(\"listen for Agy permission hooks: %w\", err)\n\t}\n\n\ttokenBytes := make([]byte, 32)\n\tif _, err := rand.Read(tokenBytes); err != nil {","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/antigravity/permission_bridge.go#L38-L74","documentation":"Wraps a failed os.MkdirTemp when creating the antigravity permission bridge's scratch root directory. The bridge needs this temp dir to stage hook configs that relay permission decisions; failure is an OS-level temp-space problem (no space, no /tmp write access, fd limits).","triggerScenarios":"Thrown at agent/antigravity/permission_bridge.go:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure TMPDIR points to a writable location with free space","Check disk space and inode availability","Reduce concurrent sessions spawning bridges simultaneously"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}