{"record":{"id":"a0eb0cc850dc02c8","repo":"plandex-ai/plandex","slug":"no-active-plan-with-id-s-a0eb0c","errorCode":null,"errorMessage":"no active plan with id %s","messagePattern":"no active plan with id (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/server/model/plan/tell_load.go","lineNumber":436,"sourceCode":"\t\t\tUpdateActivePlan(planId, branch, func(ap *types.ActivePlan) {\n\t\t\t\tfor _, path := range toUnskipPaths {\n\t\t\t\t\tdelete(ap.SkippedPaths, path)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (state *activeTellStreamState) setActivePlan() error {\n\tplan := state.plan\n\tbranch := state.branch\n\n\tactive := GetActivePlan(plan.Id, branch)\n\n\tif active == nil {\n\t\treturn fmt.Errorf(\"no active plan with id %s\", plan.Id)\n\t}\n\n\tstate.activePlan = active\n\n\treturn nil\n}\n","sourceCodeStart":418,"sourceCodeEnd":443,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/tell_load.go#L418-L443","documentation":"setActivePlan in tell_load.go looks up the in-memory active plan via GetActivePlan(plan.Id, branch) and returns 'no active plan with id %s' when the lookup returns nil. An active plan only exists in memory while a tell stream is running; if it has been evicted, never registered, or belongs to a different branch, this error fires. Called from loadTellPlan and handleStreamFinished.","triggerScenarios":"GetActivePlan(planId, branch) returns nil: the stream already finished and was removed from the registry, the branch string doesn't match the one the active plan was registered under (e.g. 'main' vs actual branch), server restarted losing in-memory state, or loadTellPlan invoked for a plan that has no running stream.","commonSituations":"Branch-name mismatch after a checkout/rename; client resuming a tell request after server restart; duplicate stream-finish handling after the active plan was cleared.","solutions":["Log/verify the exact planId and branch being looked up vs what was registered","Ensure the active plan is created (AddActivePlan/UpdateActivePlan) before loadTellPlan runs","Check the branch value matches the one used when the stream started","Treat a missing active plan as a client-side stale request: abort rather than retry"],"exampleFix":"// before\nactive := GetActivePlan(plan.Id, branch)\nif active == nil {\n    return fmt.Errorf(\"no active plan with id %s\", plan.Id)\n}\n// after\nactive := GetActivePlan(plan.Id, branch)\nif active == nil {\n    log.Printf(\"active plan missing: id=%s branch=%q (registered branches checked)\", plan.Id, branch)\n    return fmt.Errorf(\"no active plan with id %s on branch %s\", plan.Id, branch)\n}","handlingStrategy":"type-guard","validationCode":"active := GetActivePlan(planId, branch)\nif active == nil {\n    return fmt.Errorf(\"no active plan with id %s on branch %s\", planId, branch)\n}","typeGuard":"func isActivePlanAvailable(planId, branch string) bool {\n    return GetActivePlan(planId, branch) != nil\n}","tryCatchPattern":"active := GetActivePlan(plan.Id, branch)\nif active == nil {\n    return fmt.Errorf(\"no active plan with id %s\", plan.Id)\n}\n_ = active // safe to use below","preventionTips":["Never reuse a branch string from client input; derive it from the active stream","Check active plan existence before any resume/continue call","Clean up active plans deterministically in one code path only","After a server restart, treat old stream requests as stale and re-initiate"],"tags":["in-memory-state","active-plan","branch-mismatch","race-condition"],"backgroundTag":"active-plan-not-found","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}