Skip to content
docsv0.42.1

ToolFailureWindow

A partial view of a structured tool error, separate from its original durable receipt. Only oversized JSON objects are projected. Large object string fields may be omitted; arrays and scalar facts are never rewritten. If that structure still cannot fit, the whole preview is unavailable. Neither form certifies the tool's claims or grants authority.

ToolFailureWindow::project()

public static function project(string $error, int $budget): ?string

Fit a failure projection within the caller's existing character budget, including metadata. Return null for the unchanged legacy path: short errors, unsupported JSON, or a budget smaller than the minimal envelope. This method never writes or replaces the original error.

Parameters

Parameters of project()
NameTypeDescription
$errorstring
$budgetint