Repository navigation
feat(tui): make configure gate a forced setup - #78
Merged
Merged
Conversation
The first-run gate is now inescapable into an unconfigured chat. Replace the one-shot open-on-startup effect with a stateless invariant: while sync is complete, no provider is connected, and the dialog stack is empty, (re)open DialogConfigure. Escaping any gate-launched flow — Custom provider or upstream's Connect provider dialog, at any depth — a credential-only save, or any error empties the stack and bounces back to the gate instead of chat. Only a real provider (connected() true) or quitting (double Ctrl+C) leaves it. This needs no per-step escape handling and leaves upstream's connect dialog untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Unit-test the gate open-condition (extracted as shouldOpenConfigureGate) across all four branches. E2e-test the wiring: the gate opens on an unconfigured startup, escaping the Connect-provider dialog bounces back to it, and a configured provider keeps it closed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
The first-run Configure CoDev Code gate can no longer be escaped into an unconfigured chat. Previously Option 2 (Custom provider) and Option 3 (Connect provider) each dropped the user into chat if they hit Esc — the code comments literally said "escaping here lands in an unconfigured chat." This closes that.
Approach
Instead of freezing Esc per-step (which for Option 3 would mean invasive edits across upstream's multi-step
dialog-provider.tsx, and would also kill Esc inside OAuth and remove in-flow back-navigation), the gate now re-asserts itself. The one-shot open-on-startup effect inapp.tsxbecomes a stateless invariant:While unconfigured with no dialog open, the gate (re)opens. Consequences, all desired (confirmed with the requester):
connected()stays false → gate reopens ("block it").connected()is true, so/connect,/models, and/configurestay dismissable to chat.Scope note: an unconfigured user who opens
/connector/modelsmanually and escapes also bounces to the gate — a natural consequence of "force configuration," and the same mechanism that makes Option 3 work without touching upstream.Changes
packages/tui/src/app.tsx: transition-only gate effect → the invariant; dropped the now-unusedonimport.packages/tui/src/component/dialog-configure.tsx: refreshed the two stale Option 2/3 comments.DIVERGENCES.md: updated the existingapp.tsxrow.Test plan
packages/tui: typecheck green; 220 pass / 1 fail — the pre-existingapp-lifecycleepilogue flake, identical on clean main./v1/models, isolated XDG dirs), all confirmed:/connectthen Esc → returns to chat (not trapped).🤖 Generated with Claude Code