{"record":{"id":"cc16a0401e3988b4","repo":"router-for-me/CLIProxyAPI","slug":"host-model-stream-bridge-is-unavailable","errorCode":null,"errorMessage":"host model stream bridge is unavailable","messagePattern":"host model stream bridge is unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pluginhost/host_model_stream_callbacks.go","lineNumber":41,"sourceCode":"\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 == \"\" {\n\t\tcancel()\n\t\treturn nil, fmt.Errorf(\"host model stream bridge is unavailable\")\n\t}\n\tif req.HostCallbackID != \"\" {\n\t\th.addCallbackCleanup(req.HostCallbackID, func() {\n\t\t\th.modelStreams.close(streamID)\n\t\t})\n\t}\n\treturn marshalRPCResult(pluginapi.HostModelStreamResponse{\n\t\tStatusCode: stream.StatusCode,\n\t\tHeaders:    cloneHeader(stream.Headers),\n\t\tStreamID:   streamID,\n\t})\n}\n\nfunc (h *Host) callHostModelStreamRead(ctx context.Context, request []byte) ([]byte, error) {\n\tvar req pluginapi.HostModelStreamReadRequest\n\tif errUnmarshal := json.Unmarshal(request, &req); errUnmarshal != nil {\n\t\treturn nil, fmt.Errorf(\"decode host model stream read request: %w\", errUnmarshal)\n\t}","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginhost/host_model_stream_callbacks.go#L23-L59","documentation":"Error \"host model stream bridge is unavailable\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/pluginhost/host_model_stream_callbacks.go:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the model stream bridge is registered before plugins request streams.","Check plugin host initialization for the stream bridge setup."],"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"}