Skip to content

feat(tui): offer sign-in for signed-out providers in the model picker - #302

Merged
daviddanialy merged 3 commits into
mainfrom
feat/tui-provider-sign-in
Oct 22, 2026
Merged

daviddanialy merged 3 commits into
mainfrom
feat/tui-provider-sign-in

Conversation

@daviddanialy

@daviddanialy daviddanialy commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The /model provider page now lists providers you can sign in to but haven't yet, below the signed-in providers and greyed out. Pressing enter on one starts that provider's terminal sign-in (the same flow as /login <id>). When sign-in succeeds, the picker reopens on that provider's models with the same "tab defaults" setting.

Agent

  • Each advertised terminal sign-in method carries a kit/provider field in its _meta, naming the provider it signs in to.
  • The session's model catalog is built once when the session opens. It is now rebuilt when the set of providers with credentials changes, so the TUI's refresh after sign-in returns the new provider's models. Before this, those models only appeared in a new session.

TUI

  • A provider counts as signed in when the agent's catalog has a group for it, even if its model list came back empty. Providers that are already signed in are never offered sign-in again.
  • Sign-in rows appear only after the agent has sent a catalog, so they don't show before the session opens.
  • Sign-in from the picker waits until the agent is idle, like /login and model switches.
  • /model never opens an empty picker.
  • A selected greyed-out row keeps a dimmed version of the selection highlight. The footer reads enter sign in while a greyed-out row is selected.
  • Sign-in methods are only advertised for a local agent, so with --remote the picker shows the signed-in providers as before.
  • The /model section of docs/user/tui-and-sessions.md describes the new behaviour.

Demo

provider picker sign-in demo

Testing

  • mise run lint
  • cargo test --lib: 2001 passed. Two shell tests fail locally, and they also fail on main: a shell startup file on the test machine prints a warning into their captured stderr. plugins::tests::system_git_runner_disables_configured_askpass_* was skipped because it hangs locally waiting on git. This PR doesn't touch the shell, git or plugin code.
  • New tests cover:
    • the kit/provider field on sign-in methods
    • catalog rebuild detection after sign-in and sign-out
    • order of signed-in and greyed-out providers, and sign-in on enter
    • reopening the provider's models with the same defaults setting after sign-in
    • no reopen after a failed sign-in
    • signed-in providers with no models are not offered sign-in
    • sign-in waits for a running turn
    • sign-in rows only appear once a catalog is known
    • the footer text in the rendered picker

馃 Generated with Claude Code

The provider page lists providers that advertise a terminal sign-in method
but have no models yet below the active ones, greyed out. Entering one
starts that provider's login flow. /model opens the picker when only
sign-in methods are available.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The model picker conflates an unavailable Anthropic model catalog with missing credentials, offering sign-in to an already credentialed user.

Took 11 min

Comment thread src/tui/app.rs Outdated
@daviddanialy
daviddanialy marked this pull request as draft October 22, 2026 19:36
The agent tags each terminal auth method with its provider under the
`kit/provider` metadata key and rebuilds the session's model catalog when
the set of credentialed providers changes, so the post-login refresh
advertises the new provider's models.

The TUI treats a provider as signed in when the catalog has a group for
it, even if model discovery returned nothing, and offers sign-in only once
a catalog is known. Picker sign-in waits for the current turn, keeps the
selection highlighted, and reopens the provider's models with the same
defaults choice after a successful login. /model no longer opens an empty
picker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One limited issue remains: a credentialed provider with failed model discovery opens an unexplained empty model page.

Took 11 min

Comment thread src/tui/app.rs
@daviddanialy
daviddanialy marked this pull request as ready for review October 22, 2026 20:23
A signed-in provider whose model discovery failed now shows why its model
page is empty, a search with no results says so, and the footer drops the
enter hint when there is nothing to select.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

Took 8 min 3 sec

@daviddanialy
daviddanialy merged commit 17dc19c into main Oct 22, 2026
5 checks passed
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.

1 participant