Skip to content

Auto-select default agent in New API key modal (APP-5819) - #15822

Closed
warp-factories[bot] wants to merge 1 commit into
masterfrom
fix/app-5819-auto-select-default-agent
Closed

Auto-select default agent in New API key modal (APP-5819)#15822
warp-factories[bot] wants to merge 1 commit into
masterfrom
fix/app-5819-auto-select-default-agent

Conversation

@warp-factories

@warp-factories warp-factories Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Description

In the New API key modal (Settings → Oz Cloud API Keys → New API key), selecting Type=Agent shows a default agent (Default Service Account, or the first available agent) in the Agent dropdown, but Create key stays disabled until the user manually re-selects an agent — even the same default.

Root cause: populate_agent_dropdown calls FilterableDropdown::set_items, which only updates the dropdown's own displayed selection/label. It never dispatches a SelectAgent action, so CreateApiKeyModal::selected_agent_uid stays None (which is what is_create_disabled checks) until the user clicks an item in the dropdown.

Fix: once agents load, populate_agent_dropdown now also picks a default agent (preferring "Default Service Account", falling back to the first available agent) and sets selected_agent_uid, while wiring the dropdown's own selection to match via set_selected_by_action. This mirrors the existing pattern already used for the expiration dropdown's default.

Linked Issue

Fixes APP-5819.

  • The linked issue is labeled ready-to-spec or ready-to-implement (no labels are currently set on APP-5819; this PR was produced by direct automation dispatch, not the standard label-gated flow).
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

This is a headless/logged-out sandbox with no packaged Warp binary or logged-in session available, so this could not be verified with computer-use/manual GUI testing. Verification relies on the added unit tests below; a human reviewer with a running dev build should confirm the Create key button behavior visually before merging.

Testing

Added two focused regression tests next to the existing test_agent_dropdown_is_searchable in create_api_key_modal_tests.rs:

  • test_agent_dropdown_auto_selects_default_agent: after agents load (Default Service Account first), selected_agent_uid is Some without any user interaction, and re-dispatching the same SelectAgent action (simulating the user re-selecting the default) keeps it selected.
  • test_agent_dropdown_auto_selects_first_agent_without_default_service_account: when no agent is named "Default Service Account", the first available agent is auto-selected instead.

Ran cargo fmt -p warp -- --check, cargo clippy -p warp --all-targets --tests -- -D warnings, and the full create_api_key_modal test module (all passing) locally.

  • I have manually tested my changes locally with ./script/run

Screenshots / Videos

N/A — no packaged binary/logged-in session available in this environment; see note above.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

The Agent dropdown in the New API key modal shows a default agent
(Default Service Account, or the first available agent) as soon as
agents load, but FilterableDropdown::set_items only updates the
displayed label -- it doesn't dispatch a selection action. This left
CreateApiKeyModal::selected_agent_uid as None, so Create key stayed
disabled until the user manually re-selected an agent.

populate_agent_dropdown now also sets selected_agent_uid and wires the
dropdown's internal selection to match, once agents load, so Create
key is enabled without requiring user interaction.

Fixes APP-5819.
@cla-bot

cla-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Warp Factory.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@warp-factories

warp-factories Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

This PR was generated with Warp.

Comment @warp-factory on this PR to send it follow-up work.

View run View conversation View on Linear

@warp-agent-staging

Copy link
Copy Markdown
Contributor

Superseded by #15825, which includes the APP-5819 fix and the modal-reopen stale-filter regression.

Responding as wilson: Open session · View in factory

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.

0 participants