From 4440f8724f24060f2f3a18f1b6e82c16d08d88aa Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Thu, 15 Jun 2023 16:11:50 -0700 Subject: first direction --- continuedev/src/continuedev/steps/core/core.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'continuedev') diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index aee5bc1d..d4f5aa2e 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -334,3 +334,16 @@ class WaitForUserConfirmationStep(Step): self.description = self.prompt resp = await sdk.wait_for_user_input() return TextObservation(text=resp) + + +def get_python_traceback(output: str) -> str: + if "Traceback" in output: + return output[output.index("Traceback"):] + else: + return None + +def get_javascript_traceback(output: str) -> str: + if "at " in output: + return output[output.index("at "):] + else: + return None \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 38cf45ed81d5828835583fd32193e2e442fbf799 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Thu, 15 Jun 2023 16:20:59 -0700 Subject: sending entire output for now --- continuedev/src/continuedev/steps/core/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'continuedev') diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index d4f5aa2e..bcff83f4 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -338,12 +338,12 @@ class WaitForUserConfirmationStep(Step): def get_python_traceback(output: str) -> str: if "Traceback" in output: - return output[output.index("Traceback"):] + return output else: return None def get_javascript_traceback(output: str) -> str: if "at " in output: - return output[output.index("at "):] + return output else: return None \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 0469a72530c6c9bb080fd922db1295ff0643306c Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Thu, 15 Jun 2023 23:06:56 -0700 Subject: more rigorous js impl --- continuedev/src/continuedev/steps/core/core.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'continuedev') diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index bcff83f4..687d4eb0 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -343,7 +343,7 @@ def get_python_traceback(output: str) -> str: return None def get_javascript_traceback(output: str) -> str: - if "at " in output: - return output - else: - return None \ No newline at end of file + lines = output.splitlines("\n") + first_line = lines[0].split(": ") + if len(lines) > 0 and len(first_line[0]) > 0 and "at" in lines[1].lstrip(): + return output \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 3dae06931b13133a23276ce44db9c9f70153dc29 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Thu, 15 Jun 2023 23:09:05 -0700 Subject: protecting against blank outputs --- continuedev/src/continuedev/steps/core/core.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'continuedev') diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index 687d4eb0..b4456122 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -344,6 +344,7 @@ def get_python_traceback(output: str) -> str: def get_javascript_traceback(output: str) -> str: lines = output.splitlines("\n") - first_line = lines[0].split(": ") - if len(lines) > 0 and len(first_line[0]) > 0 and "at" in lines[1].lstrip(): + if len(lines) == 0: + first_line = lines[0].split(": ") + if len(lines) > 1 and len(first_line) > 0 and len(first_line[0]) > 0 and "at" in lines[1].lstrip(): return output \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 87477d87a1d41b1fbb043ed1c112c2dc63087bea Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Thu, 15 Jun 2023 23:10:10 -0700 Subject: returning None in js --- continuedev/src/continuedev/steps/core/core.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'continuedev') diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index b4456122..af3c6cc2 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -344,7 +344,9 @@ def get_python_traceback(output: str) -> str: def get_javascript_traceback(output: str) -> str: lines = output.splitlines("\n") - if len(lines) == 0: + if len(lines) > 0: first_line = lines[0].split(": ") - if len(lines) > 1 and len(first_line) > 0 and len(first_line[0]) > 0 and "at" in lines[1].lstrip(): - return output \ No newline at end of file + if len(lines) > 1 and len(first_line) > 0 and len(first_line[0]) > 0 and "at" in lines[1].lstrip(): + return output + else: + return None \ No newline at end of file -- cgit v1.2.3-70-g09d2