plandex-ai/plandex · error

no update request function provided

Error message

no update request function provided

What it means

After the user confirms updating outdated context, CheckOutdatedContextWithOutput expects the ContextOutdatedResult to carry a ReqFn closure that builds the update request. If the result has outdated items but a nil ReqFn, this error is thrown. It is an internal invariant violation: the outdated-check produced findings without a way to construct the corresponding API request.

Source

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

			tableString := tableForContextOutdated(outdatedRes.RemovedContexts, outdatedRes.TokenDiffsById)
			fmt.Println(tableString)
		}
	}

	confirmed := autoConfirm

	if !autoConfirm {
		confirmed, err = term.ConfirmYesNo("Update context now?")

		if err != nil {
			term.OutputErrorAndExit("failed to get user input: %s", err)
		}
	}

	if confirmed {
		reqFn := outdatedRes.ReqFn
		if reqFn == nil {
			return false, false, fmt.Errorf("no update request function provided")
		}
		_, err = UpdateContextWithOutput(UpdateContextParams{
			Contexts:    contexts,
			OutdatedRes: *outdatedRes,
			ReqFn:       reqFn,
		})
		if err != nil {
			return false, false, fmt.Errorf("error updating context: %v", err)
		}
		return true, true, nil
	} else {
		return true, false, nil
	}

}

type UpdateContextParams struct {
	Contexts    []*shared.Context

View on GitHub (pinned to e2d772072e)

Solutions

  1. Upgrade plandex-cli and plandex-shared to matching versions (go get -u plandex-shared && go mod tidy)
  2. If constructing ContextOutdatedResult yourself (tests), always set ReqFn to a valid func() (map[string]*shared.UpdateContextParams, error)
  3. Reproduce with a clean checkout; if it persists, report a bug with the context types involved

Example fix

// before: hand-built result without ReqFn
res := &types.ContextOutdatedResult{UpdatedContexts: ctxs}
// after: provide the request builder
res := &types.ContextOutdatedResult{UpdatedContexts: ctxs, ReqFn: buildUpdateReqFn(ctxs)}
Defensive patterns

Strategy: type-guard

Validate before calling

if outdatedRes != nil && outdatedRes.ReqFn == nil && (len(outdatedRes.UpdatedContexts) > 0 || len(outdatedRes.RemovedContexts) > 0) {
    return fmt.Errorf("outdated result has no ReqFn; cannot update context")
}

Type guard

func hasReqFn(r *types.ContextOutdatedResult) bool {
    return r != nil && r.ReqFn != nil
}

Try / catch

outdated, _, err := lib.CheckOutdatedContextWithOutput(false, autoConfirm, contexts, paths)
if err != nil {
    if strings.Contains(err.Error(), "no update request function provided") {
        return fmt.Errorf("library bug/version mismatch: outdated result missing ReqFn; upgrade plandex-shared")
    }
    return err
}

Prevention

When it happens

Trigger: CheckOutdatedContextWithOutput with confirmed/autoConfirm=true when outdatedRes.ReqFn is nil — i.e. a version mismatch or bug where checkOutdatedAndMaybeUpdateContext returned UpdatedContexts/RemovedContexts but never populated ReqFn (or a caller constructed a hand-made ContextOutdatedResult).

Common situations: Mixing plandex-cli and plandex-shared versions where ContextOutdatedResult.ReqFn was renamed/removed; tests or tooling constructing types.ContextOutdatedResult manually without ReqFn; a corrupted/partial response path in the library.

Related errors


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