diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-09-04 11:01:37 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-09-04 11:01:37 -0700 |
commit | 45d9bab5cea745573be7112d7130089c596c88fa (patch) | |
tree | 0d8cfd11432ab929578f90eafd041cd80935250d | |
parent | b632a5ab537069e22b976b097b34b9879be18168 (diff) | |
download | sncontinue-45d9bab5cea745573be7112d7130089c596c88fa.tar.gz sncontinue-45d9bab5cea745573be7112d7130089c596c88fa.tar.bz2 sncontinue-45d9bab5cea745573be7112d7130089c596c88fa.zip |
fix: :bug: traceback fixes, remove replicate from hiddenimports
-rw-r--r-- | continuedev/src/continuedev/plugins/steps/on_traceback.py | 10 | ||||
-rw-r--r-- | extension/react-app/src/components/UserInputContainer.tsx | 9 | ||||
-rw-r--r-- | run.m1.spec | 2 | ||||
-rw-r--r-- | run.spec | 2 |
4 files changed, 11 insertions, 12 deletions
diff --git a/continuedev/src/continuedev/plugins/steps/on_traceback.py b/continuedev/src/continuedev/plugins/steps/on_traceback.py index 6b75d726..13d7aa38 100644 --- a/continuedev/src/continuedev/plugins/steps/on_traceback.py +++ b/continuedev/src/continuedev/plugins/steps/on_traceback.py @@ -55,17 +55,10 @@ class DefaultOnTracebackStep(Step): await sdk.run_step(SolvePythonTracebackStep(output=self.output)) return - tb = extract_traceback_str(self.output) - - tb_first_last_lines = ( - ("\n".join(tb.split("\n")[:3]) + "\n...\n" + "\n".join(tb.split("\n")[-3:])) - if len(tb.split("\n")) > 6 - else tb - ) + tb = extract_traceback_str(self.output) or self.output[-8000:] await sdk.run_step( UserInputStep( - description=f"""I got the following error, can you please help explain how to fix it?\n\n{tb_first_last_lines}""", user_input=f"""I got the following error, can you please help explain how to fix it?\n\n{tb}""", ) ) @@ -171,7 +164,6 @@ class SolvePythonTracebackStep(Step): await sdk.run_step( UserInputStep( - description="Solving stack trace", user_input=prompt, ) ) diff --git a/extension/react-app/src/components/UserInputContainer.tsx b/extension/react-app/src/components/UserInputContainer.tsx index fe85c431..228c3530 100644 --- a/extension/react-app/src/components/UserInputContainer.tsx +++ b/extension/react-app/src/components/UserInputContainer.tsx @@ -69,6 +69,13 @@ const TextArea = styled.textarea` } `; +function stringWithEllipsis(str: string, maxLen: number) { + if (str.length > maxLen) { + return str.substring(0, maxLen - 3) + "...\n(Click to expand)"; + } + return str; +} + const UserInputContainer = (props: UserInputContainerProps) => { const [isHovered, setIsHovered] = useState(false); const [isEditing, setIsEditing] = useState(false); @@ -144,7 +151,7 @@ const UserInputContainer = (props: UserInputContainerProps) => { }} className="mr-6 cursor-text w-full" > - {props.children} + {stringWithEllipsis(props.children, 600)} </StyledPre> )} {/* <ReactMarkdown children={props.children} className="w-fit mr-10" /> */} diff --git a/run.m1.spec b/run.m1.spec index ad75856a..5f1cc850 100644 --- a/run.m1.spec +++ b/run.m1.spec @@ -13,7 +13,7 @@ a = Analysis( ('continuedev', 'continuedev'), (certifi.where(), 'ca_bundle'), ] + copy_metadata('replicate'), - hiddenimports=['anthropic', 'github', 'ripgrepy', 'bs4', 'redbaron', 'replicate'], + hiddenimports=['anthropic', 'github', 'ripgrepy', 'bs4', 'redbaron', 'python-lsp-server'], hookspath=[], hooksconfig={}, runtime_hooks=[], @@ -13,7 +13,7 @@ a = Analysis( ('continuedev', 'continuedev'), (certifi.where(), 'ca_bundle') ], - hiddenimports=['anthropic', 'github', 'ripgrepy', 'bs4', 'redbaron', 'python-lsp-server', 'replicate'] + copy_metadata('replicate'), + hiddenimports=['anthropic', 'github', 'ripgrepy', 'bs4', 'redbaron', 'python-lsp-server'] + copy_metadata('replicate'), hookspath=[], hooksconfig={}, runtime_hooks=[], |