Skip to content

Improve Agent defaults pickers and provider keys - #392

Merged
wesbillman merged 9 commits into
mainfrom
codex/agent-defaults-pickers
Oct 1, 2026
Merged

wesbillman merged 9 commits into
mainfrom
codex/agent-defaults-pickers

Conversation

@salman1993

@salman1993 salman1993 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

Settings > Agent defaults lacked provider, model, and effort dropdowns. Pi offered providers that may need an API key without a key field, and Goose defaults required manual environment entry.

What

  • Add provider, model, and effort pickers with custom IDs for values outside the suggested lists.
  • Browse models on demand with retry and cancel. Search large catalogs by name or exact ID, with at most ten matches plus the selected model.
  • Show a masked key field for known Pi and Goose providers in Agent defaults. Share the input with Create/Edit agent while retaining each harness's key mapping.
  • Warn about active provider/model overrides before browsing. Keep the chosen ID when credentials change and its catalog is retired.
  • Browse with unsaved Databricks host/filter values, show the build model only when it applies, preserve keyboard focus across Custom ID transitions, and discard a typed previous-provider key when Pi Model clears Provider.

How

The card uses the existing Select control, harness options, model lookup API, and write-only environment settings. A typed key works for model lookup and saves as a global environment value. Saved values never return to the form. A hidden saved Goose provider override hides the provider-specific key field until the override is replaced or removed. Pending environment removals must be saved before Browse because native discovery still inherits their saved values.

Risk

Saving defaults can restart running agents. A saved key is a global environment value inherited by every local agent without its own value, including agents on other harnesses. The updated native Settings flow still needs a human app test.

Testing

At f09aabd, main 55f96c2 is merged. The mandatory affected-test gate passed 36 files / 480 tests, TypeScript and design checks. The card, shared-agent form and Agent Settings files passed 65 tests. Independent review found no blockers (9/10). All PR commits have Codex Signed-off-by trailers.

The four frontend regressions failed before their fixes: conflicting build host/filter fields beside draft environment values, a misleading build-model hint, keyboard focus lost on Custom ID, and a typed Pi key saved after Model cleared Provider. Keyboard tests wait for actual option focus before sending the next key. The new follow-up changes only the card and its tests: 41 net production lines and 245 net test lines. No automated browser cases were added or removed.

Computer Use exercised the actual card with an in-memory browser host: unsaved Databricks host/filter Browse requests, OpenAI override model hints, keyboard transitions in both directions, model retention and editor focus after changing a synthetic key, and Pi Model clearing its provider and saving an empty environment patch. After merging main, the effort keyboard transitions were checked again. The temporary fixture and server were removed. These checks do not validate native authentication, storage or agent restarts; that app test and human confirmation remain pending. Hosted CI is running for the new head. The PR remains draft until the updated flow is tested by a human.

To try: open Settings > Agents > Agent defaults. Add a Databricks host/filter and Browse before Save. Check that an OpenAI provider override removes the Databricks build-model hint. In Default effort, choose Custom ID with the keyboard: focus should enter its input; choosing a listed effort should keep focus on its picker. With Pi, enter a test key and clear Model: Provider should clear and the unsaved key should disappear. Saved keys remain until explicitly removed under Environment variables. Main also contains native changes; rebuild/restart the desktop app to exercise those changes.

Generated with Codex

@salman1993
salman1993 force-pushed the codex/agent-defaults-pickers branch from 0b5c06f to 0b15870 Compare September 29, 2026 14:32
@salman1993
salman1993 marked this pull request as ready for review September 29, 2026 20:20
@salman1993
salman1993 requested review from a team, comp615 and wesbillman as code owners September 29, 2026 20:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T15:58:59.278536Z f09aabd Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@salman1993
salman1993 force-pushed the codex/agent-defaults-pickers branch from 0b15870 to 13d1172 Compare September 29, 2026 20:24

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

Copy link
Copy Markdown

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: 0b15870dff

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +311 to +312
result.modelOverridden
? "A saved environment model override takes precedence over this selection."

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 Warn about hidden model overrides before browsing

When the saved defaults contain BUZZ_AGENT_MODEL or GOOSE_MODEL, that write-only environment value wins over every model selected here, but this warning is shown only after a successful Browse request. A user who selects and saves a model without browsing—or whose lookup fails—receives no indication that the selection will be ignored. Check defaultSettings.environmentKeys up front, as ProviderChoice already does for provider overrides.

