From e294a0f29c5871a5bf6c0d81600ae8cc26e57ecf Mon Sep 17 00:00:00 2001 From: ksarangmath Date: Mon, 11 Aug 2025 16:07:17 -0700 Subject: [PATCH] handle background tsak (#70) Co-authored-by: Kartik Sarangmath --- pyproject.toml | 2 +- webhooks/claude_wrapper_v3.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index da1350d..920a6e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "omnara" -version = "1.4.6" +version = "1.4.7" description = "Omnara Agent Dashboard - MCP Server and Python SDK" readme = "README.md" requires-python = ">=3.10" diff --git a/webhooks/claude_wrapper_v3.py b/webhooks/claude_wrapper_v3.py index f5476b7..2a9dc21 100755 --- a/webhooks/claude_wrapper_v3.py +++ b/webhooks/claude_wrapper_v3.py @@ -770,7 +770,7 @@ class ClaudeWrapperV3: """Check if Claude is idle (hasn't shown 'esc to interrupt' for 0.5+ seconds)""" if self.last_esc_interrupt_seen: time_since_esc = time.time() - self.last_esc_interrupt_seen - return time_since_esc >= 0.5 + return time_since_esc >= 0.75 return True def cancel_pending_input_request(self): @@ -1161,7 +1161,11 @@ class ClaudeWrapperV3: import re clean_text = re.sub(r"\x1b\[[0-9;]*m", "", text) - if "esc to interrupt)" in clean_text: + # Check for both "esc to interrupt" and "ctrl+b to run in background" + if ( + "esc to interrupt)" in clean_text + or "ctrl+b to run in background" in clean_text + ): self.last_esc_interrupt_seen = time.time() except Exception: