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.19.dev"
__version__ = "0.88.20.dev"
safe_version = __version__

try:
Expand Down
4 changes: 2 additions & 2 deletions aider/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,9 +1257,9 @@ async def cmd_exit(self, args):
except Exception:
sys.exit()

def cmd_quit(self, args):
async def cmd_quit(self, args):
"Exit the application"
self.cmd_exit(args)
await self.cmd_exit(args)

def cmd_context_management(self, args=""):
"Toggle context management for large files"
Expand Down
2 changes: 1 addition & 1 deletion aider/helpers/similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def create_bigram_vector(texts):
chars = np.array(list(text_lower))

# Create bigrams by combining consecutive characters
bigrams = np.core.defchararray.add(chars[:-1], chars[1:])
bigrams = np.char.add(chars[:-1], chars[1:])

# Filter only alphabetic bigrams
mask = np.array([bg.isalpha() for bg in bigrams])
Expand Down
2 changes: 2 additions & 0 deletions aider/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def __init__(
self.command_completions = dict()
if commands:
self.command_names = self.commands.get_commands()
else:
self.command_names = []

for rel_fname in addable_rel_fnames:
self.words.add(rel_fname)
Expand Down
3 changes: 2 additions & 1 deletion aider/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from aider.models import ModelSettings
from aider.onboarding import offer_openrouter_oauth, select_default_model
from aider.repo import ANY_GIT_ERROR, GitRepo
from aider.report import report_uncaught_exceptions
from aider.report import report_uncaught_exceptions, set_args_error_data
from aider.versioncheck import check_version, install_from_main_branch, install_upgrade
from aider.watch import FileWatcher

Expand Down Expand Up @@ -576,6 +576,7 @@ async def main_async(argv=None, input=None, output=None, force_git_root=None, re

# Parse again to include any arguments that might have been defined in .env
args = parser.parse_args(argv)
set_args_error_data(args)

if args.debug:
global log_file
Expand Down
62 changes: 61 additions & 1 deletion aider/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
from aider.urls import github_issues
from aider.versioncheck import VERSION_CHECK_FNAME

# Global variable to store resolved args data for error reporting
resolved_args_data = None

FENCE = "`" * 3


Expand All @@ -34,6 +37,54 @@ def get_git_info():
return "Git information unavailable"


def format_args_for_reporting(args):
"""
Format args data for error reporting, removing sensitive keys and collapsing MCP servers.
"""
if not args:
return "No args data available"

# Create a copy of the args namespace as a dictionary
args_dict = vars(args).copy()

# Remove any keys containing "key" (case insensitive)
keys_to_remove = [key for key in args_dict.keys() if "key" in key.lower()]
for key in keys_to_remove:
args_dict.pop(key, None)

# Handle mcp_servers - collapse into just a list of server names
if "mcp_servers" in args_dict:
mcp_servers = args_dict["mcp_servers"]
if isinstance(mcp_servers, str):
try:
import json

config = json.loads(mcp_servers)
if "mcpServers" in config:
server_names = list(config["mcpServers"].keys())
args_dict["mcp_servers"] = server_names
except (json.JSONDecodeError, AttributeError):
# If parsing fails, keep the original value
pass

# Format the output line by line
lines = ["Configuration:"]
for key, value in sorted(args_dict.items()):
lines.append(f"{key}: {value}")

return "\n".join(lines)


def get_args_error_data():
global resolved_args_data
return resolved_args_data


def set_args_error_data(args):
global resolved_args_data
resolved_args_data = args


def report_github_issue(issue_text, title=None, confirm=True):
"""
Compose a URL to open a new GitHub issue with the given text prefilled,
Expand All @@ -50,9 +101,18 @@ def report_github_issue(issue_text, title=None, confirm=True):
python_info = get_python_info() + "\n"
os_info = get_os_info() + "\n"
git_info = get_git_info() + "\n"
args_info = format_args_for_reporting(get_args_error_data()) + "\n"

system_info = (
version_info + python_version + platform_info + python_info + os_info + git_info + "\n"
version_info
+ python_version
+ platform_info
+ python_info
+ os_info
+ git_info
+ "\n"
+ args_info
+ "\n"
)

issue_text = system_info + issue_text
Expand Down
4 changes: 2 additions & 2 deletions aider/versioncheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def install_upgrade(io, latest_version=None):
"""

if latest_version:
new_ver_text = f"Newer aider version v{latest_version} is available."
new_ver_text = f"Newer aider-ce version v{latest_version} is available."
else:
new_ver_text = "Install latest version of aider?"

Expand All @@ -50,7 +50,7 @@ async def install_upgrade(io, latest_version=None):
io,
None,
new_ver_text,
["aider-chat"],
["aider-ce"],
self_update=True,
)

Expand Down
Loading