eyaltoledano/claude-task-master · warning

{"warning":"${message}"}

Error message

{"warning":"${message}"}

What it means

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.

Source

Thrown at apps/cli/src/commands/autopilot/shared.ts:115

					},
					null,
					2
				)
			);
		} else {
			console.log(chalk.green(`✓ ${message}`));
			if (data) {
				this.output(data);
			}
		}
	}

	/**
	 * Output warning message
	 */
	warning(message: string): void {
		if (this.useJson) {
			console.warn(
				JSON.stringify(
					{
						warning: message
					},
					null,
					2
				)
			);
		} else {
			console.warn(chalk.yellow(`⚠️ ${message}`));
		}
	}

	/**
	 * Output info message
	 */
	info(message: string): void {
		if (this.useJson) {

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Parse stderr lines as JSON objects with a 'warning' key to surface warnings programmatically.
  2. If human-readable output is desired, drop the --json flag.
  3. Address the underlying warning message content carried in the JSON payload.
Defensive patterns

Strategy: type-guard

Type guard

function isCliWarning(obj: unknown): obj is { warning: string } {
  return typeof obj === 'object' && obj !== null && 'warning' in obj && typeof (obj as any).warning === 'string';
}

Try / catch

// warnings go to stderr as JSON lines; capture and filter
proc.stderr.on('data', (chunk) => {
  for (const line of chunk.toString().split('\n').filter(Boolean)) {
    try {
      const parsed = JSON.parse(line);
      if (isCliWarning(parsed)) handleWarning(parsed.warning);
    } catch { /* non-JSON stderr line */ }
  }
});

Prevention

When it happens

Trigger: Running any autopilot command with --json (useJson=true) while the command's execute() path calls output.warning(message) for any recoverable condition.

Common situations: CI pipelines parsing autopilot output as JSON; scripts piping stderr into a log aggregator; users surprised that warnings appear on stderr rather than stdout.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/338dbe044866b7da. Report an issue: GitHub.