Skip to content

fix: json mode and human mode disagree on exit codes and aggregates#724

Open
andriypolanski wants to merge 6 commits intoentrius:testfrom
andriypolanski:fix/json-mode-and-human-mode-disagree
Open

fix: json mode and human mode disagree on exit codes and aggregates#724
andriypolanski wants to merge 6 commits intoentrius:testfrom
andriypolanski:fix/json-mode-and-human-mode-disagree

Conversation

@andriypolanski
Copy link
Copy Markdown

Summary

  1. gitt issues list --id — Missing on-chain issue: JSON already exited non-zero with a structured error; human mode exited 0 after a soft warning. Both paths now use the same helper as other issue commands (handle_exception) so exit code and error shape stay consistent.

  2. gitt miner check --json-output — The top-level invalid count mixed “no PAT” (has_pat is False) with “invalid PAT” rows. JSON now exposes no_pat, invalid_pat, and no_response (plus valid), matching the human table semantics. invalid is removed from the JSON payload (breaking change for scripts that read that field).

Related Issues

Closes #723

Type of Changes

  • Bug Fix

Tests

  • tests/cli/test_issues_list_json.pytest_issues_list_human_missing_issue_exits_non_zero
  • tests/cli/test_miner_commands.pyTestPatCheckAggregateCounts (imports _pat_check_aggregate_counts from miner helpers)

Migration notes (miner check JSON)

  • Replace reads of invalid with no_pat + invalid_pat, or derive from results.
  • no_response still means rows classified as no response (including cases that do not match the other three categories).

Test plan

pytest tests/cli/test_issues_list_json.py -q
pytest tests/cli/test_miner_commands.py::TestPatCheckAggregateCounts -q

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Apr 22, 2026
@andriypolanski
Copy link
Copy Markdown
Author

@anderdc
I just resolved conflict with https://github.com/entrius/gittensor/pull/724/conflicts
Please review.

@andriypolanski
Copy link
Copy Markdown
Author

andriypolanski commented Apr 24, 2026

@anderdc
Could you please let me know why task check is failed?
If leave comment, I will fix constantly.

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 25, 2026

Fix CI

@andriypolanski
Copy link
Copy Markdown
Author

@anderdc
Sorry, Could you please let me know what I have to do?
Thanks

@betviosun betviosun force-pushed the fix/json-mode-and-human-mode-disagree branch from 86b212c to 803b8cd Compare April 25, 2026 15:03
@andriypolanski
Copy link
Copy Markdown
Author

andriypolanski commented Apr 25, 2026

Hi, @anderdc
I just checked failed CI test and fixed.
Please review again.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent exit codes and JSON aggregate semantics vs human tables

2 participants