{"record":{"id":"a6adfa63f26659e3","repo":"router-for-me/CLIProxyAPI","slug":"host-model-execute-stream-requires-stream-true","errorCode":null,"errorMessage":"host.model.execute_stream requires stream=true","messagePattern":"host\\.model\\.execute_stream requires stream=true","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pluginhost/host_model_stream_callbacks.go","lineNumber":17,"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()\n\t\treturn nil, modelExecutionError(errMsg)\n\t}\n\tstreamID := \"\"","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginhost/host_model_stream_callbacks.go#L1-L35","documentation":"Error \"host.model.execute_stream requires stream=true\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/pluginhost/host_model_stream_callbacks.go:17 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set stream=true in the model request when calling host.model.execute_stream.","Use the non-stream host.model.execute endpoint for non-streaming requests."],"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"}