Skip to content

A platform for community discussion. Free, open, simple.

FIX: Truncate seeded persona's names to fit name length constraint (#34393)

Roman Rizzi565a70b72ca6
diff --git a/plugins/discourse-ai/db/migrate/20250721080444_seed_personas_from_triage_scripts.rb b/plugins/discourse-ai/db/migrate/20250721080444_seed_personas_from_triage_scripts.rb
index 59d70561cf0..292c3a23b72 100644
--- a/plugins/discourse-ai/db/migrate/20250721080444_seed_personas_from_triage_scripts.rb
+++ b/plugins/discourse-ai/db/migrate/20250721080444_seed_personas_from_triage_scripts.rb
@@ -35,6 +35,10 @@ class SeedPersonasFromTriageScripts < ActiveRecord::Migration[8.0]
"Unnamed triage automation script ID #{field["automation_id"]}"
end
)
+
+ # Persona's name field cannot be longer than 100 chars.
+ name = name.truncate(99)
+
temp = field["temperature"]
# Extract the model ID from the setting value (e.g., "custom:-5" -> "-5")