mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
Handle multiline tool_error() better
This commit is contained in:
parent
ebeec04cae
commit
edc70bdf84
2 changed files with 12 additions and 10 deletions
|
@ -1102,14 +1102,12 @@ class Coder:
|
|||
if self.apply_update_errors < self.max_apply_update_errors:
|
||||
self.io.tool_error(f"Malformed response #{self.apply_update_errors}, retrying...")
|
||||
self.io.tool_error("https://aider.chat/docs/faq.html#aider-isnt-editing-my-files")
|
||||
for line in str(err).splitlines():
|
||||
self.io.tool_error(line, strip=False)
|
||||
self.io.tool_error(str(err), strip=False)
|
||||
return None, err
|
||||
else:
|
||||
self.io.tool_error(f"Malformed response #{self.apply_update_errors}, aborting.")
|
||||
self.io.tool_error("https://aider.chat/docs/faq.html#aider-isnt-editing-my-files")
|
||||
for line in str(err).splitlines():
|
||||
self.io.tool_error(line, strip=False)
|
||||
self.io.tool_error(str(err), strip=False)
|
||||
return False, None
|
||||
|
||||
except git.exc.GitCommandError as err:
|
||||
|
@ -1122,11 +1120,11 @@ class Coder:
|
|||
self.apply_update_errors += 1
|
||||
if self.apply_update_errors < self.max_apply_update_errors:
|
||||
self.io.tool_error(f"Update exception #{self.apply_update_errors}, retrying...")
|
||||
self.io.tool_error(str(err))
|
||||
self.io.tool_error(str(err), strip=False)
|
||||
return None, str(err)
|
||||
else:
|
||||
self.io.tool_error(f"Update exception #{self.apply_update_errors}, aborting")
|
||||
self.io.tool_error(str(err))
|
||||
self.io.tool_error(str(err), strip=False)
|
||||
return False, None
|
||||
|
||||
self.apply_update_errors = 0
|
||||
|
|
|
@ -329,6 +329,10 @@ class InputOutput:
|
|||
self.num_error_outputs += 1
|
||||
|
||||
if message.strip():
|
||||
if "\n" in message:
|
||||
for line in message.splitlines():
|
||||
self.append_chat_history(line, linebreak=True, blockquote=True)
|
||||
else:
|
||||
if strip:
|
||||
hist = message.strip()
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue