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
33 changes: 0 additions & 33 deletions elroy/cli/bug_report.py

This file was deleted.

4 changes: 2 additions & 2 deletions elroy/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from ..tools.developer import do_print_config
from ..utils.clock import utc_now
from ..utils.utils import datetime_to_string
from .bug_report import create_bug_report_from_exception_if_confirmed
from .chat import handle_chat, handle_message_stdio
from .options import ElroyOption, get_resolved_params
from .updater import check_latest_version, check_updates
Expand Down Expand Up @@ -469,7 +468,8 @@ def chat(typer_ctx: typer.Context):
f"Tool use not supported by model {ctx.chat_model.name}. Try starting with --inline-tool-calls"
)
else:
create_bug_report_from_exception_if_confirmed(io, ctx, e)
# Re-raise the error instead of creating bug report
raise
finally:
shutdown_scheduler(wait=False)

Expand Down
5 changes: 0 additions & 5 deletions elroy/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@

RESULT_SET_LIMIT_COUNT = 5

REPO_ISSUES_URL = "https://github.com/elroy-bot/elroy/issues"

BUG_REPORT_LOG_LINES = 15


MODEL_SELECTION_CONFIG_PANEL = "Model Selection and Configuration"

EXIT = "exit"
Expand Down
57 changes: 1 addition & 56 deletions elroy/tools/developer.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import os
import platform
import sys
import urllib.parse
import webbrowser
from typing import Optional

from rich.table import Table
from rich.text import Text

from .. import __version__
from ..config.paths import get_home_dir, get_log_file_path
from ..core.constants import BUG_REPORT_LOG_LINES, REPO_ISSUES_URL, user_only_tool
from ..core.constants import user_only_tool
from ..core.ctx import ElroyContext
from ..core.logging import get_logger
from ..utils.clock import utc_now

logger = get_logger()

Expand Down Expand Up @@ -129,53 +124,3 @@ def do_print_config(ctx: ElroyContext, show_secrets=False) -> Table:
)

return table


@user_only_tool
def create_bug_report(
ctx: ElroyContext,
title: str,
description: Optional[str],
) -> None:
"""
Generate a bug report and open it as a GitHub issue.

Args:
title: The title for the bug report
description: Detailed description of the issue
"""
# Start building the report
report = [
f"# Bug Report: {title}",
f"\nCreated: {utc_now().isoformat()}",
"\n## Description",
description if description else "",
]

# Add system information
report.extend(
[
"\n## System Information",
f"OS: {platform.system()} {platform.release()}",
f"Python: {sys.version}",
f"Elroy Version: {__version__}",
]
)

report.append(f"\n## Recent Logs (last {BUG_REPORT_LOG_LINES} lines)")
try:
logs = tail_elroy_logs(BUG_REPORT_LOG_LINES)
report.append("```")
report.append(logs)
report.append("```")
except Exception as e:
report.append(f"Error fetching logs: {str(e)}")

# Combine the report
full_report = "\n".join(report)

github_url = None
base_url = os.path.join(REPO_ISSUES_URL, "new")
params = {"title": title, "body": full_report}
github_url = f"{base_url}?{urllib.parse.urlencode(params)}"
webbrowser.open(github_url)
3 changes: 1 addition & 2 deletions elroy/tools/tools_and_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
set_user_full_name,
set_user_preferred_name,
)
from .developer import create_bug_report, print_config, tail_elroy_logs
from .developer import print_config, tail_elroy_logs
from .time import get_current_date

IN_CONTEXT_MEMORY_COMMANDS: Set[Callable] = {
Expand Down Expand Up @@ -115,7 +115,6 @@
search_memories,
print_active_reminders,
print_inactive_reminders,
create_bug_report,
set_assistant_name,
}
ASSISTANT_VISIBLE_COMMANDS: Set[Callable] = {
Expand Down