{"record":{"id":"45b884f65a2c0a3d","repo":"chenhg5/cc-connect","slug":"bridge-adapter-q-does-not-support-reconstruct-re","errorCode":null,"errorMessage":"bridge: adapter %q does not support reconstruct_reply","messagePattern":"bridge: adapter %q does not support reconstruct_reply","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/bridge.go","lineNumber":358,"sourceCode":"\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\n\t}\n\trc.Platform = a.platform\n\trc.progressStyle = bridgeProgressStyleForAdapter(a)","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/bridge.go#L340-L376","documentation":"ReconstructReplyCtx requires the target adapter to declare the 'reconstruct_reply' capability. The adapter is connected, but its capability set lacks this flag, so the bridge cannot rebuild an opaque reply context for it and returns this error.","triggerScenarios":"Calling ReconstructReplyCtx against an adapter whose capabilities map has no 'reconstruct_reply' entry — typically a simpler/newer adapter implementation that doesn't support context reconstruction.","commonSituations":"Custom or third-party bridge adapters written without reconstruct_reply support; version skew where the client-side adapter is older than the bridge server expecting the capability.","solutions":["Upgrade or patch the adapter implementation to advertise capabilities[\"reconstruct_reply\"] = true and implement the reconstruction protocol.","Use a different mechanism for replies with this adapter (e.g. store the original live replyCtx instead of reconstructing).","Feature-detect before calling: check the adapter's capabilities yourself and fall back to a plain send."],"exampleFix":"// before\nreplyCtx, err := bp.ReconstructReplyCtx(sessionKey) // panics into error for simple adapters\n\n// after\nif !adapterSupportsReconstruct(sessionKey) {\n    return fmt.Errorf(\"destination does not support context reconstruction\")\n}\nreplyCtx, err := bp.ReconstructReplyCtx(sessionKey)","handlingStrategy":"validation","validationCode":"func adapterSupportsReconstruct(a *bridgeAdapter) bool { return a.capabilities[\"reconstruct_reply\"] }","typeGuard":null,"tryCatchPattern":"rc, err := bp.ReconstructReplyCtx(key)\nif err != nil && strings.Contains(err.Error(), \"reconstruct_reply\") {\n    return errors.New(\"destination does not support context reconstruction; use live reply instead\")\n}","preventionTips":["Check adapter capability matrices before relying on reconstruct-based replies.","Keep bridge client adapters and server on compatible versions.","Implement the reconstruct_reply capability in custom adapters you maintain."],"tags":["go","capability","adapter"],"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"}