From cc0e443236f0892456fe1b0aa9755fe85cdcaae8 Mon Sep 17 00:00:00 2001 From: Thykof Date: Thu, 18 Jun 2026 21:34:46 +0200 Subject: [PATCH] fix(config): enable bittensor CLI arg parsing (BT_NO_PARSE_CLI_ARGS) bittensor 10.4.x disables CLI parsing by default (BT_NO_PARSE_CLI_ARGS defaults to "true"), so bt.Config(parser) ignored every --flag and returned only DEFAULTS: config.neuron was None (crashing check_config with 'NoneType' has no attribute 'name'), netuid was dropped, and subtensor stayed on finney. Our neurons are configured entirely via CLI flags, so set BT_NO_PARSE_CLI_ARGS=false inside config() before building the Config. Scoped to config() (not module import) so it never makes bittensor's logging machine parse pytest's argv during the test suite. Co-Authored-By: Claude Opus 4.8 (1M context) --- synth/utils/config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/synth/utils/config.py b/synth/utils/config.py index 85a68d62..f9be0930 100644 --- a/synth/utils/config.py +++ b/synth/utils/config.py @@ -275,6 +275,13 @@ def config(cls): """ Returns the configuration object specific to this miner or validator after adding relevant arguments. """ + # bittensor 10.4.x disables CLI argument parsing unless BT_NO_PARSE_CLI_ARGS + # is explicitly falsy (it defaults to "true"). Our neurons are configured + # entirely through CLI flags, so without this bt.Config(parser) ignores + # every --flag and returns only DEFAULTS (config.neuron is None, subtensor + # on finney, etc.). Scoped here (not module level) so it only affects + # neuron config building, never bittensor's logging machine under pytest. + os.environ.setdefault("BT_NO_PARSE_CLI_ARGS", "false") parser = argparse.ArgumentParser() bt.Wallet.add_args(parser) bt.Subtensor.add_args(parser)