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.

Stabilize paginated time hints

cyhde81e91aa1d8
diff --git a/tests/test_cli_pagination.py b/tests/test_cli_pagination.py
index 9ccaf971a..193b3166d 100644
--- a/tests/test_cli_pagination.py
+++ b/tests/test_cli_pagination.py
@@ -116,6 +116,33 @@ def test_runs_list_cli_normalizes_offset_time_filters(monkeypatch, tmp_path, cap
assert [item["id"] for item in payload["runs"]] == ["run-after"]
+def test_runs_list_cli_next_command_uses_absolute_time_filters(monkeypatch, tmp_path, capsys) -> None:
+ monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))
+ paths.ensure_data_dirs()
+ store = SQLiteBackgroundTaskStore()
+ try:
+ for index in range(25):
+ store.enqueue_run(
+ {
+ "id": f"run-{index:02d}",
+ "request_type": "agent_run",
+ "status": "succeeded",
+ "created_at": f"2026-05-25T00:{index:02d}:00+00:00",
+ "updated_at": f"2026-05-25T00:{index:02d}:00+00:00",
+ }
+ )
+ finally:
+ store.close()
+
+ args = cli.build_parser().parse_args(["runs", "list", "--created-after", "2026-05-25T08:00:00+08:00", "--limit", "10"])
+ assert cli.cmd_runs_list(args) == 0
+
+ payload = json.loads(capsys.readouterr().out)
+ assert "--created-after 2026-05-25T00:00:00+00:00" in payload["pagination"]["next_command"]
+ assert "--created-after 2026-05-25T08:00:00+08:00" not in payload["pagination"]["next_command"]
+ assert payload["pagination"]["next_command"].endswith("--page 2 --limit 10")
+
+
def test_data_query_cli_runs_read_only_sql(monkeypatch, tmp_path, capsys) -> None:
monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))
paths.ensure_data_dirs()
diff --git a/tests/test_show_pages.py b/tests/test_show_pages.py
index c6b96db07..4268a9d13 100644
--- a/tests/test_show_pages.py
+++ b/tests/test_show_pages.py
@@ -238,6 +238,29 @@ def test_show_list_cli_json_reports_pagination(monkeypatch, tmp_path, capsys):
assert "还有更多记录" in payload["message"]
+def test_show_list_cli_next_command_uses_absolute_time_filters(monkeypatch, tmp_path, capsys):
+ monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))
+ paths.ensure_data_dirs()
+ _save_config()
+
+ store = ShowPageStore()
+ try:
+ for index in range(25):
+ store.ensure(f"ses-page-{index:02d}")
+ finally:
+ store.close()
+
+ args = cli.build_parser().parse_args(
+ ["show", "list", "--json", "--updated-after", "2026-05-25T08:00:00+08:00", "--limit", "10"]
+ )
+ assert cli.cmd_show_list(args) == 0
+
+ payload = json.loads(capsys.readouterr().out)
+ assert "--updated-after 2026-05-25T00:00:00+00:00" in payload["pagination"]["next_command"]
+ assert "--updated-after 2026-05-25T08:00:00+08:00" not in payload["pagination"]["next_command"]
+ assert payload["pagination"]["next_command"].endswith("--json --page 2 --limit 10")
+
+
def test_show_list_cli_filters_visibility(monkeypatch, tmp_path, capsys):
monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))
paths.ensure_data_dirs()
diff --git a/vibe/cli.py b/vibe/cli.py
index 24606100f..27ab00e39 100644
--- a/vibe/cli.py
+++ b/vibe/cli.py
@@ -2700,8 +2700,8 @@ def cmd_runs_list(args):
_add_optional_arg(command, "--backend", getattr(args, "backend", None))
_add_optional_arg(command, "--session-id", getattr(args, "session_id", None))
_add_optional_arg(command, "--definition-id", getattr(args, "definition_id", None))
- _add_optional_arg(command, "--created-after", getattr(args, "created_after", None))
- _add_optional_arg(command, "--created-before", getattr(args, "created_before", None))
+ _add_optional_arg(command, "--created-after", created_after)
+ _add_optional_arg(command, "--created-before", created_before)
_add_optional_arg(command, "--q", getattr(args, "query", None))
if getattr(args, "brief", False):
command.append("--brief")
@@ -4009,8 +4009,8 @@ def cmd_show_list(args):
command = ["vibe", "show", "list"]
_add_optional_arg(command, "--visibility", getattr(args, "visibility", None))
_add_optional_arg(command, "--session-id", getattr(args, "session_id", None))
- _add_optional_arg(command, "--updated-after", getattr(args, "updated_after", None))
- _add_optional_arg(command, "--updated-before", getattr(args, "updated_before", None))
+ _add_optional_arg(command, "--updated-after", updated_after)
+ _add_optional_arg(command, "--updated-before", updated_before)
_add_optional_arg(command, "--q", getattr(args, "query", None))
if getattr(args, "json", False):
command.append("--json")