plandex-ai/plandex · error

client not found for provider composite: %s

Error message

client not found for provider composite: %s

What it means

CreateChatCompletionWithInternalStream: the resolved providerComposite key is absent from the clients map, so no configured client exists for the model role's provider. Means missing API key/env var or an unsupported/unconfigured provider for this org.

Source

Thrown at app/server/model/client_stream.go:35

type OnStreamFn func(chunk string, buffer string) (shouldStop bool)

func CreateChatCompletionWithInternalStream(
	clients map[string]ClientInfo,
	authVars map[string]string,
	modelConfig *shared.ModelRoleConfig,
	settings *shared.PlanSettings,
	orgUserConfig *shared.OrgUserConfig,
	currentOrgId string,
	currentUserId string,
	ctx context.Context,
	req types.ExtendedChatCompletionRequest,
	onStream OnStreamFn,
	reqStarted time.Time,
) (*types.ModelResponse, error) {
	providerComposite := modelConfig.GetProviderComposite(authVars, settings, orgUserConfig)
	_, ok := clients[providerComposite]
	if !ok {
		return nil, fmt.Errorf("client not found for provider composite: %s", providerComposite)
	}

	baseModelConfig := modelConfig.GetBaseModelConfig(authVars, settings, orgUserConfig)

	resolveReq(&req, modelConfig, baseModelConfig, settings)

	// choose the fastest provider by latency/throughput on openrouter
	if baseModelConfig.Provider == shared.ModelProviderOpenRouter {
		req.Model += ":nitro"
	}

	// Force streaming mode since we're using the streaming API
	req.Stream = true

	// Include usage in stream response
	req.StreamOptions = &openai.StreamOptions{
		IncludeUsage: true,
	}

View on GitHub (pinned to e2d772072e)

Solutions

  1. Verify the provider's API key env var is set (authVars)
  2. Check plan/org model settings select a provider with a configured client
  3. Ensure custom providers were synced for this org
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at app/server/model/client_stream.go:35 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/2af1733a61a1c382. Report an issue: GitHub.