Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aider/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from packaging import version

__version__ = "0.88.34.dev"
__version__ = "0.88.35.dev"
safe_version = __version__

try:
Expand Down
2 changes: 1 addition & 1 deletion aider/coders/chat_chunks.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def cacheable_messages(self):
return messages[: len(messages) - i]
return messages

def format_list(chunk):
def format_list(self, chunk):
if type(chunk) is not list:
return []

Expand Down
78 changes: 37 additions & 41 deletions aider/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,51 +496,47 @@ def expand_glob_patterns(patterns, root="."):


def custom_tracer(frame, event, arg):
try:
import os
import os

global log_file
if not log_file:
os.makedirs(".aider/logs/", exist_ok=True)
log_file = open(".aider/logs/debug.log", "w", buffering=1)

# Get the absolute path of the file where the code is executing
filename = os.path.abspath(frame.f_code.co_filename)

# --- THE FILTERING LOGIC ---
# Only proceed if the file path is INSIDE the project root
if not filename.startswith(PROJECT_ROOT):
return None # Returning None means no local trace function for this scope

if filename.endswith("repo.py"):
return None

# If it's your code, trace the call
if event == "call":
func_name = frame.f_code.co_name
line_no = frame.f_lineno

if func_name not in file_excludelist:
log_file.write(
f"-> CALL: {func_name}() in {os.path.basename(filename)}:{line_no} -"
f" {time.time()}\n"
)
global log_file
if not log_file:
os.makedirs(".aider/logs/", exist_ok=True)
log_file = open(".aider/logs/debug.log", "w", buffering=1)

if event == "return":
func_name = frame.f_code.co_name
line_no = frame.f_lineno
# Get the absolute path of the file where the code is executing
filename = os.path.abspath(frame.f_code.co_filename)

if func_name not in file_excludelist:
log_file.write(
f"<- RETURN: {func_name}() in {os.path.basename(filename)}:{line_no} -"
f" {time.time()}\n"
)
# --- THE FILTERING LOGIC ---
# Only proceed if the file path is INSIDE the project root
if not filename.startswith(PROJECT_ROOT):
return None # Returning None means no local trace function for this scope

except Exception:
pass
finally:
# Must return the trace function (or a local one) for subsequent events
return custom_tracer
if filename.endswith("repo.py"):
return None

# If it's your code, trace the call
if event == "call":
func_name = frame.f_code.co_name
line_no = frame.f_lineno

if func_name not in file_excludelist:
log_file.write(
f"-> CALL: {func_name}() in {os.path.basename(filename)}:{line_no} -"
f" {time.time()}\n"
)

if event == "return":
func_name = frame.f_code.co_name
line_no = frame.f_lineno

if func_name not in file_excludelist:
log_file.write(
f"<- RETURN: {func_name}() in {os.path.basename(filename)}:{line_no} -"
f" {time.time()}\n"
)

# Must return the trace function (or a local one) for subsequent events
return custom_tracer


def main(argv=None, input=None, output=None, force_git_root=None, return_coder=False):
Expand Down
Loading