{"record":{"id":"fdebc1a72bd3bc5f","repo":"deepseek-ai/deepseek-harness","slug":"planmodeconfig-needs-a-string-section","errorCode":null,"errorMessage":"PlanModeConfig needs a string `section`","messagePattern":"PlanModeConfig needs a string `section`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plan/plan-mode/src/index.ts","lineNumber":109,"sourceCode":"function firstHeading(plan: string): string | undefined {\n  for (const line of plan.split('\\n')) {\n    const match = /^#{1,6}\\s+(.+?)\\s*$/.exec(line)\n    if (match) return match[1]\n  }\n  return undefined\n}\n\n/**\n * Validate deployment-owned plan guidance. Missing, blank, non-string, or\n * unknown fields fail at plugin load rather than being ignored.\n *\n * @param config Raw plugin config.\n * @returns A detached validated config.\n */\nexport function resolveConfig(config: PlanModeConfig): PlanModeConfig {\n  const section = (config as Partial<PlanModeConfig>).section\n  if (typeof section !== 'string') {\n    throw new Error('PlanModeConfig needs a string `section`')\n  }\n  if (section.trim() === '') {\n    throw new Error('PlanModeConfig needs a non-empty `section`')\n  }\n  const unknown = Object.keys(config).filter(key => key !== 'section')\n  if (unknown.length > 0) {\n    throw new Error(`PlanModeConfig has unknown key(s) ${unknown.join(', ')} — config is { section }`)\n  }\n  return { section }\n}\n\n/**\n * Whether plan mode is active after the first `end` events. The last\n * `plan/mode` wins; a prefix with none is inactive.\n *\n * @param events The session log or any prefix of it.\n * @param end Fold `events[0, end)`; defaults to the whole log.\n * @returns Whether plan mode is active.","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/plan/plan-mode/src/index.ts#L91-L127","documentation":"Error \"PlanModeConfig needs a string `section`\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/plan/plan-mode/src/index.ts:109 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set PlanModeConfig.section to a string."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}