router-for-me/CLIProxyAPI · error

http stream %s is not open

Error message

http stream %s is not open

What it means

Error "http stream %s is not open" thrown in router-for-me/CLIProxyAPI.

Source

Thrown at internal/pluginhost/http_stream_bridge.go:50

		}
		return ""
	}
	id := strconv.FormatUint(b.next.Add(1), 10)
	b.mu.Lock()
	b.streams[id] = hostHTTPStreamEntry{chunks: chunks, cancel: cancel}
	b.mu.Unlock()
	return id
}

func (b *hostHTTPStreamBridge) read(ctx context.Context, id string) (pluginapi.HTTPStreamChunk, bool, error) {
	if b == nil || id == "" {
		return pluginapi.HTTPStreamChunk{}, true, fmt.Errorf("http stream id is required")
	}
	b.mu.Lock()
	entry := b.streams[id]
	b.mu.Unlock()
	if entry.chunks == nil {
		return pluginapi.HTTPStreamChunk{}, true, fmt.Errorf("http stream %s is not open", id)
	}
	if ctx == nil {
		ctx = context.Background()
	}
	select {
	case <-ctx.Done():
		b.close(id)
		return pluginapi.HTTPStreamChunk{}, true, ctx.Err()
	case chunk, ok := <-entry.chunks:
		if !ok {
			b.close(id)
			return pluginapi.HTTPStreamChunk{}, true, nil
		}
		if chunk.Err != nil {
			b.close(id)
			return chunk, true, nil
		}
		return chunk, false, nil

View on GitHub (pinned to 78f0c4079e)

Solutions

  1. Open the HTTP stream before reading or closing it.
  2. Check for premature close or an incorrect stream id.

When it happens

Trigger: Thrown at internal/pluginhost/http_stream_bridge.go:50 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of router-for-me/CLIProxyAPI@78f0c4079e (2026-08-15). Data as JSON: /api/errors/ce662a0beb07eb01. Report an issue: GitHub.