{"record":{"id":"36626b47beefa08e","repo":"chenhg5/cc-connect","slug":"cloud-web-transport-does-not-support-preview-ack","errorCode":null,"errorMessage":"cloud_web: transport does not support preview_ack","messagePattern":"cloud_web: transport does not support preview_ack","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/cloud-web/cloudweb.go","lineNumber":572,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !p.hasCap(capPreview) || !p.hasCap(capUpdateMessage) {\n\t\treturn nil, core.ErrNotSupported\n\t}\n\trefID := fmt.Sprintf(\"prev-%d\", time.Now().UnixNano())\n\tif err := p.sendWire(ctx, map[string]any{\n\t\t\"type\":        \"preview_start\",\n\t\t\"ref_id\":      refID,\n\t\t\"session_key\": rc.SessionKey,\n\t\t\"reply_ctx\":   rc.ReplyCtx,\n\t\t\"content\":     content,\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\twaiter, ok := p.tp.(previewWaiter)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"cloud_web: transport does not support preview_ack\")\n\t}\n\thandle, err := waiter.waitPreviewAck(refID, 10*time.Second)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn replyContext{SessionKey: rc.SessionKey, ReplyCtx: handle}, nil\n}\n\nfunc (p *Platform) DeletePreviewMessage(ctx context.Context, previewHandle any) error {\n\trc, err := parseReplyCtx(previewHandle)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !p.hasCap(capDeleteMessage) {\n\t\treturn core.ErrNotSupported\n\t}\n\treturn p.sendWire(ctx, map[string]any{\n\t\t\"type\":           \"delete_message\",","sourceCodeStart":554,"sourceCodeEnd":590,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/cloud-web/cloudweb.go#L554-L590","documentation":"SendPreviewStart emits a preview message and waits for a preview_ack via the previewWaiter interface. The currently configured transport (poll, ws, or gateway) must implement that capability; if it does not, this error is returned instead of blocking forever waiting for an ack that will never come.","triggerScenarios":"Calling p.SendPreviewStart with the platform built on a transport that lacks preview_ack support (e.g. plain long_poll transport), so the p.tp.(previewWaiter) type assertion fails.","commonSituations":"Using a transport type that never implemented the preview protocol while an agent feature (streaming previews) assumes it; mixing configs where websocket supports previews but the deployment fell back to long_poll; calling SendPreviewStart directly in tests against a minimal transport.","solutions":["Switch the platform transport to one that supports preview_ack (e.g. websocket/gateway transport build)","Feature-detect before calling: check if p supports previews (capability check or interface assertion) and skip preview flow otherwise","Downgrade the agent's streaming/preview feature to plain message sends when the transport cannot ack","Update cloud-web to a version where your chosen transport implements previewWaiter"],"exampleFix":"// before\nhandle, err := p.SendPreviewStart(ctx, rc, content)\n\n// after\nwaiter, ok := p.Transport().(PreviewWaiter)\nif !ok {\n    return p.Send(ctx, rc, content) // plain fallback\n}\nhandle, err := p.SendPreviewStart(ctx, rc, content)","handlingStrategy":"type-guard","validationCode":"if _, ok := p.Transport().(PreviewWaiter); !ok {\n    return p.Send(ctx, rc, content) // fallback path\n}","typeGuard":"waiter, ok := p.Transport().(PreviewWaiter); if !ok { /* unsupported */ }","tryCatchPattern":"handle, err := p.SendPreviewStart(ctx, rc, content)\nif err != nil && strings.Contains(err.Error(), \"preview_ack\") {\n    return p.Send(ctx, rc, content)\n}","preventionTips":["Feature-detect transport capabilities before using preview APIs","Match the transport type to the agent features you enable","Pin transport choices in config per deployment and document supported capabilities"],"tags":["cloud-web","transport","capability","preview"],"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"}