Skip to content
Open
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
12 changes: 10 additions & 2 deletions rogue/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ def common_parser() -> ArgumentParser:
default="localhost",
help="Host for the example agent (default: localhost)",
)
parent_parser.add_argument(
"--force-reinstall",
action="store_true",
default=False,
help="Force reinstallation of the TUI.",
)
parent_parser.add_argument(
"--example-port",
type=int,
Expand Down Expand Up @@ -226,7 +232,7 @@ def main() -> None:
logger.info("Starting rogue-ai...")

# Step 1: Install rogue-tui if needed
if not RogueTuiInstaller().install_rogue_tui():
if not RogueTuiInstaller().install_rogue_tui(force=args.force_reinstall):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify all call sites have been updated with the force parameter.

The usage here is correct. However, based on the PR comments, there appears to be at least one more call to install_rogue_tui() in rogue/common/update_checker.py that may need updating to align with the new signature.

Run the following script to find all call sites:


🏁 Script executed:

#!/bin/bash
# Description: Find all calls to install_rogue_tui in the codebase to ensure the new parameter is handled consistently.

# Search for all invocations of install_rogue_tui method
rg -n -C3 '\.install_rogue_tui\('

Length of output: 1353


Let me search for the install_rogue_tui function definition to verify the expected parameters:The web search results are not relevant to the specific codebase. Let me search the codebase for the function definition directly:


</shell>

---

🏁 Script executed:

```shell
#!/bin/bash
# Find the definition of install_rogue_tui to verify the expected parameters
ast-grep --pattern 'def install_rogue_tui($$$) {
  $$$
}'

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Alternative: search for the method definition with rg
rg -n -A10 'def install_rogue_tui'

Length of output: 766


🏁 Script executed:

#!/bin/bash
# Search in Python files for the function signature
rg -n -B2 -A8 'def install_rogue_tui'

Length of output: 714


🏁 Script executed:

#!/bin/bash
# Check the update_checker.py file to see context around line 220
cat rogue/common/update_checker.py | sed -n '210,230p'

Length of output: 815


🏁 Script executed:

#!/bin/bash
# Check the RogueTuiInstaller class definition
rg -n -B3 -A15 'class RogueTuiInstaller'

Length of output: 1213


🏁 Script executed:

#!/bin/bash
# Verify if there are any changes to the function signature in the PR
rg -n 'def install_rogue_tui' --type py

Length of output: 95


Fix call to install_rogue_tui() in rogue/common/update_checker.py—parameter name mismatch.

The function signature expects a force parameter, but line 220 in rogue/common/update_checker.py passes upgrade=True instead. Update this call to use force=True:

# rogue/common/update_checker.py:220-222
RogueTuiInstaller().install_rogue_tui(
    force=True,
)
🤖 Prompt for AI Agents
In rogue/common/update_checker.py around lines 220-222, the call to
RogueTuiInstaller().install_rogue_tui(...) uses the wrong keyword argument name
(upgrade=True); change that argument to force=True so it matches the function
signature (i.e., call RogueTuiInstaller().install_rogue_tui(force=True)), and
run tests/lint to ensure no other call sites use the incorrect keyword.

logger.error("Failed to install rogue-tui. Exiting.")
if example_process:
example_process.terminate()
Expand Down Expand Up @@ -273,7 +279,9 @@ def main() -> None:
exit_code = asyncio.run(run_cli(args))
sys.exit(exit_code)
elif args.mode == "tui":
if not RogueTuiInstaller().install_rogue_tui():
if not RogueTuiInstaller().install_rogue_tui(
force=args.force_reinstall
):
logger.error("Failed to install rogue-tui. Exiting.")
sys.exit(1)
exit_code = run_rogue_tui()
Expand Down
16 changes: 10 additions & 6 deletions rogue/common/tui_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,18 @@ def _is_rogue_tui_installed(self) -> bool:
else:
return False

def install_rogue_tui(
self,
upgrade: bool = False,
) -> bool:
"""Install rogue-tui from GitHub releases if not already installed."""
def install_rogue_tui(self, force: bool = False) -> bool:
"""Install rogue-tui from GitHub releases if not already installed.

Args:
force: Force installation even if already installed.

Returns:
bool: True if installation succeeded, False otherwise.
"""
console = Console()
# Check if rogue-tui is already available
if self._is_rogue_tui_installed() and not upgrade:
if self._is_rogue_tui_installed() and not force:
console.print("[green]✅ rogue-tui is already installed.[/green]")
return True

Expand Down