plandex-ai/plandex · error

Error loading context: %s does not support images in context

Error message

Error loading context: %s does not support images in context

What it means

When an image is included in the context, the resolved model pack's Planner model must declare HasImageSupport. If the configured planner model can't accept images, the server rejects the load with HTTP 400 naming the model that lacks support.

Source

Thrown at app/server/handlers/context_helper.go:137

					authVars:    context.AuthVars,
					plan:        plan,
					settings:    settings,
				},
			)

			clients = res.clients
			authVars = res.authVars

			break
		}
	}

	// ensure image compatibility if we're loading an image
	for _, context := range *loadReq {
		if context.ContextType == shared.ContextImageType {
			if !settings.GetModelPack().Planner.GetSharedBaseConfig(settings).HasImageSupport {
				log.Printf("Error loading context: %s does not support images in context\n", settings.GetModelPack().Planner.ModelId)
				http.Error(w, fmt.Sprintf("Error loading context: %s does not support images in context", settings.GetModelPack().Planner.ModelId), http.StatusBadRequest)
				return nil, nil
			}
		}
	}

	// get name for piped data or notes if present
	num := 0
	errCh := make(chan error, len(*loadReq))
	for _, context := range *loadReq {
		if context.ContextType == shared.ContextPipedDataType {
			num++

			go func(context *shared.LoadContextParams) {
				defer func() {
					if r := recover(); r != nil {
						log.Printf("panic in GenPipedDataName: %v\n%s", r, debug.Stack())
						errCh <- fmt.Errorf("panic in GenPipedDataName: %v\n%s", r, debug.Stack())
						runtime.Goexit() // don't allow outer function to continue and double-send to channel

View on GitHub (pinned to e2d772072e)

Solutions

  1. Switch the plan (or org default) planner to a vision-capable model (e.g. gpt-4o)
  2. Remove the image from the load request, or describe the image in text instead
  3. If using a custom model pack, set HasImageSupport: true only if the model truly supports vision

Example fix

// before (custom model pack)
Planner: shared.ModelConfig{ModelId: "text-only-model"} // HasImageSupport defaults false
// after
Planner: shared.ModelConfig{ModelId: "gpt-4o", HasImageSupport: true}
Defensive patterns

Strategy: validation

Validate before calling

pack := settings.GetModelPack()
hasVision := pack.Planner.GetSharedBaseConfig(settings).HasImageSupport
for _, c := range loadReq {
    if c.ContextType == shared.ContextImageType && !hasVision {
        return fmt.Errorf("planner %s does not support images", pack.Planner.ModelId)
    }
}

Prevention

When it happens

Trigger: Loading a ContextImageType context while settings.GetModelPack().Planner's shared base config has HasImageSupport=false — e.g. a text-only planner model is set for the plan/org.

Common situations: Org switched to a vision-less model (older GPT-3.5-class, some local/OSS models); custom model pack misconfigured without HasImageSupport; stale settings after a model deprecation.

Related errors


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