{"record":{"id":"d16fe4a68240b374","repo":"router-for-me/CLIProxyAPI","slug":"decode-host-model-execution-stream-request-w","errorCode":null,"errorMessage":"decode host model execution stream request: %w","messagePattern":"decode host model execution stream request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pluginhost/host_model_stream_callbacks.go","lineNumber":14,"sourceCode":"package pluginhost\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/router-for-me/CLIProxyAPI/v7/sdk/pluginapi\"\n)\n\nfunc (h *Host) callHostModelExecuteStream(ctx context.Context, request []byte) ([]byte, error) {\n\tvar req rpcHostModelExecutionRequest\n\tif errUnmarshal := json.Unmarshal(request, &req); errUnmarshal != nil {\n\t\treturn nil, fmt.Errorf(\"decode host model execution stream request: %w\", errUnmarshal)\n\t}\n\tif !req.Stream {\n\t\treturn nil, fmt.Errorf(\"host.model.execute_stream requires stream=true\")\n\t}\n\texecutor := h.currentModelExecutor()\n\tif executor == nil {\n\t\treturn nil, fmt.Errorf(\"host model executor is unavailable\")\n\t}\n\tskipPluginID := h.callbackCallerPluginID(ctx, req.HostCallbackID)\n\tcallbackCtx := h.resolveCallbackContext(req.HostCallbackID, ctx)\n\tif callbackCtx == nil {\n\t\tcallbackCtx = context.Background()\n\t}\n\t// Detach request cancellation while preserving callback values; callback cleanup owns the model stream lifetime.\n\tstreamCtx, cancel := context.WithCancel(context.WithoutCancel(callbackCtx))\n\tstream, errMsg := executor.ExecuteModelStream(streamCtx, modelExecutionRequestFromPlugin(req.HostModelExecutionRequest, skipPluginID))\n\tif errMsg != nil {\n\t\tcancel()","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginhost/host_model_stream_callbacks.go#L1-L32","documentation":"Error \"decode host model execution stream request: %w\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/pluginhost/host_model_stream_callbacks.go:14 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send a valid JSON host model execution stream request.","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-15T22:17:37.221Z"}