{"record":{"id":"904ab4cd4615d2e7","repo":"mastra-ai/mastra","slug":"github-reconcile-worker-requires-a-pull-request-or","errorCode":null,"errorMessage":"GitHub reconcile worker requires a pull request or issue reconciler.","messagePattern":"GitHub reconcile worker requires a pull request or issue reconciler\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mastracode/factory/src/integrations/github/reconcile-worker.ts","lineNumber":70,"sourceCode":"  readonly #reconcileIssues: GithubIssueReconciler | undefined;\n  readonly #sourceControl: GithubReconcileRepositorySource;\n  readonly #intervalMs: number;\n  readonly #issueIntervalMs: number;\n  readonly #leaseTtlMs: number;\n  readonly #leaseOwner = randomUUID();\n  readonly #now: () => number;\n\n  #running = false;\n  #timer: ReturnType<typeof setTimeout> | undefined;\n  #inFlight: Promise<void> | undefined;\n  #leaseProvider: LeaseProvider = NoopLeaseProvider;\n  #nextPullRequestReconcileAt = 0;\n  #nextIssueReconcileAt = 0;\n\n  constructor(config: GithubReconcileWorkerConfig) {\n    super();\n    if (!config.reconcile && !config.reconcileIssues) {\n      throw new Error('GitHub reconcile worker requires a pull request or issue reconciler.');\n    }\n    this.#reconcile = config.reconcile;\n    this.#reconcileIssues = config.reconcileIssues;\n    this.#sourceControl = config.sourceControl;\n    this.#intervalMs = config.intervalMs ?? DEFAULT_GITHUB_RECONCILE_INTERVAL_MS;\n    this.#issueIntervalMs = config.issueIntervalMs ?? this.#intervalMs;\n    if (!Number.isFinite(this.#intervalMs) || this.#intervalMs <= 0) {\n      throw new Error('GitHub pull request reconcile interval must be a positive number.');\n    }\n    if (!Number.isFinite(this.#issueIntervalMs) || this.#issueIntervalMs <= 0) {\n      throw new Error('GitHub issue reconcile interval must be a positive number.');\n    }\n    this.#leaseTtlMs = Math.max(MIN_LEASE_TTL_MS, Math.min(this.#intervalMs, this.#issueIntervalMs) * 3);\n    this.#now = config.now ?? Date.now;\n  }\n\n  async init(deps: WorkerDeps): Promise<void> {\n    await super.init(deps);","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/mastracode/factory/src/integrations/github/reconcile-worker.ts#L52-L88","documentation":"GithubReconcileWorker's constructor requires at least one reconciler: config.reconcile (pull requests) or config.reconcileIssues (issues). A worker with neither has nothing to do, so construction fails fast rather than running an idle polling loop.","triggerScenarios":"new GithubReconcileWorker({ sourceControl, intervalMs }) with both reconcile and reconcileIssues omitted or explicitly set to undefined.","commonSituations":"Partial config after a refactor adding the issues option; config object built conditionally where both branches were skipped; typos like reconciler vs reconcile.","solutions":["Pass at least one of reconcile or reconcileIssues callbacks in the config.","If you only sync issues, set reconcileIssues; if only PRs, set reconcile.","Check the config construction code for conditional omission or property-name typos.","If you truly need no reconciliation, don't construct the worker at all."],"exampleFix":"// before\nnew GithubReconcileWorker({ sourceControl });\n// after\nnew GithubReconcileWorker({ sourceControl, reconcile: reconcilePullRequests });","handlingStrategy":"validation","validationCode":"if (!config.reconcile && !config.reconcileIssues) throw new Error('GithubReconcileWorker needs at least one of reconcile / reconcileIssues');","typeGuard":"function isWorkerConfig(c: GithubReconcileWorkerConfig): boolean {\n  return typeof c.reconcile === 'function' || typeof c.reconcileIssues === 'function';\n}","tryCatchPattern":"try {\n  worker = new GithubReconcileWorker(config);\n} catch (e) {\n  if ((e as Error).message.includes('requires a pull request or issue reconciler')) {\n    log.error('worker config has no reconcilers', config);\n  }\n  throw e;\n}","preventionTips":["Always supply at least one reconciler callback in worker config.","Type the config so at least one reconciler field is required (union type).","Unit-test worker construction with your real config object."],"tags":["github","configuration","constructor"],"backgroundTag":"missing-required-config","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}