{"record":{"id":"338dbe044866b7da","repo":"eyaltoledano/claude-task-master","slug":"warning-message","errorCode":null,"errorMessage":"{\"warning\":\"${message}\"}","messagePattern":"\\{\"warning\":\"\\$\\{message\\}\"\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/cli/src/commands/autopilot/shared.ts","lineNumber":115,"sourceCode":"\t\t\t\t\t},\n\t\t\t\t\tnull,\n\t\t\t\t\t2\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.log(chalk.green(`✓ ${message}`));\n\t\t\tif (data) {\n\t\t\t\tthis.output(data);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Output warning message\n\t */\n\twarning(message: string): void {\n\t\tif (this.useJson) {\n\t\t\tconsole.warn(\n\t\t\t\tJSON.stringify(\n\t\t\t\t\t{\n\t\t\t\t\t\twarning: message\n\t\t\t\t\t},\n\t\t\t\t\tnull,\n\t\t\t\t\t2\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.warn(chalk.yellow(`⚠️ ${message}`));\n\t\t}\n\t}\n\n\t/**\n\t * Output info message\n\t */\n\tinfo(message: string): void {\n\t\tif (this.useJson) {","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/apps/cli/src/commands/autopilot/shared.ts#L97-L133","documentation":"The autopilot shared output helper's warning() method, when JSON output mode is enabled (useJson), emits warnings as machine-readable JSON: {\"warning\":\"<message>\"} printed via console.warn. This is the structured-mode counterpart to the human-readable ⚠️ output (error 703), not an error itself.","triggerScenarios":"Running any autopilot command with --json (useJson=true) while the command's execute() path calls output.warning(message) for any recoverable condition.","commonSituations":"CI pipelines parsing autopilot output as JSON; scripts piping stderr into a log aggregator; users surprised that warnings appear on stderr rather than stdout.","solutions":["Parse stderr lines as JSON objects with a 'warning' key to surface warnings programmatically.","If human-readable output is desired, drop the --json flag.","Address the underlying warning message content carried in the JSON payload."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function isCliWarning(obj: unknown): obj is { warning: string } {\n  return typeof obj === 'object' && obj !== null && 'warning' in obj && typeof (obj as any).warning === 'string';\n}","tryCatchPattern":"// warnings go to stderr as JSON lines; capture and filter\nproc.stderr.on('data', (chunk) => {\n  for (const line of chunk.toString().split('\\n').filter(Boolean)) {\n    try {\n      const parsed = JSON.parse(line);\n      if (isCliWarning(parsed)) handleWarning(parsed.warning);\n    } catch { /* non-JSON stderr line */ }\n  }\n});","preventionTips":["Parse autopilot stderr line-by-line as JSON when using --json.","Route stderr and stdout to different streams in CI to keep JSON clean.","Never assume warnings mean failure — check the process exit code."],"tags":["cli","json-output","stderr","warning"],"backgroundTag":"structured-warning-output","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}