fix: 🐛 traceback fixes, remove replicate from hiddenimports

This commit is contained in:
Nate Sesti 2023-09-04 11:01:37 -07:00
parent b632a5ab53
commit 45d9bab5ce
4 changed files with 11 additions and 12 deletions

View file

@ -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,
)
)

View file

@ -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" /> */}

View file

@ -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=[],

View file

@ -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=[],