{"record":{"id":"45f60ba808cf94b0","repo":"chenhg5/cc-connect","slug":"acp-unknown-permission-request-q","errorCode":null,"errorMessage":"acp: unknown permission request %q","messagePattern":"acp: unknown permission request %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/acp/session.go","lineNumber":682,"sourceCode":"\tif prompt == \"\" {\n\t\tprompt = \"User sent image(s).\"\n\t}\n\treturn prompt + \"\\n\\n(Image files saved locally: \" + strings.Join(paths, \", \") + \")\"\n}\n\nfunc (s *acpSession) RespondPermission(requestID string, result core.PermissionResult) error {\n\tif !s.alive.Load() {\n\t\treturn fmt.Errorf(\"acp: session closed\")\n\t}\n\n\ts.permMu.Lock()\n\tst, ok := s.permByID[requestID]\n\tif ok {\n\t\tdelete(s.permByID, requestID)\n\t}\n\ts.permMu.Unlock()\n\tif !ok {\n\t\treturn fmt.Errorf(\"acp: unknown permission request %q\", requestID)\n\t}\n\n\tallow := strings.EqualFold(result.Behavior, \"allow\")\n\toptID := pickPermissionOptionID(allow, st.Options)\n\tif allow && optID == \"\" {\n\t\tslog.Warn(\"acp: allow requested but agent sent no options\", \"request_id\", requestID)\n\t\treturn s.tr.respondError(st.RPCID, -32603, \"no permission options from agent\")\n\t}\n\tres := buildPermissionResult(allow, optID)\n\n\tslog.Debug(\"acp: permission response\", \"request_id\", requestID, \"allow\", allow, \"option_id\", optID)\n\treturn s.tr.respondSuccess(st.RPCID, res)\n}\n\nfunc (s *acpSession) Events() <-chan core.Event {\n\treturn s.events\n}\n","sourceCodeStart":664,"sourceCodeEnd":700,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/acp/session.go#L664-L700","documentation":"A sentinel guard in acpSession.RespondPermission: the requestID does not exist in the permByID tracking map (either never seen or already answered and deleted). It fires when a permission response arrives twice for the same request, arrives after the session forgot it, or uses a stale/wrong ID.","triggerScenarios":"Thrown at agent/acp/session.go:682 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Avoid sending duplicate responses for the same permission card/button","Discard stale permission prompts from older sessions instead of answering them","Restart the turn to obtain a fresh permission request if one is genuinely pending"],"exampleFix":null,"handlingStrategy":"validation","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"}