feat(03-01): implement CommandExecutor and OutputCapture classes
- Add CommandResult dataclass for storing execution results - Add OutputCapture class with prompt detection and stabilization - Add CommandExecutor class for command execution and error detection - Support common shell prompts ($, ❯, ➜, >) - Detect errors in both English and Chinese - Use 60s default timeout from CONTEXT.md decision - Mock-based testing (no real tmux required) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -133,7 +133,7 @@ class TestCommandExecutorDetectErrors:
|
||||
def test_detect_errors_returns_true_for_exception_keyword(self):
|
||||
"""_detect_errors should return (True, 'exception') for exception in output."""
|
||||
executor = CommandExecutor()
|
||||
has_error, error_type = executor._detect_errors("Traceback: ValueError occurred")
|
||||
has_error, error_type = executor._detect_errors("ValueError: An exception occurred")
|
||||
|
||||
assert has_error is True
|
||||
assert error_type == "exception"
|
||||
|
||||
Reference in New Issue
Block a user