MCPcopy
hub / github.com/Aider-AI/aider / append_chat_history

Method append_chat_history

aider/io.py:1117–1136  ·  view source on GitHub ↗
(self, text, linebreak=False, blockquote=False, strip=True)

Source from the content-addressed store, hash-verified

1115 )
1116
1117 def append_chat_history(self, text, linebreak=False, blockquote=False, strip=True):
1118 if blockquote:
1119 if strip:
1120 text = text.strip()
1121 text = "> " + text
1122 if linebreak:
1123 if strip:
1124 text = text.rstrip()
1125 text = text + " \n"
1126 if not text.endswith("\n"):
1127 text += "\n"
1128 if self.chat_history_file is not None:
1129 try:
1130 self.chat_history_file.parent.mkdir(parents=True, exist_ok=True)
1131 with self.chat_history_file.open("a", encoding=self.encoding, errors="ignore") as f:
1132 f.write(text)
1133 except (PermissionError, OSError) as err:
1134 print(f"Warning: Unable to write to chat history file {self.chat_history_file}.")
1135 print(err)
1136 self.chat_history_file = None # Disable further attempts to write
1137
1138 def format_files_for_input(self, rel_fnames, rel_read_only_fnames):
1139 if not self.pretty:

Callers 8

run_test_realFunction · 0.95
__init__Method · 0.95
user_inputMethod · 0.95
ai_outputMethod · 0.95
confirm_askMethod · 0.95
prompt_askMethod · 0.95
_tool_messageMethod · 0.95
tool_outputMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected