Skip to content

Commit 235d592

Browse files
committed
Remove analytics entirely
1 parent 4cfec24 commit 235d592

12 files changed

Lines changed: 43 additions & 763 deletions

File tree

aider/analytics.py

Lines changed: 0 additions & 258 deletions
This file was deleted.

aider/args.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -687,28 +687,28 @@ def get_parser(default_config_files, git_root):
687687
"--analytics",
688688
action=argparse.BooleanOptionalAction,
689689
default=None,
690-
help="Enable/disable analytics for current session (default: random)",
690+
help=argparse.SUPPRESS,
691691
)
692692
group.add_argument(
693693
"--analytics-log",
694694
metavar="ANALYTICS_LOG_FILE",
695-
help="Specify a file to log analytics events",
695+
help=argparse.SUPPRESS,
696696
).complete = shtab.FILE
697697
group.add_argument(
698698
"--analytics-disable",
699699
action="store_true",
700-
help="Permanently disable analytics",
700+
help=argparse.SUPPRESS,
701701
default=False,
702702
)
703703
group.add_argument(
704704
"--analytics-posthog-host",
705705
metavar="ANALYTICS_POSTHOG_HOST",
706-
help="Send analytics to custom PostHog instance",
706+
help=argparse.SUPPRESS,
707707
)
708708
group.add_argument(
709709
"--analytics-posthog-project-api-key",
710710
metavar="ANALYTICS_POSTHOG_PROJECT_API_KEY",
711-
help="Send analytics to custom PostHog project",
711+
help=argparse.SUPPRESS,
712712
)
713713

714714
#########

aider/coders/base_coder.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
from rich.console import Console
3636

3737
from aider import __version__, models, prompts, urls, utils
38-
from aider.analytics import Analytics
3938
from aider.commands import Commands, SwitchCoder
4039
from aider.exceptions import LiteLLMExceptions
4140
from aider.helpers import coroutines
@@ -365,7 +364,6 @@ def __init__(
365364
commands=None,
366365
summarizer=None,
367366
total_cost=0.0,
368-
analytics=None,
369367
map_refresh="auto",
370368
cache_prompts=False,
371369
num_cache_warming_pings=0,
@@ -391,10 +389,6 @@ def __init__(
391389
# initialize from args.map_cache_dir
392390
self.map_cache_dir = map_cache_dir
393391

394-
# Fill in a dummy Analytics if needed, but it is never .enable()'d
395-
self.analytics = analytics if analytics is not None else Analytics()
396-
397-
self.event = self.analytics.event
398392
self.chat_language = chat_language
399393
self.commit_language = commit_language
400394
self.commit_before_message = []
@@ -2135,8 +2129,6 @@ async def check_tokens(self, messages):
21352129
return True
21362130

21372131
async def send_message(self, inp):
2138-
self.event("message_send_starting")
2139-
21402132
# Notify IO that LLM processing is starting
21412133
self.io.llm_started()
21422134

@@ -2234,7 +2226,6 @@ async def send_message(self, inp):
22342226
lines = traceback.format_exception(type(err), err, err.__traceback__)
22352227
self.io.tool_warning("".join(lines))
22362228
self.io.tool_error(str(err))
2237-
self.event("message_send_exception", exception=str(err))
22382229
return
22392230
finally:
22402231
if self.mdstream:
@@ -3392,19 +3383,6 @@ def show_usage_report(self):
33923383
self.io.tool_output(self.usage_report)
33933384
self.io.rule()
33943385

3395-
prompt_tokens = self.message_tokens_sent
3396-
completion_tokens = self.message_tokens_received
3397-
self.event(
3398-
"message_send",
3399-
main_model=self.main_model,
3400-
edit_format=self.edit_format,
3401-
prompt_tokens=prompt_tokens,
3402-
completion_tokens=completion_tokens,
3403-
total_tokens=prompt_tokens + completion_tokens,
3404-
cost=self.message_cost,
3405-
total_cost=self.total_cost,
3406-
)
3407-
34083386
self.message_cost = 0.0
34093387
self.message_tokens_sent = 0
34103388
self.message_tokens_received = 0

aider/commands.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ def matching_commands(self, inp):
362362

363363
async def run(self, inp):
364364
if inp.startswith("!"):
365-
self.coder.event("command_run")
366365
return await self.do_run("run", inp[1:])
367366

368367
res = self.matching_commands(inp)
@@ -371,11 +370,9 @@ async def run(self, inp):
371370
matching_commands, first_word, rest_inp = res
372371
if len(matching_commands) == 1:
373372
command = matching_commands[0][1:]
374-
self.coder.event(f"command_{command}")
375373
return await self.do_run(command, rest_inp)
376374
elif first_word in matching_commands:
377375
command = first_word[1:]
378-
self.coder.event(f"command_{command}")
379376
return await self.do_run(command, rest_inp)
380377
elif len(matching_commands) > 1:
381378
self.io.tool_error(f"Ambiguous command: {', '.join(matching_commands)}")
@@ -1293,7 +1290,6 @@ async def cmd_run(self, args, add_on_nonzero_exit=False):
12931290

12941291
async def cmd_exit(self, args):
12951292
"Exit the application"
1296-
self.coder.event("exit", reason="/exit")
12971293

12981294
for server in self.coder.mcp_servers:
12991295
try:
@@ -1461,7 +1457,6 @@ async def cmd_help(self, args):
14611457
self.basic_help()
14621458
return
14631459

1464-
self.coder.event("interactive help")
14651460
from aider.coders.base_coder import Coder
14661461

14671462
if not self.help:

0 commit comments

Comments
 (0)