From 59640d20a45e76e39ecf1327bcddd9a55357a498 Mon Sep 17 00:00:00 2001 From: Fede Luzzi Date: Tue, 17 Nov 2026 12:11:02 -0300 Subject: [PATCH] feat(spec-05-auth-fallback-chain): worker (eng_flash_high) implementation --- connpy/completion.py | 19 ++++++++++++++++++- connpy/tests/test_completion.py | 15 +++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/connpy/completion.py b/connpy/completion.py index c4ae457..5ac11b9 100755 --- a/connpy/completion.py +++ b/connpy/completion.py @@ -248,9 +248,26 @@ def _build_tree(nodes, folders, profiles, plugins, configdir): "--fzf-wrapper": ["bash", "zsh"], "--service-mode": ["local", "remote"], "--sync-remote": ["true", "false"], + "--disable-fallback-on-insecure-hostkey": ["true", "false"], "--help": None, "-h": None, } - for opt in ["--keepalive", "--engineer-model", "--engineer-api-key", "--architect-model", "--architect-api-key", "--theme", "--remote", "--trusted-commands", "--shell-command", "--shell-prompt", "--shell-os"]: + for opt in [ + "--keepalive", + "--engineer-model", + "--engineer-api-key", + "--architect-model", + "--architect-api-key", + "--theme", + "--remote", + "--trusted-commands", + "--shell-command", + "--shell-prompt", + "--shell-os", + "--max-auth-prompts", + "--max-total-auth-attempts", + "--max-hop-host-attempts", + "--max-global-user-attempts", + ]: config_dict[opt] = {"*": config_dict} config_dict["--configfolder"] = {"__extra__": lambda w: get_cwd(w, "--configfolder", True), "*": config_dict} config_dict["--engineer-auth"] = {"__extra__": lambda w: get_cwd(w, "--engineer-auth"), "*": config_dict} diff --git a/connpy/tests/test_completion.py b/connpy/tests/test_completion.py index 2d4694b..b67649e 100644 --- a/connpy/tests/test_completion.py +++ b/connpy/tests/test_completion.py @@ -80,11 +80,22 @@ class TestTreeCompletions: assert "--shell-command" in config_completions assert "--shell-prompt" in config_completions assert "--shell-os" in config_completions + assert "--max-auth-prompts" in config_completions + assert "--max-total-auth-attempts" in config_completions + assert "--max-hop-host-attempts" in config_completions + assert "--max-global-user-attempts" in config_completions + assert "--disable-fallback-on-insecure-hostkey" in config_completions # Resolve when --engineer-auth is chosen in config auth_comp = resolve_completion(["config", "--engineer-auth", ""], tree) assert isinstance(auth_comp, list) + # Resolve boolean values for --disable-fallback-on-insecure-hostkey + assert resolve_completion( + ["config", "--disable-fallback-on-insecure-hostkey", ""], + tree, + ) == ["true", "false"] + # Loop back check: # e.g., connpy config --engineer-auth some_val # should loop back and resolve to config options @@ -93,6 +104,10 @@ class TestTreeCompletions: assert "--engineer-auth" in loop_back_comp assert "--shell-command" in loop_back_comp + auth_budget_loop_back = resolve_completion(["config", "--max-auth-prompts", "3", ""], tree) + assert "--max-total-auth-attempts" in auth_budget_loop_back + assert "--disable-fallback-on-insecure-hostkey" in auth_budget_loop_back + def test_shell_completions(self): from connpy.completion import _build_tree, resolve_completion tree = _build_tree([], [], [], {}, "/tmp")