Detect likely JSON syntax/parse failures in tool outputs and append a strong, non-redundant recovery prompt so the model replays corrected JSON on retry.
Design
hook.ts contains the implementation with exported constants:
JSON_ERROR_TOOL_EXCLUDE_LIST
JSON_ERROR_PATTERNS
JSON_ERROR_REMINDER
createJsonErrorRecoveryHook(_ctx) returns a tool.execute.after handler that appends reminder text when parsing failed.