From 8317b83d6b6c46561d87c04d122415cf32c9ca06 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Wed, 17 Jun 2026 19:01:10 -0300 Subject: [PATCH] fix(ai-templates): skip humanizer for tweet_card style regardless of carousel mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The humanize() guard was keyed on format string 'tweet_card', but for tweet_card carousel the format becomes 'carousel'. Changed the guard to key on the style key ($this->template === 'tweet_card') so humanization is skipped for all tweet_card variants — single and carousel alike. --- app/Jobs/Ai/StreamPostCreation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Jobs/Ai/StreamPostCreation.php b/app/Jobs/Ai/StreamPostCreation.php index 6b53dd05..73e84729 100644 --- a/app/Jobs/Ai/StreamPostCreation.php +++ b/app/Jobs/Ai/StreamPostCreation.php @@ -89,7 +89,7 @@ public function handle(): void $structured = $response->structured ?? []; $humanizeFormat = $isCarousel ? 'carousel' : $agentFormat; - $structured = $this->humanize($workspace, $structured, $humanizeFormat); + $structured = $this->humanize($workspace, $structured, $humanizeFormat, $this->template); $generated = $style->assemble($structured, $context); $post = $this->createPostFromGenerated($workspace, $generated, $socialAccount); @@ -116,9 +116,9 @@ public function handle(): void * @param array $structured * @return array */ - private function humanize(Workspace $workspace, array $structured, string $format): array + private function humanize(Workspace $workspace, array $structured, string $format, string $styleKey = 'image_card'): array { - if ($format === 'tweet_card') { + if ($styleKey === 'tweet_card') { return $structured; }