Skip to content

Fix lstk start hanging on an invisible license re-login prompt - #449

Merged
tiurin merged 4 commits into
mainfrom
devx-1045-improve-lstk-start-ux-after-auth-token-regeneration
Aug 11, 2026
Merged

Fix lstk start hanging on an invisible license re-login prompt#449
tiurin merged 4 commits into
mainfrom
devx-1045-improve-lstk-start-ux-after-auth-token-regeneration

Conversation

@tiurin

@tiurin tiurin commented Aug 11, 2026

Copy link
Copy Markdown

Motivation

After rotating an auth token, lstk start printed ✓ Pulled localstack/localstack-pro:latest and then sat there indefinitely. The license failure and the recovery steps only showed up after Ctrl+C. The CLI was blocked on an interactive prompt that the TUI haven't drawn.

Before the fix:

Screenshot 2026-08-10 at 15 57 28

After the fix:

image

Problem

promptRelogin emits its UserInputRequestEvent a few hundred ms after validateLicense starts the "Checking license" spinner. A spinner stopped inside its 400 ms min duration stays on screen in pendingStop, so the TUI parked the prompt in the spinner's text. Then the min-duration tick erased it, leaving a blank screen while the domain waited on ResponseCh.

Solution

Three changes:

  • the prompt is always shown through inputPrompt; spinner text is only a mirror for as long as the spinner is on screen
  • prompts wrap to the terminal width. At ~115 columns the (Press ENTER to log in again) could be truncated, so even a correctly rendered prompt didn't say what to press
  • the prompt now advertises ESC to exit next to ENTER. Ctrl+C also declines, but it cancels the root context and the decline's ErrorEvent then races with the TUI's quit, so the recovery steps could be lost entirely

The re-login recovery added in #394 is unchanged. This PR fixes its visibility.

Closes DEVX-1045

Misha Tiurin and others added 4 commits August 11, 2026 11:23
A prompt emitted while a spinner was stopped inside its min duration was
parked in the spinner text, and the min-duration tick then erased it. `lstk
start` looked hung after a rotated auth token was rejected: the re-login offer
was never drawn while the domain waited on ResponseCh.

The prompt now always goes to inputPrompt; the spinner text is only a mirror
for as long as the spinner is on screen.

Towards DEVX-1045

Co-Authored-By: Claude <noreply@anthropic.com>
Bubble Tea truncates every rendered line to the terminal width, and prompts
were the one thing not wrapped. The license re-login prompt is ~165 characters,
so on a normal terminal the "(Press ENTER to log in again)" hint fell off the
right edge: a question with no visible answer.

InputPrompt.View now takes the width and wraps like message lines do, keeping
the key hints intact on their own line when they no longer fit.

Towards DEVX-1045

Co-Authored-By: Claude <noreply@anthropic.com>
Ctrl+C was the only way out of the re-login offer, and it cancels the root
context: the actionable error the decline renders then races the TUI quit, so
the manual recovery steps could be lost entirely. ESC declines without
cancelling, so the steps always print, immediately.

Adds an integration test for the decline path, which also asserts the prompt is
on screen at all.

Towards DEVX-1045

Co-Authored-By: Claude <noreply@anthropic.com>
…lator

The test shared Docker state with the rest of the suite while declaring
t.Parallel(), and container discovery matches by (image repo, internal port) —
so an emulator already running on 4566 makes `lstk start` report that instead of
reaching the license check. It now clears the container first via
cleanupLicense, which unlike cleanup leaves the keyring token alone.
require.Eventually evaluates its message args eagerly, so the PTY transcript is
logged from a cleanup on failure instead of coming out empty.

Also records the prompt-visibility invariant in the root CLAUDE.md UI rules,
where it is read before new prompt code gets written.

Co-Authored-By: Claude <noreply@anthropic.com>
@tiurin tiurin added semver: patch docs: skip Pull request does not require documentation changes labels Aug 11, 2026
@tiurin
tiurin marked this pull request as ready for review August 11, 2026 13:23
@tiurin
tiurin requested a review from a team as a code owner August 11, 2026 13:23
@tiurin
tiurin merged commit f18753e into main Aug 11, 2026
22 of 23 checks passed
@tiurin
tiurin deleted the devx-1045-improve-lstk-start-ux-after-auth-token-regeneration branch August 11, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes semver: patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant