Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(branding): make colors.secondary optional, don't apply as default

firecrawl-spring[bot]1a9d7605d8ab
diff --git a/apps/api/src/lib/branding/llm.ts b/apps/api/src/lib/branding/llm.ts
index cb094ffc7..910705ac8 100644
--- a/apps/api/src/lib/branding/llm.ts
+++ b/apps/api/src/lib/branding/llm.ts
@@ -227,7 +227,6 @@ export async function enhanceBrandingWithLLM(
},
colorRoles: {
primaryColor: "",
- secondaryColor: "",
accentColor: "",
backgroundColor: "",
textPrimary: "",
diff --git a/apps/api/src/lib/branding/merge.ts b/apps/api/src/lib/branding/merge.ts
index b75f7987a..6d79d5737 100644
--- a/apps/api/src/lib/branding/merge.ts
+++ b/apps/api/src/lib/branding/merge.ts
@@ -267,7 +267,11 @@ export function mergeBrandingResults(
merged.colors = {
...merged.colors,
primary: llm.colorRoles.primaryColor || merged.colors?.primary,
- secondary: llm.colorRoles.secondaryColor || merged.colors?.secondary,
+ ...(llm.colorRoles.secondaryColor
+ ? { secondary: llm.colorRoles.secondaryColor }
+ : merged.colors?.secondary
+ ? { secondary: merged.colors.secondary }
+ : {}),
accent: llm.colorRoles.accentColor || merged.colors?.accent,
background: llm.colorRoles.backgroundColor || merged.colors?.background,
textPrimary: llm.colorRoles.textPrimary || merged.colors?.textPrimary,
diff --git a/apps/api/src/lib/branding/schema.ts b/apps/api/src/lib/branding/schema.ts
index 517a623ef..291510d2e 100644
--- a/apps/api/src/lib/branding/schema.ts
+++ b/apps/api/src/lib/branding/schema.ts
@@ -46,8 +46,9 @@ const baseBrandingEnhancementSchema = z.object({
primaryColor: z.string().describe("Main brand color (hex)"),
secondaryColor: z
.string()
+ .optional()
.describe(
- "Secondary brand color (hex) - a complementary color distinct from primary, often used for secondary UI elements, headings, or supporting brand visuals. Return empty string if no clear secondary color exists.",
+ "Secondary brand color (hex) - a complementary color distinct from primary, often used for secondary UI elements, headings, or supporting brand visuals. Omit or return empty string if no clear secondary color exists.",
),
accentColor: z.string().describe("Accent/CTA color (hex)"),
backgroundColor: z.string().describe("Main background color (hex)"),