{"record":{"id":"1f41c8f478a6449c","repo":"chenhg5/cc-connect","slug":"bridge-adapter-q-not-connected","errorCode":null,"errorMessage":"bridge: adapter %q not connected","messagePattern":"bridge: adapter %q not connected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/bridge.go","lineNumber":355,"sourceCode":"\t\t\"session_key\": rc.SessionKey,\n\t\t\"reply_ctx\":   rc.ReplyCtx,\n\t\t\"content\":     content,\n\t\t\"format\":      \"text\",\n\t})\n}\n\nfunc (bp *BridgePlatform) Send(ctx context.Context, replyCtx any, content string) error {\n\treturn bp.Reply(ctx, replyCtx, content)\n}\n\nfunc (bp *BridgePlatform) ReconstructReplyCtx(sessionKey string) (any, error) {\n\tplatform := bp.server.platformFromSessionKey(sessionKey)\n\tif platform == \"\" {\n\t\treturn nil, fmt.Errorf(\"bridge: cannot determine adapter from session key %q\", sessionKey)\n\t}\n\ta := bp.server.getAdapter(platform)\n\tif a == nil {\n\t\treturn nil, fmt.Errorf(\"bridge: adapter %q not connected\", platform)\n\t}\n\tif !a.capabilities[\"reconstruct_reply\"] {\n\t\treturn nil, fmt.Errorf(\"bridge: adapter %q does not support reconstruct_reply\", platform)\n\t}\n\treplyCtx, err := buildBridgeReconstructReplyCtx(bp.project, sessionKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newBridgeReplyCtx(a, sessionKey, replyCtx), nil\n}\n\nfunc newBridgeReplyCtx(a *bridgeAdapter, sessionKey, replyCtx string) *bridgeReplyCtx {\n\trc := &bridgeReplyCtx{\n\t\tSessionKey: sessionKey,\n\t\tReplyCtx:   replyCtx,\n\t}\n\tif a == nil {\n\t\treturn rc","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/bridge.go#L337-L373","documentation":"During ReconstructReplyCtx, the session key resolved to a platform adapter name, but server.getAdapter(platform) returned nil — no adapter with that name is currently connected to the bridge server. The bridge refuses to build a reply context pointing at a disconnected adapter.","triggerScenarios":"Calling ReconstructReplyCtx after the downstream platform adapter disconnected or was never started; typo'd/renamed adapter in config; bridge server started before the adapter registered.","commonSituations":"Replying to an old conversation after restarting cc-connect with a platform plugin excluded via build tags (e.g. no_feishu) or removed from config.toml; temporary network disconnect that dropped the adapter.","solutions":["Check that the adapter named in the session key is present in config.toml and not excluded by build tags; restart the bridge.","Verify adapter connectivity (cc-connect doctor / platform logs) and reconnect before replying.","Handle the error in the caller by notifying the user the destination is offline instead of retrying blindly."],"exampleFix":"// before\nreplyCtx, _ := bp.ReconstructReplyCtx(sessionKey) // adapter may be down\nbp.Reply(ctx, replyCtx, msg)\n\n// after\nreplyCtx, err := bp.ReconstructReplyCtx(sessionKey)\nif err != nil {\n    slog.Warn(\"bridge: adapter unavailable\", \"key\", sessionKey, \"err\", err)\n    return err\n}\nbp.Reply(ctx, replyCtx, msg)","handlingStrategy":"fallback","validationCode":"if bp.server.getAdapter(platformFromKey(key)) == nil {\n    return errors.New(\"destination adapter offline; aborting reply\")\n}","typeGuard":null,"tryCatchPattern":"rc, err := bp.ReconstructReplyCtx(key)\nif err != nil && strings.Contains(err.Error(), \"not connected\") {\n    slog.Warn(\"adapter down, deferring reply\", \"key\", key)\n    return queueForLater(key)\n}","preventionTips":["Run cc-connect doctor to confirm all configured adapters are connected before processing backlogs.","Avoid excluding adapters via build tags that your stored session keys depend on.","Monitor adapter disconnects and re-queue outbound messages."],"tags":["go","adapter","connectivity"],"backgroundTag":"resource-not-found","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}