diff --git a/euclid/database/database.py b/euclid/database/database.py index 425f9f5..9044aa2 100644 --- a/euclid/database/database.py +++ b/euclid/database/database.py @@ -140,7 +140,7 @@ def save_development_step(app_id, prompt_path, prompt_data, llm_req_num, message app = get_app(app_id) hash_id = hash_data({ 'prompt_path': prompt_path, - 'prompt_data': prompt_data, + 'prompt_data': {k: v for k, v in prompt_data.items() if k not in {"directory_tree"}}, 'llm_req_num': llm_req_num }) try: @@ -152,7 +152,7 @@ def save_development_step(app_id, prompt_path, prompt_data, llm_req_num, message .execute()) dev_step = DevelopmentSteps.get_by_id(inserted_id) - print(colored(f"Saved development step with id {dev_step.id}", "yellow")) + print(colored(f"Saved DEV step => {dev_step.id}", "yellow")) except IntegrityError: print(f"A Development Step with hash_id {hash_id} already exists.") return None @@ -188,7 +188,7 @@ def hash_and_save_step(Model, app_id, hash_data_args, data_fields, message): record = Model.get_by_id(inserted_id) print(colored(f"{message} with id {record.id}", "yellow")) except IntegrityError: - print(f"A record with hash_id {hash_id} already exists for {Model}.") + print(f"A record with hash_id {hash_id} already exists for {Model.__name__}.") return None return record @@ -214,13 +214,12 @@ def get_command_run_from_hash_id(project, command): def get_development_step_from_hash_id(app_id, prompt_path, prompt_data, llm_req_num): hash_id = hash_data({ 'prompt_path': prompt_path, - 'prompt_data': prompt_data, + 'prompt_data': {k: v for k, v in prompt_data.items() if k not in {"directory_tree"}}, 'llm_req_num': llm_req_num }) try: dev_step = DevelopmentSteps.get((DevelopmentSteps.hash_id == hash_id) & (DevelopmentSteps.app == app_id)) except DoesNotExist: - print(f"No Development Step found with hash_id {hash_id}") return None return dev_step diff --git a/euclid/database/models/command_runs.py b/euclid/database/models/command_runs.py index 8c6db63..673ff61 100644 --- a/euclid/database/models/command_runs.py +++ b/euclid/database/models/command_runs.py @@ -7,7 +7,7 @@ from database.models.app import App class CommandRuns(BaseModel): id = AutoField() app = ForeignKeyField(App) - hash_id = CharField(unique=True, null=False) + hash_id = CharField(null=False) command = TextField(null=True) cli_response = TextField(null=True) diff --git a/euclid/database/models/development_steps.py b/euclid/database/models/development_steps.py index f3d2800..3ba05b5 100644 --- a/euclid/database/models/development_steps.py +++ b/euclid/database/models/development_steps.py @@ -9,7 +9,7 @@ from database.models.app import App class DevelopmentSteps(BaseModel): id = AutoField() # This will serve as the primary key app = ForeignKeyField(App) - hash_id = CharField(unique=True, null=False) + hash_id = CharField(null=False) messages = BinaryJSONField(null=True) llm_response = BinaryJSONField(null=False)