Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(cli): reject non-finite restart delays

cyh4e963d094ef5
diff --git a/tests/test_vibe_cli.py b/tests/test_vibe_cli.py
index ed72d8de5..446e6accb 100644
--- a/tests/test_vibe_cli.py
+++ b/tests/test_vibe_cli.py
@@ -1,5 +1,6 @@
import json
import os
+import pytest
import signal
import sys
from pathlib import Path
@@ -173,6 +174,14 @@ def test_restart_parser_accepts_delay_seconds():
assert args.delay_seconds == 60
[email protected]("raw_value", ["nan", "inf", "-inf"])
+def test_restart_parser_rejects_non_finite_delay_seconds(raw_value):
+ parser = cli.build_parser()
+
+ with pytest.raises(SystemExit):
+ parser.parse_args(["restart", "--delay-seconds", raw_value])
+
+
def test_stop_pid_handles_process_lookup_race(monkeypatch):
monkeypatch.setattr(runtime.os, "name", "posix", raising=False)
monkeypatch.setattr(runtime, "pid_alive", lambda pid: True)
diff --git a/vibe/cli.py b/vibe/cli.py
index 9cb28a4ff..05831cf39 100644
--- a/vibe/cli.py
+++ b/vibe/cli.py
@@ -1,6 +1,7 @@
import argparse
import json
import logging
+import math
import os
import shlex
import shutil
@@ -118,6 +119,8 @@ def _print_task_error(exc: Exception, *, help_command: str | None = None) -> Non
def _non_negative_float(value: str) -> float:
parsed = float(value)
+ if not math.isfinite(parsed):
+ raise argparse.ArgumentTypeError("must be finite")
if parsed < 0:
raise argparse.ArgumentTypeError("must be >= 0")
return parsed