Skip to content

Commit

Permalink
Merge branch 'fcm_message_notice' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiannis128 committed Jun 5, 2024
2 parents c302496 + bfbe873 commit 6b30d3a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions esbmc_ai/commands/fix_code_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
)
from ..logging import print_horizontal_line, printv, printvv

# TODO Remove built in messages and move them to config.


class FixCodeCommand(ChatCommand):
on_solution_signal: Signal = Signal()
Expand Down Expand Up @@ -135,7 +133,7 @@ def print_raw_conversation() -> None:
break

# Print verbose lvl 2
printvv("\nGeneration:")
printvv("\nESBMC-AI Notice: Source Code Generation:")
print_horizontal_line(2)
printvv(source_code)
print_horizontal_line(2)
Expand All @@ -154,6 +152,7 @@ def print_raw_conversation() -> None:
self.anim.stop()

# Print verbose lvl 2
printvv("\nESBMC-AI Notice: ESBMC Output:")
print_horizontal_line(2)
printvv(esbmc_output)
print_horizontal_line(2)
Expand All @@ -173,11 +172,17 @@ def print_raw_conversation() -> None:
# Update state
solution_generator.update_state(source_code, esbmc_output)
except ESBMCTimedOutException:
print("error: ESBMC has timed out...")
if config.raw_conversation:
print_raw_conversation()
print("ESBMC-AI Notice: error: ESBMC has timed out...")
sys.exit(1)

# Failure case
print(f"ESBMC-AI Notice: Failure {idx+1}/{max_retries}: Retrying...")
print(
f"ESBMC-AI Notice: Failure {idx+1}/{max_retries}" + ": Retrying..."
if idx != max_retries - 1
else ""
)

if config.raw_conversation:
print_raw_conversation()
Expand Down

0 comments on commit 6b30d3a

Please sign in to comment.