plandex-ai/plandex · error
error getting server models input: %v
Error message
error getting server models input: %v
What it means
SyncCustomModels fetches the server's view of custom models, providers, and model packs via GetServerModelsInput, which fans out three concurrent API calls (ListCustomModels, ListCustomProviders, ListModelPacks). This error wraps the first API failure returned, so it indicates a server/network problem, not a local file problem.
Source
Thrown at app/cli/lib/custom_models.go:338
return false
}
fmt.Print(added.String())
fmt.Print(updated.String())
fmt.Print(deleted.String())
return true
}
func SyncCustomModels() error {
userId := auth.Current.UserId
if userId == "" {
return fmt.Errorf("auth.Current.UserId is empty")
}
serverModelsInput, err := GetServerModelsInput()
if err != nil {
return fmt.Errorf("error getting server models input: %v", err)
}
MustSyncCustomModels(GetCustomModelsPath(userId), serverModelsInput)
return nil
}
View on GitHub (pinned to e2d772072e)
Solutions
- Check the wrapped %v error (err.Msg from the ApiError) for the specific API failure (auth vs network vs server).
- Verify connectivity to the Plandex server and that the server is running/reachable.
- Re-authenticate if the error indicates 401/403 (expired session), then retry.
- Retry the sync after confirming the server version matches the CLI (upgrade server or CLI if endpoints are missing).
Example fix
// before plandex models # 'error getting server models input: unauthorized' // after plandex auth # refresh expired session plandex models
Defensive patterns
Strategy: retry
Validate before calling
// Light pre-check: server reachability and auth before sync
if auth.Current == nil || auth.Current.UserId == "" {
return fmt.Errorf("not logged in")
}
// optionally ping the server host before calling SyncCustomModels Type guard
func isServerError(err error) bool {
return err != nil && strings.Contains(err.Error(), "error getting server models input")
} Try / catch
if err := lib.SyncCustomModels(); err != nil {
if isServerError(err) {
term.Error("Could not reach server or API rejected the request; check " +
"connectivity/auth: " + err.Error())
return
}
return err
} Prevention
- Verify server URL and connectivity before running sync operations.
- Refresh auth when errors mention unauthorized/forbidden.
- Keep server and CLI versions compatible so all three list endpoints exist.
- Add bounded retry with backoff for transient network failures in automation.
When it happens
Trigger: GetServerModelsInput returning an error because any of the three API calls fails — server unreachable, 401/403 due to expired session, server error response, or (non-cloud only) ListCustomProviders failing.
Common situations: Server under maintenance or down; VPN/network outage; auth token expired causing API rejection; Plandex server version too old to expose one of the list endpoints.
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
- error listing contexts: %v
- error getting context body: %v
- error fetching users: %s
- error fetching pending invites: %s
- error getting custom model packs: %v
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/04f67ef9aa03bf7a.
Report an issue: GitHub.