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(tasks): preserve alias help metadata

cyh28f2ed9427d4
diff --git a/tests/test_cli_task_command.py b/tests/test_cli_task_command.py
index 964f5393e..bff947888 100644
--- a/tests/test_cli_task_command.py
+++ b/tests/test_cli_task_command.py
@@ -128,6 +128,19 @@ def test_task_add_parse_error_is_structured_json(capsys) -> None:
assert "--session-key SESSION_KEY" in payload["usage"]
+def test_task_remove_alias_parse_error_keeps_structured_guidance(capsys) -> None:
+ parser = cli.build_parser()
+
+ with pytest.raises(SystemExit) as exc:
+ parser.parse_args(["task", "rm"])
+
+ assert exc.value.code == 2
+ payload = json.loads(capsys.readouterr().err)
+ assert payload["code"] == "invalid_arguments"
+ assert payload["help_command"] == "vibe task remove --help"
+ assert "task_id" in payload["error"]
+
+
def test_task_add_rejects_invalid_session_key_with_hint() -> None:
args = _parse_task_add(
[
diff --git a/vibe/cli.py b/vibe/cli.py
index 8199a93ac..5149d1e9d 100644
--- a/vibe/cli.py
+++ b/vibe/cli.py
@@ -132,13 +132,15 @@ def _task_add_examples_text() -> str:
def _add_hidden_task_alias(task_subparsers, alias: str, parser) -> None:
- task_subparsers.add_parser(
+ alias_parser = task_subparsers.add_parser(
alias,
help=argparse.SUPPRESS,
parents=[parser],
add_help=False,
formatter_class=argparse.RawDescriptionHelpFormatter,
)
+ alias_parser.error_help_command = getattr(parser, "error_help_command", None)
+ alias_parser.error_hint = getattr(parser, "error_hint", None)
task_subparsers._choices_actions = [ # type: ignore[attr-defined]
action for action in task_subparsers._choices_actions if action.dest != alias # type: ignore[attr-defined]
]