Skip to content

Commit e86d362

Browse files
committed
fix(onboard,doctor): don't install daemon without token; fix bot-status hint; show praisonaiagents version
- onboard: refuse to install daemon when no token was captured for the selected platforms (previously it installed a broken service that would crash-loop). Lists missing platforms and tells the user to rerun onboard with credentials. - onboard: daemon-install default flipped to YES when tokens are present (matches hermes UX; previously default NO left bots offline by default). - onboard: final panel now references 'praisonai gateway status' (real command) instead of 'praisonai bot status' (doesn't exist). - doctor: resolve praisonaiagents version via importlib.metadata (the package does not expose __version__), so the check no longer reports 'praisonaiagents unknown installed'.
1 parent 79b6796 commit e86d362

2 files changed

Lines changed: 31 additions & 5 deletions

File tree

src/praisonai/praisonai/cli/features/doctor/checks/env_checks.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,16 @@ def check_praisonaiagents_package(config: DoctorConfig) -> CheckResult:
9696
"""Check praisonaiagents package is installed."""
9797
try:
9898
import praisonaiagents
99-
version = getattr(praisonaiagents, "__version__", "unknown")
99+
# praisonaiagents does not expose __version__ at module level yet, so
100+
# prefer importlib.metadata (which reads the installed dist-info) and
101+
# fall back to the attribute for forward-compat.
102+
version = getattr(praisonaiagents, "__version__", None)
103+
if not version:
104+
try:
105+
from importlib.metadata import version as _pkg_version
106+
version = _pkg_version("praisonaiagents")
107+
except Exception:
108+
version = "unknown"
100109
return CheckResult(
101110
id="praisonaiagents_package",
102111
title="PraisonAI Agents Package",

src/praisonai/praisonai/cli/features/onboard.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,24 @@ def _mask(value: str) -> str:
424424
console.print(f" [green]✓[/green] Written to {self.config_path}")
425425

426426
# Step 6: Optional daemon install
427-
if Confirm.ask("\nInstall as background service (daemon)?", default=False):
427+
# Guard: refuse to install a daemon that has no tokens — it would loop
428+
# in a crash-restart cycle. List the platforms missing tokens so the
429+
# user can rerun onboard once they have them.
430+
missing_tokens = [
431+
PLATFORMS[p]["name"]
432+
for p in self.selected_platforms
433+
if p not in self.tokens
434+
]
435+
if missing_tokens:
436+
console.print(
437+
f"\n [yellow]⚠[/yellow] Skipping daemon install — missing token(s) for: "
438+
f"[bold]{', '.join(missing_tokens)}[/bold]."
439+
)
440+
console.print(
441+
" [dim]Re-run [cyan]praisonai onboard[/cyan] once you have the token(s) and "
442+
"the service will be installed automatically.[/dim]"
443+
)
444+
elif Confirm.ask("\nInstall as background service (daemon)?", default=True):
428445
try:
429446
from praisonai.daemon import install_daemon
430447
result = install_daemon(config_path=self.config_path)
@@ -435,15 +452,15 @@ def _mask(value: str) -> str:
435452
except Exception as e:
436453
console.print(f" [red]✗[/red] {str(e)[:200]}")
437454

438-
# Done
455+
# Done — commands referenced here must exist in `praisonai --help`.
439456
console.print(Panel(
440457
f"[bold green]Setup complete![/bold green]\n\n"
441458
f"Start your bot:\n"
442459
f" [cyan]praisonai bot start --config {self.config_path}[/cyan]\n\n"
443460
f"Check health:\n"
444461
f" [cyan]praisonai doctor[/cyan]\n\n"
445-
f"View status:\n"
446-
f" [cyan]praisonai bot status[/cyan]",
462+
f"View gateway status:\n"
463+
f" [cyan]praisonai gateway status[/cyan]",
447464
title="✅ Done",
448465
border_style="green",
449466
))

0 commit comments

Comments
 (0)