{"record":{"id":"cc1bdc8f2a0f88e4","repo":"chenhg5/cc-connect","slug":"platform-q-does-not-support-reconstructreplyctx","errorCode":null,"errorMessage":"platform %q does not support ReconstructReplyCtx","messagePattern":"platform %q does not support ReconstructReplyCtx","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/engine.go","lineNumber":287,"sourceCode":"func (e *Engine) clearPendingRestart(req *RestartRequest) {\n\te.pendingRestartMu.Lock()\n\tif e.pendingRestartNotify == req {\n\t\te.pendingRestartNotify = nil\n\t}\n\te.pendingRestartMu.Unlock()\n}\n\n// dispatchRestartNotify sends the notify to the target platform with up\n// to 3 attempts (initial + 2 retries) on transient failure. The\n// platform must already be ready when this is called.\nfunc (e *Engine) dispatchRestartNotify(req *RestartRequest) error {\n\tp := e.lookupReadyPlatform(req.Platform)\n\tif p == nil {\n\t\treturn fmt.Errorf(\"platform %q not ready\", req.Platform)\n\t}\n\trc, ok := p.(ReplyContextReconstructor)\n\tif !ok {\n\t\treturn fmt.Errorf(\"platform %q does not support ReconstructReplyCtx\", req.Platform)\n\t}\n\trctx, err := rc.ReconstructReplyCtx(req.SessionKey)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reconstruct reply ctx: %w\", err)\n\t}\n\ttext := e.i18n.T(MsgRestartSuccess)\n\tif CurrentVersion != \"\" {\n\t\ttext += fmt.Sprintf(\" (%s)\", CurrentVersion)\n\t}\n\n\tbackoffs := []time.Duration{0, 500 * time.Millisecond, 1500 * time.Millisecond}\n\tvar lastErr error\n\tfor attempt, wait := range backoffs {\n\t\tif wait > 0 {\n\t\t\ttime.Sleep(wait)\n\t\t}\n\t\tif err := e.waitOutgoing(p); err != nil {\n\t\t\tlastErr = fmt.Errorf(\"wait outgoing: %w\", err)","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/engine.go#L269-L305","documentation":"dispatchRestartNotify requires the target platform to implement ReplyContextReconstructor so the original reply context (thread/topic targeting) can be rebuilt; platforms lacking this capability are rejected with 'platform %q does not support ReconstructReplyCtx'. Delivery cannot preserve reply threading without it.","triggerScenarios":"A pending RestartRequest targets a platform adapter that never implemented ReplyContextReconstruct / ReconstructReplyCtx — e.g. an older or minimal platform plugin compiled into the daemon.","commonSituations":"Restart requests issued on a platform (or custom plugin build) that lacks reply-context reconstruction support; version skew where the queued request predates adding the capability to that adapter.","solutions":["Upgrade the platform adapter (or cc-connect build) to one implementing ReplyContextReconstructor","Fall back to a plain Send without reconstructed reply context for platforms lacking the capability","Drop/requeue the pending RestartRequest targeting an incapable platform with a user-facing notice"],"exampleFix":"// before\n// platform without the capability\nfunc (p *Platform) Reply(ctx, ref, text) error { ... } // no ReconstructReplyCtx\n// after\nfunc (p *Platform) ReconstructReplyCtx(sessionKey string) (core.ReplyCtx, error) {\n    return p.store.ReplyCtxFor(sessionKey)\n}","handlingStrategy":"fallback","validationCode":"rc, ok := p.(core.ReplyContextReconstructor)\nif !ok { /* use plain Send fallback */ }","typeGuard":"rc, ok := p.(core.ReplyContextReconstructor)","tryCatchPattern":"if err := e.dispatchRestartNotify(req); err != nil {\n    if strings.Contains(err.Error(), \"does not support ReconstructReplyCtx\") {\n        return e.fallbackPlainNotify(req) // send without reply context\n    }\n    return err\n}","preventionTips":["Prefer platform adapters implementing ReplyContextReconstructor for restart flows","Capability-check the platform before enqueueing a restart notify","Keep adapters current with core interface additions"],"tags":["go","platform","capability","interface"],"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"}