Auto-select default agent in New API key modal (APP-5819) - #15822
Closed
warp-factories[bot] wants to merge 1 commit into
Closed
Auto-select default agent in New API key modal (APP-5819)#15822warp-factories[bot] wants to merge 1 commit into
warp-factories[bot] wants to merge 1 commit into
Conversation
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.
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Warp Factory.
|
Contributor
Author
|
This PR was generated with Warp. Comment |
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 |
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.



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_dropdowncallsFilterableDropdown::set_items, which only updates the dropdown's own displayed selection/label. It never dispatches aSelectAgentaction, soCreateApiKeyModal::selected_agent_uidstaysNone(which is whatis_create_disabledchecks) until the user clicks an item in the dropdown.Fix: once agents load,
populate_agent_dropdownnow also picks a default agent (preferring "Default Service Account", falling back to the first available agent) and setsselected_agent_uid, while wiring the dropdown's own selection to match viaset_selected_by_action. This mirrors the existing pattern already used for the expiration dropdown's default.Linked Issue
Fixes APP-5819.
ready-to-specorready-to-implement(no labels are currently set on APP-5819; this PR was produced by direct automation dispatch, not the standard label-gated flow).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_searchableincreate_api_key_modal_tests.rs:test_agent_dropdown_auto_selects_default_agent: after agents load (Default Service Account first),selected_agent_uidisSomewithout any user interaction, and re-dispatching the sameSelectAgentaction (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 fullcreate_api_key_modaltest module (all passing) locally../script/runScreenshots / Videos
N/A — no packaged binary/logged-in session available in this environment; see note above.
Agent Mode