{"record":{"id":"e496e6be09f67333","repo":"router-for-me/CLIProxyAPI","slug":"host-model-executor-is-unavailable-e496e6","errorCode":null,"errorMessage":"host model executor is unavailable","messagePattern":"host model executor is unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pluginhost/host_model_stream_callbacks.go","lineNumber":21,"sourceCode":"import (\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 := \"\"\n\tif h.modelStreams != nil {\n\t\tstreamID = h.modelStreams.open(req.HostCallbackID, stream.Chunks, cancel)\n\t}\n\tif streamID == \"\" {","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginhost/host_model_stream_callbacks.go#L3-L39","documentation":"Error \"host model executor is unavailable\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/pluginhost/host_model_stream_callbacks.go:21 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the host model executor is initialized before plugin stream calls.","Check server startup order for the model executor wiring."],"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"}