From df789e3a489c12684f4600250ecb2025803d0781 Mon Sep 17 00:00:00 2001 From: BD Himes Date: Wed, 18 Feb 2026 14:20:51 +0200 Subject: [PATCH] Handle `MechId` type in call crafter, and raise appropriate error if type not handleable --- bittensor_cli/src/commands/sudo.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bittensor_cli/src/commands/sudo.py b/bittensor_cli/src/commands/sudo.py index ec6d1461c..deb2aa04b 100644 --- a/bittensor_cli/src/commands/sudo.py +++ b/bittensor_cli/src/commands/sudo.py @@ -126,8 +126,19 @@ def type_converter_with_retry(type_, val, arg_name): return arg_types[type_](val) except ValueError: return type_converter_with_retry(type_, None, arg_name) + except KeyError: + print_error( + f"Type {type_} is not recognized. " + "You will be unable to set this parameter via this command.\n" + "Some hyperparams must be set by their dedicated command, such as `btcli subnets mech`" + ) - arg_types = {"bool": string_to_bool, "u16": string_to_u16, "u64": string_to_u64} + arg_types = { + "bool": string_to_bool, + "u16": string_to_u16, + "u64": string_to_u64, + "MechId": int, + } arg_type_output = {"bool": "bool", "u16": "float", "u64": "float"} call_crafter = {"netuid": netuid}