summaryrefslogtreecommitdiff
path: root/continuedev/src
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-08-23 17:15:09 -0700
committerNate Sesti <sestinj@gmail.com>2023-08-23 17:15:09 -0700
commita74eda56cfcafb5c463a74df564ced6f882f8d3e (patch)
treeec27abb30e4181f0c3bd044cccff3fa4c689d3e3 /continuedev/src
parent3497f1af955f17a25df05cf46d5cb1fcfbdd1311 (diff)
downloadsncontinue-a74eda56cfcafb5c463a74df564ced6f882f8d3e.tar.gz
sncontinue-a74eda56cfcafb5c463a74df564ced6f882f8d3e.tar.bz2
sncontinue-a74eda56cfcafb5c463a74df564ced6f882f8d3e.zip
fix: :lipstick: don't display entirety of large tracebacks
Diffstat (limited to 'continuedev/src')
-rw-r--r--continuedev/src/continuedev/plugins/context_providers/file.py2
-rw-r--r--continuedev/src/continuedev/plugins/steps/core/core.py2
-rw-r--r--continuedev/src/continuedev/plugins/steps/on_traceback.py9
3 files changed, 12 insertions, 1 deletions
diff --git a/continuedev/src/continuedev/plugins/context_providers/file.py b/continuedev/src/continuedev/plugins/context_providers/file.py
index f4e6e374..a748379e 100644
--- a/continuedev/src/continuedev/plugins/context_providers/file.py
+++ b/continuedev/src/continuedev/plugins/context_providers/file.py
@@ -59,6 +59,8 @@ class FileContextProvider(ContextProvider):
async def on_file_saved(filepath: str, contents: str):
item = await self.get_context_item_for_filepath(filepath)
+ if item is None:
+ return
await self.update_documents([item], self.sdk.ide.workspace_directory)
async def on_files_created(filepaths: List[str]):
diff --git a/continuedev/src/continuedev/plugins/steps/core/core.py b/continuedev/src/continuedev/plugins/steps/core/core.py
index 3de76eaf..3ff1730e 100644
--- a/continuedev/src/continuedev/plugins/steps/core/core.py
+++ b/continuedev/src/continuedev/plugins/steps/core/core.py
@@ -898,6 +898,8 @@ class UserInputStep(Step):
manage_own_chat_context: bool = True
async def describe(self, models: Models) -> Coroutine[str, None, None]:
+ if self.description is not None:
+ return self.description
return self.user_input
async def run(
diff --git a/continuedev/src/continuedev/plugins/steps/on_traceback.py b/continuedev/src/continuedev/plugins/steps/on_traceback.py
index 86a0f499..9c663a66 100644
--- a/continuedev/src/continuedev/plugins/steps/on_traceback.py
+++ b/continuedev/src/continuedev/plugins/steps/on_traceback.py
@@ -44,9 +44,16 @@ class DefaultOnTracebackStep(Step):
tb = parsed_tb
break
+ 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
+ )
+
await sdk.run_step(
UserInputStep(
- user_input=f"""I got the following error, can you please help explain how to fix it?\n\n{tb}"""
+ 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}""",
)
)
await sdk.run_step(SimpleChatStep(name="Help With Traceback"))