From ffa7f04ad1e04330e9ef07d2ce47374637c395c2 Mon Sep 17 00:00:00 2001 From: Brayo Date: Fri, 31 Jan 2025 14:37:12 +0300 Subject: [PATCH] feat:add status emojis to system messages --- gptme/message.py | 4 ++-- gptme/tools/patch.py | 2 +- gptme/tools/tmux.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gptme/message.py b/gptme/message.py index f30f434fce..854acabe11 100644 --- a/gptme/message.py +++ b/gptme/message.py @@ -213,8 +213,8 @@ def format_msgs( userprefix = f"[bold {color}]{userprefix}[/bold {color}]" if msg.role == "system": first_line = msg.content.split("\n", 1)[0].lower() - isSuccess = first_line.startswith(("saved", "executed", "ran", "appended", "patch successfully")) - isError = first_line.startswith(("error", "failed","missing arguments", "unknown command", "no patch")) + isSuccess = first_line.startswith(("saved", "appended", "patch successfully")) + isError = first_line.startswith(("error", "failed")) if isSuccess: userprefix = f"{userprefix} ✅" elif isError: diff --git a/gptme/tools/patch.py b/gptme/tools/patch.py index 15febd0de3..25c3094fd3 100644 --- a/gptme/tools/patch.py +++ b/gptme/tools/patch.py @@ -257,7 +257,7 @@ def execute_patch( code = kwargs.get("patch", code) if not code: - yield Message("system", "No patch provided by the assistant") + yield Message("system", "Error: No patch provided by the assistant") return yield from execute_with_confirmation( diff --git a/gptme/tools/tmux.py b/gptme/tools/tmux.py index 5b06999137..75e6142cd0 100644 --- a/gptme/tools/tmux.py +++ b/gptme/tools/tmux.py @@ -223,7 +223,7 @@ def execute_tmux( continue if len(parts) < 2: - yield Message("system", f"Missing arguments for command: {command}") + yield Message("system", f"Error: Missing arguments for command: {command}") continue _args = parts[1] @@ -237,7 +237,7 @@ def execute_tmux( elif command == "kill_session": yield kill_session(_args) else: - yield Message("system", f"Unknown command: {command}") + yield Message("system", f"Error: Unknown command: {command}") instructions = """