{"record":{"id":"5d04c5fd291e9aa3","repo":"router-for-me/CLIProxyAPI","slug":"decode-host-model-stream-close-request-w","errorCode":null,"errorMessage":"decode host model stream close request: %w","messagePattern":"decode host model stream close request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pluginhost/host_model_stream_callbacks.go","lineNumber":81,"sourceCode":"\tchunk, done, errRead := h.modelStreams.read(ctx, req.StreamID)\n\tif errRead != nil {\n\t\treturn nil, errRead\n\t}\n\tresp := pluginapi.HostModelStreamReadResponse{\n\t\tPayload: append([]byte(nil), chunk.Payload...),\n\t\tDone:    done,\n\t}\n\tif chunk.Err != nil {\n\t\tresp.Error = chunk.Err.Error()\n\t\tresp.Done = true\n\t}\n\treturn marshalRPCResult(resp)\n}\n\nfunc (h *Host) callHostModelStreamClose(request []byte) ([]byte, error) {\n\tvar req pluginapi.HostModelStreamCloseRequest\n\tif errUnmarshal := json.Unmarshal(request, &req); errUnmarshal != nil {\n\t\treturn nil, fmt.Errorf(\"decode host model stream close request: %w\", errUnmarshal)\n\t}\n\tif h != nil && h.modelStreams != nil {\n\t\th.modelStreams.close(req.StreamID)\n\t}\n\treturn marshalRPCResult(rpcEmptyResponse{})\n}\n","sourceCodeStart":63,"sourceCodeEnd":88,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginhost/host_model_stream_callbacks.go#L63-L88","documentation":"Error \"decode host model stream close request: %w\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/pluginhost/host_model_stream_callbacks.go:81 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send a valid JSON stream close request with the correct stream id.","Fix the payload per the wrapped decode error."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}