mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Fix default agent creation to allow chat on first run
Previously agent slug was not considered on create even when passed explicitly in agent creation step. This made the default agent slug different until next run when it was updated after creation. And didn't allow chat to work on first run The fix to use the agent slug when explicitly passed allows users to chat on first run.
This commit is contained in:
@@ -313,7 +313,7 @@ class Agent(DbBaseModel):
|
||||
if self.creator is None:
|
||||
self.managed_by_admin = True
|
||||
|
||||
if is_new:
|
||||
if is_new and not self.slug:
|
||||
random_sequence = "".join(choice("0123456789") for i in range(6))
|
||||
slug = f"{self.name.lower().replace(' ', '-')}-{random_sequence}"
|
||||
self.slug = slug
|
||||
|
||||
Reference in New Issue
Block a user