project-chip / project-chip/certification-tool
[Bug] th-cli calls /api/v1/version on every invocation (slow when backend is unreachable)
Nobody has claimed this yet.
- 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
- Stop the TH backend.
- Run
th-cli --help. - 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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