Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Code Mode: Formatted notice messages #125

Merged
merged 4 commits into from
Jun 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions esbmc_ai/commands/fix_code_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,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 @@ -120,6 +120,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 @@ -131,7 +132,7 @@ def print_raw_conversation() -> None:
if config.raw_conversation:
print_raw_conversation()

printv("ESBMC-AI Notice: Successfully verified code")
printv("ESBMC-AI Notice: Successfuly verified code")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be removed before merging. According to the Oxford Dictionary, "Successfuly" is wrong.


return False, source_code

Expand All @@ -146,11 +147,17 @@ def print_raw_conversation() -> None:
except SourceCodeParseError:
pass
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 ""
)

# Update state
solution_generator.update_state(source_code, esbmc_output)
Expand Down
Loading