{"record":{"id":"113e2bc67e1b3b8b","repo":"plandex-ai/plandex","slug":"no-update-request-function-provided","errorCode":null,"errorMessage":"no update request function provided","messagePattern":"no update request function provided","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/context_update.go","lineNumber":181,"sourceCode":"\t\t\ttableString := tableForContextOutdated(outdatedRes.RemovedContexts, outdatedRes.TokenDiffsById)\n\t\t\tfmt.Println(tableString)\n\t\t}\n\t}\n\n\tconfirmed := autoConfirm\n\n\tif !autoConfirm {\n\t\tconfirmed, err = term.ConfirmYesNo(\"Update context now?\")\n\n\t\tif err != nil {\n\t\t\tterm.OutputErrorAndExit(\"failed to get user input: %s\", err)\n\t\t}\n\t}\n\n\tif confirmed {\n\t\treqFn := outdatedRes.ReqFn\n\t\tif reqFn == nil {\n\t\t\treturn false, false, fmt.Errorf(\"no update request function provided\")\n\t\t}\n\t\t_, err = UpdateContextWithOutput(UpdateContextParams{\n\t\t\tContexts:    contexts,\n\t\t\tOutdatedRes: *outdatedRes,\n\t\t\tReqFn:       reqFn,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn false, false, fmt.Errorf(\"error updating context: %v\", err)\n\t\t}\n\t\treturn true, true, nil\n\t} else {\n\t\treturn true, false, nil\n\t}\n\n}\n\ntype UpdateContextParams struct {\n\tContexts    []*shared.Context","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/context_update.go#L163-L199","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Upgrade plandex-cli and plandex-shared to matching versions (go get -u plandex-shared && go mod tidy)","If constructing ContextOutdatedResult yourself (tests), always set ReqFn to a valid func() (map[string]*shared.UpdateContextParams, error)","Reproduce with a clean checkout; if it persists, report a bug with the context types involved"],"exampleFix":"// before: hand-built result without ReqFn\nres := &types.ContextOutdatedResult{UpdatedContexts: ctxs}\n// after: provide the request builder\nres := &types.ContextOutdatedResult{UpdatedContexts: ctxs, ReqFn: buildUpdateReqFn(ctxs)}","handlingStrategy":"type-guard","validationCode":"if outdatedRes != nil && outdatedRes.ReqFn == nil && (len(outdatedRes.UpdatedContexts) > 0 || len(outdatedRes.RemovedContexts) > 0) {\n    return fmt.Errorf(\"outdated result has no ReqFn; cannot update context\")\n}","typeGuard":"func hasReqFn(r *types.ContextOutdatedResult) bool {\n    return r != nil && r.ReqFn != nil\n}","tryCatchPattern":"outdated, _, err := lib.CheckOutdatedContextWithOutput(false, autoConfirm, contexts, paths)\nif err != nil {\n    if strings.Contains(err.Error(), \"no update request function provided\") {\n        return fmt.Errorf(\"library bug/version mismatch: outdated result missing ReqFn; upgrade plandex-shared\")\n    }\n    return err\n}","preventionTips":["Keep plandex-cli and plandex-shared versions matched","Never construct types.ContextOutdatedResult manually without ReqFn","Pin shared library versions in go.mod","Add a unit test asserting ReqFn is non-nil whenever outdated items are returned"],"tags":["go","nil-check","context","api-contract"],"backgroundTag":"missing-callback","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}