plandex-ai/plandex · error

error getting default config: %v

Error message

error getting default config: %v

What it means

This error wraps a failure from api.Client.GetDefaultPlanConfig(), a network call that fetches the default plan configuration from the server. The CLI runs this in a goroutine and funnels any API error (apiErr.Msg) into errCh as this formatted error. It means the server rejected or could not serve the default plan config request.

Source

Thrown at app/cli/cmd/models.go:117

	var defaultConfig *shared.PlanConfig

	errCh := make(chan error, 2)

	go func() {
		var err error
		serverModelsInput, err = lib.GetServerModelsInput()
		if err != nil {
			errCh <- fmt.Errorf("error getting server models input: %v", err)
			return
		}
		errCh <- nil
	}()

	go func() {
		var apiErr *shared.ApiError
		defaultConfig, apiErr = api.Client.GetDefaultPlanConfig()
		if apiErr != nil {
			errCh <- fmt.Errorf("error getting default config: %v", apiErr.Msg)
			return
		}
		errCh <- nil
	}()

	for i := 0; i < 2; i++ {
		err := <-errCh
		if err != nil {
			term.OutputErrorAndExit(err.Error())
			return
		}
	}

	usingDefaultPath := false
	if customModelsPath == "" {
		usingDefaultPath = true
		customModelsPath = lib.GetCustomModelsPath(auth.Current.UserId)
	}

View on GitHub (pinned to e2d772072e)

Solutions

  1. Check authentication (run the login/auth command) and retry
  2. Verify the API server is reachable (curl the endpoint / check status page)
  3. Update the CLI — the endpoint contract may have changed
  4. Inspect apiErr.Msg in the output for the server-side cause

Example fix

// before
if apiErr != nil {
    errCh <- fmt.Errorf("error getting default config: %v", apiErr.Msg)
    return
}
// after
if apiErr != nil {
    if apiErr.StatusCode == 401 {
        errCh <- fmt.Errorf("not authenticated; run 'auth login' first")
    } else {
        errCh <- fmt.Errorf("error getting default config: %v", apiErr.Msg)
    }
    return
}
Defensive patterns

Strategy: try-catch

Validate before calling

if auth.Current.UserId == "" || authToken == "" {
    return fmt.Errorf("not authenticated; run 'auth login' first")
}

Type guard

var apiErr *shared.ApiError
_, apiErr = api.Client.GetDefaultPlanConfig()
if apiErr != nil {
    // handle
}

Try / catch

defaultConfig, apiErr := api.Client.GetDefaultPlanConfig()
if apiErr != nil {
    switch apiErr.StatusCode {
    case 401: reAuth(); case 500: retryWithBackoff(); default: return apiErr
    }
}

Prevention

When it happens

Trigger: GetDefaultPlanConfig returns a non-nil *shared.ApiError — e.g. unauthenticated session, server 4xx/5xx response, or network failure during 'models' command startup.

Common situations: Expired or missing auth token, API server down or unreachable, backend changed the default-config endpoint, corporate proxy blocking the request.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


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