Skip to content

fix(cli): home screen labels the env by remembered client name (bugbot #266)#267

Merged
saadqbal merged 1 commit into
developfrom
fix/266-home-env-name
Jul 14, 2026
Merged

fix(cli): home screen labels the env by remembered client name (bugbot #266)#267
saadqbal merged 1 commit into
developfrom
fix/266-home-env-name

Conversation

@saadqbal

@saadqbal saadqbal commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

What

The bare-CLI home screen labels the secure environment differently depending on state:

  • Online / Starting → shows the Helm release name (tracebloc), because realProbeEnv sets envProbe{name: release.ReleaseName}.
  • Offline → shows the remembered client name (acme-01), because the offline paths surface no name and resolveHomeModel falls back to remembered.

Same environment, two labels. resolveHomeModel only used remembered when the probe name was empty.

Fix

Prefer the remembered client name whenever it exists; keep the probe's release name only as a last-resort fallback (a release present on a machine that never cached a client). One-line change in resolveHomeModel.

Why the tests didn't catch it

The baseDeps fake probe returned the friendly name acme-01 — never the release name — so no test made the probe name differ from remembered. Added TestResolveHomeModel_PrefersRememberedNameOverReleaseName, where the probe returns tracebloc while remembered is acme-01; it fails on the old if env.name == "" logic and passes on the fix.

Verification

  • gofmt clean; go test ./internal/cli/ green (incl. the new regression test).

Resolves the Cursor Bugbot "Home shows Helm release as env name" finding on #266. Once merged to develop, the promote PR #266 picks it up automatically.

🤖 Generated with Claude Code


Note

Low Risk
Small display-label fix in CLI home resolution with a targeted regression test; no auth, cluster, or data-path behavior changes.

Overview
The bare CLI home screen showed different secure-environment labels depending on state: Online/Starting used the cluster probe’s Helm release name (e.g. tracebloc), while Offline used the remembered client name (e.g. acme-01) because offline paths left the probe name empty and only then fell back to remembered.

resolveHomeModel now always prefers the remembered client name when one exists, and keeps the probe’s release name only when nothing was cached—so the same provisioned machine shows one user-facing label in every state. Comments document why release vs client names diverge.

Adds TestResolveHomeModel_PrefersRememberedNameOverReleaseName, with the probe returning tracebloc and remembered acme-01, which the previous if env.name == "" logic would not catch.

Reviewed by Cursor Bugbot for commit 426659e. Bugbot is set up for automated code reviews on this repo. Configure here.

…he Helm release

realProbeEnv surfaces the Helm release name (e.g. "tracebloc") when a release is
found, while the offline paths surface no name and fall back to the remembered
client name (e.g. "acme-01"). resolveHomeModel only used remembered when the
probe name was empty, so the SAME environment read "tracebloc" Online/Starting
but "acme-01" Offline — a state-dependent label for one environment.

Prefer the remembered client name whenever it exists; keep the probe's release
name only as a last-resort fallback for a release present on a machine that
never cached a client. Adds a regression test where the probe name differs from
remembered (the case the fake probe never exercised).

Fixes the Cursor Bugbot "Home shows Helm release as env name" finding on #266.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@saadqbal saadqbal self-assigned this Jul 14, 2026
@saadqbal
saadqbal merged commit 4de24e2 into develop Jul 14, 2026
21 checks passed
@saadqbal
saadqbal deleted the fix/266-home-env-name branch July 14, 2026 09:53
saadqbal added a commit that referenced this pull request Jul 14, 2026
…red label (#274)

#267 made resolveHomeModel overwrite env.name with the remembered client name
for display. But the offline-vs-no-env classifier reads `env.name != ""` to mean
"the probe surfaced an environment name" — so a leftover ActiveClientName/ID with
no cached namespace (provisioned=false) now masquerades as a reachable
environment and renders Offline + full menu instead of the no-environment
installer path.

Capture the probe's own surfaced name (probeNamedEnv) BEFORE the display-name
override and classify on that: `provisioned || probeNamedEnv`. A remembered
display label with no namespace is no longer evidence of an environment. Adds a
regression test for the leftover-name-without-namespace case.

Fixes the Cursor Bugbot "Remembered name skews offline detection" finding on #266
(learned rule: commands targeting the active client must use bindActiveClientNamespace).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.

4 participants