fix(settings): show detected CLI version instead of build-time constant#2314
Open
kantord wants to merge 2 commits into
Open
fix(settings): show detected CLI version instead of build-time constant#2314kantord wants to merge 2 commits into
kantord wants to merge 2 commits into
Conversation
The Version tab displayed the static TOOLHIVE_VERSION constant (a renovate-managed value used to download thv at build time), which is stale in enterprise builds that bundle a different binary. Read the version from cliAlignment.getStatus().cliVersion instead — the same detected value the CLI tab shows — falling back to 'Unknown' when detection fails. Remove the now-unused getToolhiveVersion preload method. Also make the "v" prefix optional in parseVersionOutput, since the enterprise thv binary prints "ToolHive 0.1.39" without it, which made the CLI tab show "Unknown". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Version tab now shows the version detected from the bundled binary, which prints it without the "v" prefix the build-time constant carries. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the Settings → Version tab with the Settings → CLI tab by sourcing the displayed ToolHive binary version from the detected thv binary (via cliAlignment.getStatus()), instead of the build-time TOOLHIVE_VERSION constant. It also broadens CLI version parsing to accept thv version output with or without a leading v, and updates tests accordingly.
Changes:
- Version info hook now uses
cliAlignment.getStatus().cliVersionfor the displayed ToolHive binary version (fallback:"Unknown"). - Removed the preload
getToolhiveVersionAPI (build-time constant remains for other roles like downloads). - Updated/added unit, component, and e2e tests; CLI detection parsing now treats
vas optional.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| renderer/src/common/hooks/use-app-version.ts | Switches ToolHive binary version display to come from detected CLI status. |
| renderer/src/common/hooks/tests/use-app-version.test.ts | Adds coverage for detected CLI version + "Unknown" fallbacks. |
| renderer/src/common/components/settings/tabs/tests/settings-tabs.test.tsx | Updates settings tabs test setup to mock cliAlignment.getStatus() instead of preload version. |
| renderer/src/common/components/error/tests/technical-details.test.tsx | Updates error technical details test to mock CLI status for crash metadata. |
| preload/src/api/toolhive.ts | Removes the getToolhiveVersion preload API and constant import. |
| main/src/cli/cli-detection.ts | Makes v prefix optional when parsing thv version output. |
| main/src/cli/tests/cli-detection.test.ts | Adds tests for parsing versions with/without v, including prereleases. |
| e2e-tests/settings.spec.ts | Updates expectation to match detected CLI output format (no leading v). |
Comment on lines
41
to
+44
| toolhiveVersion: | ||
| toolhiveVersion.status === 'fulfilled' | ||
| ? toolhiveVersion.value | ||
| : 'N/A', | ||
| cliStatus.status === 'fulfilled' | ||
| ? (cliStatus.value.cliVersion ?? 'Unknown') | ||
| : 'Unknown', |
Comment on lines
+18
to
22
| const [version, release, cliStatus] = await Promise.allSettled([ | ||
| window.electronAPI.getAppVersion(), | ||
| window.electronAPI.isOfficialReleaseBuild(), | ||
| window.electronAPI.getToolhiveVersion(), | ||
| window.electronAPI.cliAlignment.getStatus(), | ||
| ]) |
reyortiz3
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Settings → Version tab showed the build-time
TOOLHIVE_VERSIONconstant, while the Settings → CLI tab showed the version detected from the actual binary. This makes both tabs use the same detected value, so they always agree and always reflect the binary that's really installed.Also makes the
vprefix optional when parsingthv versionoutput, so builds that stamp the version without it (e.g. downstream distributions) don't show "Unknown".cliAlignment.getStatus().cliVersion(same source as the CLI tab); falls back to "Unknown" when detection failsgetToolhiveVersionpreload method — the renovate-managed constant keeps its build-time role (thv download) but is no longer in the display pathFully or partially written by an AI agent.
🤖 Generated with Claude Code