Useful? React with 👍 / 👎.

Comment thread src/app/AgentDefaultsCard.tsx Outdated
state.data?.agentDefaults?.model ?? "",
),
},
...entries.map((model) => ({ value: model.id, label: model.name })),

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 Bound or filter the rendered model choices

When a provider returns a large catalog, every model is converted into a Select option and rendered when the popup opens. Native accepts catalogs of up to 10,000 entries, so this can make Settings slow and forces users to scroll through thousands of unsearchable choices; the existing agent model picker instead provides search and limits Goose results. Reuse a searchable picker or cap the visible options.

Useful? React with 👍 / 👎.

Comment thread src/app/AgentDefaultsCard.tsx Outdated
state.data?.agentDefaults?.model ?? "",
),
},
...entries.map((model) => ({ value: model.id, label: model.name })),

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 Show exact model IDs in catalog choices

When catalog entries have friendly names that differ from their IDs—or two entries share the same name—the dropdown displays only model.name, making the choices indistinguishable even though selecting one persists its distinct model.id. The existing model picker includes the ID as a description; this picker should likewise expose the exact ID so users can select the intended model.

Useful? React with 👍 / 👎.

@salman1993
salman1993 marked this pull request as draft September 29, 2026 20:27
@salman1993
salman1993 force-pushed the codex/agent-defaults-pickers branch from 13d1172 to 812bbfb Compare September 29, 2026 20:59
@salman1993 salman1993 changed the title Add provider and model pickers to agent defaults Improve Agent defaults pickers and Pi credentials Sep 29, 2026
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
@salman1993
salman1993 force-pushed the codex/agent-defaults-pickers branch from 812bbfb to a0c62ce Compare October 1, 2026 01:21
@salman1993 salman1993 changed the title Improve Agent defaults pickers and Pi credentials Improve Agent defaults pickers and provider keys Oct 1, 2026
@salman1993
salman1993 marked this pull request as ready for review October 1, 2026 14:28

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

Copy link
Copy Markdown

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: 1f7e7fb1de

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/app/AgentDefaultsCard.tsx Outdated
Comment on lines +332 to +336
const hiddenHost =
state.data?.defaultSettings?.environmentKeys.includes("DATABRICKS_HOST");
const hiddenFilter = state.data?.defaultSettings?.environmentKeys.includes(
"DATABRICKS_MODEL_FILTER",
);

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 Treat draft Databricks keys as inherited request inputs

When a user adds a new DATABRICKS_HOST or DATABRICKS_MODEL_FILTER under Environment variables and browses before saving, these flags remain false because they inspect only saved keys. The draft override is nevertheless sent in edit.environment, while the request also sends the compiled host/filter and omits inheritWorkspace; native agent_models::resolve() then rejects the differing values as a conflict. Include string-valued draft overrides when computing hiddenHost and hiddenFilter so lookup uses the newly entered global pair.

Useful? React with 👍 / 👎.

