Skip to content

feature: provider & model config#8515

Merged
alexhancock merged 1 commit intomainfrom
alexhancock/provider-and-model-selection
Apr 14, 2026
Merged

feature: provider & model config#8515
alexhancock merged 1 commit intomainfrom
alexhancock/provider-and-model-selection

Conversation

@alexhancock
Copy link
Copy Markdown
Collaborator

Summary

  • Adding provider and model selection for the TUI when you are onboarded into the UX already
  • Ctrl + G will launch the Provider & Model selection grid UI where you can select or configure a provider and a model within

I don't have any attachment to that keyboard shortcut. Any feedback?

Testing

Manual usage

Related Issues

Phase 2 of #6642

Screenshots/Demos (for UX changes)

Screenshot 2026-04-13 at 2 42 22 PM Screenshot 2026-04-13 at 2 42 32 PM Screenshot 2026-04-13 at 2 42 16 PM

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9dd5d352a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/text/src/configure.tsx
Comment on lines +420 to +423
if (!selectedProvider) return;
setPendingConfigValues(values);
setPhase("select_model");
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Save entered provider config before requesting model list

This callback advances to select_model immediately after collecting credentials, but the values are only kept in pendingConfigValues and are not persisted yet. ModelSelector then calls _goose/providers/models, and the server currently rejects providers that are not already configured from stored config (on_get_provider_models checks required keys before fetching models). For providers that start unconfigured, model loading fails even after valid keys are entered, which breaks the configure-new-provider flow.

Useful? React with 👍 / 👎.

Comment thread ui/text/src/configure.tsx
Comment on lines +192 to +194
if (error) {
return (
<Box flexDirection="column" justifyContent="center" alignItems="center" width={columns} height={height}>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow manual model entry when model lookup errors

This early error return prevents the manual-entry UI from ever rendering, because manualEntry is checked later in the component. As a result, when model loading fails or times out, pressing m (as instructed by the on-screen hint) cannot open manual model input, so users cannot proceed without backing out.

Useful? React with 👍 / 👎.

@alexhancock alexhancock force-pushed the alexhancock/tui-onboarding branch from a879727 to a0706f0 Compare April 13, 2026 18:51
@alexhancock alexhancock force-pushed the alexhancock/provider-and-model-selection branch 2 times, most recently from a920e5b to db06163 Compare April 13, 2026 18:52
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db06163709

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/text/src/configure.tsx
Comment on lines +384 to +386
await client.goose.GooseConfigUpsert({ key: "GOOSE_PROVIDER", value: provider.name });
await client.goose.GooseConfigUpsert({ key: "GOOSE_MODEL", value: model });
await client.goose.GooseSessionProviderUpdate({
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Defer default config writes until session update succeeds

applyProviderModel persists GOOSE_PROVIDER/GOOSE_MODEL before calling GooseSessionProviderUpdate, so a failed live switch (for example from an unsupported manual model entry or provider initialization error) leaves global config pointing to the new selection while the current session remains on the old provider/model. That mismatch is user-visible on the next session start and is hard to recover from after canceling out of the error state; write defaults only after a successful session update (or roll them back on failure).

Useful? React with 👍 / 👎.

Comment thread ui/text/src/configure.tsx
<Box flexDirection="column" alignItems="center" width={maxWidth}>
<Text color={GOLD}>⚠ Failed to load models</Text>
<Box marginTop={1} width={maxWidth}>
<Text color={TEXT_DIM} wrap="wrap">{error}</Text>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Truncate provider model-load errors in fixed-height view

In ModelSelector's error state, the message is rendered with wrap="wrap" inside a fixed-height full-screen layout; Ink does not clip overflowing content, so long backend error strings can spill into neighboring rows and break the screen layout. This should be line-capped/truncated (for example wrap="truncate" plus pre-truncation) before rendering.

Useful? React with 👍 / 👎.

@alexhancock alexhancock force-pushed the alexhancock/provider-and-model-selection branch from db06163 to 0265549 Compare April 13, 2026 19:27
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0265549c1f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/text/src/configure.tsx
Comment on lines +76 to +80
setModels(resp.models);
const defaultIdx = resp.models.findIndex((m) => m === provider.defaultModel);
setSelectedIdx(defaultIdx >= 0 ? defaultIdx : 0);
setLoading(false);
clearTimeout(timeoutId);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clear stale timeout error after models eventually load

When the 30s timeout fires, error is set, but if the provider responds later the success path only updates models/selectedIdx/loading and never clears error. Because render checks if (error) before the normal selector UI, slow-but-successful responses remain stuck on the failure screen instead of recovering. This affects providers that return after the timeout threshold.

Useful? React with 👍 / 👎.

</Text>
)}
<Text color={TEXT_DIM}>^C exit</Text>
<Text color={TEXT_DIM}>^G configure · ^C exit</Text>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep header shortcut hint from wrapping on narrow terminals

The new ^G configure · ^C exit label is longer than the right header column at small widths (the current split leaves only ~15 chars there), so it wraps to a second line in narrow terminals. App still budgets header height as two rows total (headerH = 2), so this wrap causes viewport math to be off and can visually overlap/crop content below the header.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

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

looks ok to me. I guess a new GUI using acp server would want models and ctx limits too, nice one.

Base automatically changed from alexhancock/tui-onboarding to main April 14, 2026 14:24
@alexhancock alexhancock force-pushed the alexhancock/provider-and-model-selection branch from 0265549 to a96d97f Compare April 14, 2026 14:30
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a96d97f05f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/text/src/configure.tsx
Comment on lines +404 to +408
const keys = provider.configKeys.filter(
(k) => k.required && !k.oauthFlow && !k.deviceCodeFlow,
);
setSelectedProvider(provider);
if (keys.length > 0 && !provider.isConfigured) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Route unconfigured OAuth providers through setup flow

This branch filters out oauthFlow/deviceCodeFlow keys when deciding whether to show ProviderConfigurator, so providers whose only required credential is OAuth (e.g. GitHub Copilot, ChatGPT Codex, Gemini OAuth in crates/goose/src/providers/*) are treated as if they need no setup and jump straight to model selection. The subsequent _goose/providers/models call then fails because on_get_provider_models requires required keys to already exist in config, which blocks configuring these providers from the new Ctrl+G flow.

Useful? React with 👍 / 👎.

@alexhancock alexhancock merged commit 3fe750c into main Apr 14, 2026
26 of 28 checks passed
@alexhancock alexhancock deleted the alexhancock/provider-and-model-selection branch April 14, 2026 14:55
michaelneale added a commit that referenced this pull request Apr 15, 2026
…rning

* origin/main:
  move agent skills to repo root for tool discoverability (#8535)
  port goose2 chat attachments into goose (#8534)
  chore(release): bump version to 1.31.0 (minor) (#8527)
  feature: provider & model config (#8515)
  Move goose2 (#8516)
  feat: onboarding UX for the TUI (#8513)
  Set MACOSX_DEPLOYMENT_TARGET=12.0 in build-cli.yml (#8525)
  Improve local inference settings and model downloader (#8467)
  Add prompt injection mitigation logging back (#8518)
  feat(providers): add llama-swap declarative provider (#8462)
  fix: Unable to Run `goose update` on Linux (#8465)
  Add vision/image support for local inference models (#8442)
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.

2 participants