plandex-ai/plandex · error

failed to check context outdated: %v

Error message

failed to check context outdated: %v

What it means

Aggregate error returned by checkOutdatedAndMaybeUpdateContext when any per-context goroutine appended to errs: after wg.Wait(), all collected errors are joined into one 'failed to check context outdated' error. It means the staleness check did not fully complete; at least one context (file, tree, map, or URL) could not be refreshed.

Source

Thrown at app/cli/lib/context_update.go:920

					tokenDiffsById[ctx.Id] = numTokens - ctx.NumTokens

					numUrls++
					updatedContexts = append(updatedContexts, ctx)
					reqFns[ctx.Id] = func() (*shared.UpdateContextParams, error) {
						return &shared.UpdateContextParams{
							Body: string(body),
						}, nil
					}
				}
			}(context)
		}
	}

	wg.Wait()

	if len(errs) > 0 {
		return nil, fmt.Errorf("failed to check context outdated: %v", errs)
	}

	// Identify contexts to remove
	var removedContexts []*shared.Context
	for id := range deleteIds {
		removedContexts = append(removedContexts, contextsById[id])
	}

	// If nothing changed
	if len(reqFns) == 0 && len(removedContexts) == 0 {
		return &types.ContextOutdatedResult{
			Msg: "Context is up to date",
		}, nil
	}

	reqFn := func() (map[string]*shared.UpdateContextParams, error) {
		req := map[string]*shared.UpdateContextParams{}
		var mu sync.Mutex

View on GitHub (pinned to e2d772072e)

Solutions

  1. Read the embedded %v list — it names each failing context and the underlying cause; fix each individually (see the specific errors).
  2. Re-run the refresh after fixing; partial results are not applied when errs is non-empty.
  3. Remove problem contexts (stale paths, dead URLs) so the batch can complete.
  4. Run with correct permissions on the project directory to eliminate wholesale stat/read failures.

Example fix

// before
errs: [failed to fetch the URL http://dead.example: dial tcp: no such host]
// after
# remove the dead URL context, then re-run
<cli> context remove <url-context-id>
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight: verify each context target before batch refresh
for _, c := range contexts {
    switch c.ContextType {
    case "file": checkStat(c.FilePath)
    case "url": checkHTTPHead(c.Url)
    }
}

Try / catch

result, err := CheckOutdatedContext(ctx)
if err != nil {
    var agg []error
    fmt.Sscanf(err.Error(), "failed to check context outdated: %v", &agg)
    for _, e := range agg {
        log.Printf("context refresh sub-failure: %v", e) // fix each, then retry
    }
}

Prevention

When it happens

Trigger: Any goroutine in the parallel refresh appends to errs (any of errors 170–178); the first collected error is formatted into this aggregate by CheckOutdatedContext.

Common situations: Mixed failure batches: a deleted file raced the scan plus an unreachable URL; running on a checkout with permission problems; transient network outage during a refresh that includes URL contexts.

Related errors


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