Comment on lines +298 to +301
label: defaultLabel(
current.harness,
state.data?.agentDefaults?.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.

P2 Badge Hide the build model for non-Databricks providers

When Buzz Agent's default provider is OpenAI and its model is blank, this always labels the choice as Use build default (<Databricks model>). Native BuildDefaults::resolve() applies that build model only when the effective provider is Databricks, so the eventual start instead uses the harness default. Gate this label on a known Databricks provider, as the per-agent editor already does.

Useful? React with 👍 / 👎.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Three changes needed: honor draft Databricks workspace/filter overrides during Browse, preserve focus across Custom ID transitions, and discard a typed Pi key when model selection clears its provider. Details are inline.

Star Lord’s automated source review via Wes’s account, with an independent source-only picker pass. Head 1f7e7fb1deddb7fc28cb4c8f9bc351be0870c3b4; base 1a692d5d849145376be899fe0ecf7af195e3527c. No code or tests executed; native storage/authentication/restart and keyboard behavior were not exercised. A one-time check snapshot showed CI required successful and Windows native validation skipped.

Comment thread src/app/AgentDefaultsCard.tsx Outdated
Comment on lines +357 to +358
host:
current.harness === "buzz-agent" && !hiddenHost

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

P2 — Resolve the Databricks request from draft environment overrides.

When DATABRICKS_HOST or DATABRICKS_MODEL_FILTER is newly added under Environment variables, hiddenHost/hiddenFilter are still false because they inspect only saved key names. This sends the build host/filter alongside the different draft override in edit.environment. Native resolve() (src-tauri/src/agent_models.rs:221–235) rejects that mismatch; with no build host, the blank request fails too. Browse therefore cannot use a newly entered workspace/filter until the user first saves defaults, potentially restarting agents. Resolve string draft overrides before the build floor, or defer their resolution to native with blank fields and inheritWorkspace. Cover first-entry host and filter through the real resolver.

<Select
// A removed catalog option becomes editable text; retire the old
// Select so its option-removal fallback cannot clear the chosen ID.
key={showInput ? "custom" : "choice"}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

P2 — Preserve focus when switching between listed and custom IDs.

Choosing Custom ID changes this key, unmounting both the open popup and its invoking trigger. Choosing a listed value from custom mode does the same in reverse. The shared Select relies on Base UI returning focus to the old trigger; neither the replacement trigger nor the newly displayed input is a return target. Keyboard users lose their place when changing provider, model or effort. Retain the selection-preservation guard, but explicitly hand focus to the custom input on user entry and to the replacement trigger on exit (without stealing focus for passive catalog updates). Add keyboard focus assertions in both directions.

})),
];
const choose = (value: string) => {
if (pi && !value) onChange({ provider: "", model: "" });

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

P2 — Apply provider-key cleanup when the model choice clears Pi’s provider.

For Pi, selecting Not set clears both provider and model through the generic change callback. Unlike the ProviderChoice handler at lines 588–597, this path leaves a typed provider API key in current.environment. The key field disappears, but Save defaults still persists that unsaved key globally, including for other local agents. This violates the documented discard-on-provider-change behavior and can replace an existing saved credential after the user abandons that provider. Route provider changes from model selection through the same cleanup, dropping only string draft patches while preserving saved keys and removal patches. Cover typed key → Not set → Save.

@salman1993
salman1993 marked this pull request as draft October 1, 2026 15:10
codex added 3 commits October 1, 2026 11:18
Signed-off-by: Codex <codex@openai.com>
…pickers

Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
@salman1993
salman1993 marked this pull request as ready for review October 1, 2026 15:53

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

Copy link
Copy Markdown

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: f09aabdb6a

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +492 to +493
(current.harness === "goose" && !current.provider)
}

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 Honor Goose provider overrides when enabling Browse

When the scalar provider is blank but GOOSE_PROVIDER exists as a saved or draft environment override, this disables Browse even though native resolves that override as the effective provider (crates/agent-controller/src/runtime.rs:1075-1080), and the documented flow explicitly supports native resolution of saved overrides (docs/agent-control.md:489-490). As a result, users with a valid environment-configured Goose provider cannot browse its models; base this gate and the accompanying message on the effective override state, or let native validate the request.

AGENTS.md reference: AGENTS.md:L39-L42

Useful? React with 👍 / 👎.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No changes requested: the three findings in the prior review are addressed, and I found no fix-introduced defects. Draft Databricks overrides now reach the native resolver, Custom ID transitions explicitly restore focus, and Pi Model clearing uses shared draft-key cleanup.

Star Lord’s automated source-only follow-up via Wes’s account; head f09aabdb6abf5889f311ef70517c4929437c8bdd, base 55f96c256e9af418041f7a79d838ce3fdc65b1ac. No code/tests executed; hosted CI required was successful (Windows skipped), but native authentication/storage/restarts and real-webview focus remain unverified.

