Skip to content

Conversation

@GlobalStar117
Copy link

Fixes #635

Problem

Running btcli subnets list --json-out produced no output.

Root Cause

In dict_table() function, tao_flow_ema was already converted to a float via .tao, but line 604 tried to call .tao again, causing an AttributeError: 'float' object has no attribute 'tao'.

This error was silently swallowed, resulting in empty output.

Changes

  1. subnets.py: Fixed double .tao call on tao_flow_ema
  2. utils.py: Changed json_console to use force_terminal=True to ensure output in all environments

Testing

  • Verified btcli subnets list --json-out now produces valid JSON output
  • Tested with Python 3.12, BTCLI 9.17.0, finney network

thewhaleking and others added 2 commits December 22, 2025 20:44
Fixes opentensor#635

## Problem
Running `btcli subnets list --json-out` produced no output.

## Root Cause
In `dict_table()` function, `tao_flow_ema` was already converted to a float
via `.tao`, but line 604 tried to call `.tao` again, causing an
`AttributeError: 'float' object has no attribute 'tao'`.

This error was silently swallowed, resulting in empty output.

## Changes
1. `subnets.py`: Fixed double `.tao` call on `tao_flow_ema`
2. `utils.py`: Changed `json_console` to use `force_terminal=True`
   to ensure output in all environments

## Testing
- Verified `btcli subnets list --json-out` now produces valid JSON output
- Tested with Python 3.12, BTCLI 9.17.0, finney network
@ibraheem-abe
Copy link
Contributor

ibraheem-abe commented Jan 21, 2026

Thank you for your contribution. The fix is correct but I think we shouldn't change the force_terminal for json_ouputs.

This can possibly add ANSI escape sequences in some cases which can make the json_outputs malformed/in need of cleaning

Also, this branch needs to be targeted against staging

@ibraheem-abe ibraheem-abe changed the base branch from main to staging January 21, 2026 22:47
@ibraheem-abe ibraheem-abe merged commit b10f7f2 into opentensor:staging Jan 21, 2026
93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve JSON output

4 participants