project-chip / project-chip/certification-tool

[Bug] th-cli calls /api/v1/version on every invocation (slow when backend is unreachable)

Open Beginner friendly
#1,005 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug CLI
Dominant language
Shell
Stars
83
Forks
47
Avg merge
1d 15h
Merged PRs (30d)
17

Description

Describe the bug
Describe the bug

th-cli hits GET /api/v1/version on every invocation, not just --version. When the backend is down, every command (--help, available-tests, etc.) hangs until the HTTP client times out.

Steps to reproduce
  1. Stop the TH backend.
  2. Run th-cli --help.
  3. Observe a multi-second hang before help is printed.
Expected

Backend version lookup should run only when --version is requested.

Root cause

In cli/th_cli/main.py:

@click.version_option(message=get_extended_help())

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cli/th_cli/main.py, where the Click version option calls get_extended_help(), and reproduce the delay with the backend stopped using th-cli --help. Trace when the version lookup is evaluated. Done means --help and other commands no longer request /api/v1/version, while --version still performs the lookup.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.