@wesbillman
wesbillman merged commit 4c60d9d into main Oct 1, 2026
21 checks passed
@wesbillman
wesbillman deleted the codex/agent-defaults-pickers branch October 1, 2026 16:02
johnmatthewtennant added a commit that referenced this pull request Oct 1, 2026
* origin/main: (82 commits)
  Test provider connections before model selection (#500)
  Bundle Goose ACP with Buzz (#497)
  Discover saved identities across joined communities with names, pictures and retry (#291)
  Clarify design-system documentation and unify component examples (#498)
  feat(composer): convert typed Markdown live and refuse control characters committed as text (#455)
  fix(messages): stop three timeline scroll races that flake CI (#456)
  Improve Agent defaults pickers and provider keys (#392)
  fix(threads): keep thread history painted after scroll corrections (#493)
  feat(plugins): expose the agent protection service (#421)
  perf(sidebar): re-render only the changed row on a channel-list publish (#480)
  feat(agents): copy protection defaults into new agents (#420)
  feat(agents): support native launch protection providers (#415)
  fix(composer): prevent WebKit overpainting mention selections (#490)
  fix(composer): prevent arrow keys from inserting control characters (#488)
  perf(channels): fall back to one exact roster read when confirming agent adds (#485)
  fix(media): pause video only on comment composer focus (#483)
  fix(channels): dismiss management modals with outside clicks (#479)
  perf: reuse message date formats and stable reaction shortcuts (#477)
  feat(profile): run an unattended scenario file in web profiling (#476)
  feat(channels): administer channel members and roles (#453)
  ...

Signed-off-by: John Tennant <jtennant@block.xyz>

# Conflicts:
#	src/app/shell/usePanelLauncher.ts
#	src/bundled/agents/AgentsPage.tsx
#	src/bundled/agents/InventoryIdentityCard.tsx
#	src/bundled/agents/InventoryView.tsx
#	src/bundled/agents/UnifiedInventory.tsx
#	src/bundled/agents/index.tsx
johnmatthewtennant pushed a commit that referenced this pull request Oct 1, 2026
* origin/main: (82 commits)
  Test provider connections before model selection (#500)
  Bundle Goose ACP with Buzz (#497)
  Discover saved identities across joined communities with names, pictures and retry (#291)
  Clarify design-system documentation and unify component examples (#498)
  feat(composer): convert typed Markdown live and refuse control characters committed as text (#455)
  fix(messages): stop three timeline scroll races that flake CI (#456)
  Improve Agent defaults pickers and provider keys (#392)
  fix(threads): keep thread history painted after scroll corrections (#493)
  feat(plugins): expose the agent protection service (#421)
  perf(sidebar): re-render only the changed row on a channel-list publish (#480)
  feat(agents): copy protection defaults into new agents (#420)
  feat(agents): support native launch protection providers (#415)
  fix(composer): prevent WebKit overpainting mention selections (#490)
  fix(composer): prevent arrow keys from inserting control characters (#488)
  perf(channels): fall back to one exact roster read when confirming agent adds (#485)
  fix(media): pause video only on comment composer focus (#483)
  fix(channels): dismiss management modals with outside clicks (#479)
  perf: reuse message date formats and stable reaction shortcuts (#477)
  feat(profile): run an unattended scenario file in web profiling (#476)
  feat(channels): administer channel members and roles (#453)
  ...

Signed-off-by: Sol <49aa1f65411fd096d2e2ec144f1e7aa36fdc76d1b907cfdf7be000c66f9d3b8e@buzz.block.builderlab.xyz>

# Conflicts:
#	src/app/shell/usePanelLauncher.ts
#	src/bundled/agents/AgentsPage.tsx
#	src/bundled/agents/InventoryIdentityCard.tsx
#	src/bundled/agents/InventoryView.tsx
#	src/bundled/agents/UnifiedInventory.tsx
#	src/bundled/agents/index.tsx
zrmarley added a commit that referenced this pull request Oct 5, 2026
…ad-on-send

* origin/main: (155 commits)
  Discover saved identities across joined communities with names, pictures and retry (#291)
  Clarify design-system documentation and unify component examples (#498)
  feat(composer): convert typed Markdown live and refuse control characters committed as text (#455)
  fix(messages): stop three timeline scroll races that flake CI (#456)
  Improve Agent defaults pickers and provider keys (#392)
  fix(threads): keep thread history painted after scroll corrections (#493)
  feat(plugins): expose the agent protection service (#421)
  perf(sidebar): re-render only the changed row on a channel-list publish (#480)
  feat(agents): copy protection defaults into new agents (#420)
  feat(agents): support native launch protection providers (#415)
  fix(composer): prevent WebKit overpainting mention selections (#490)
  fix(composer): prevent arrow keys from inserting control characters (#488)
  perf(channels): fall back to one exact roster read when confirming agent adds (#485)
  fix(media): pause video only on comment composer focus (#483)
  fix(channels): dismiss management modals with outside clicks (#479)
  perf: reuse message date formats and stable reaction shortcuts (#477)
  feat(profile): run an unattended scenario file in web profiling (#476)
  feat(channels): administer channel members and roles (#453)
  fix(shell): simplify top-bar controls and refine profile dropdown (#435)
  Fix macOS window dragging during identity setup (#424)
  ...

# Conflicts:
#	src/features/messages/MessageComposer.tsx
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.

3 participants