REMOTE-1601 Add named agent API key support behind FeatureFlag::NamedAgents - #10390
Conversation
- Add taskGitCredentials types to schema.graphql (verified against staging) and add to clientQueries allowlist in client-schema.ts - Add task_git_credentials.rs GraphQL query file (cynic) following the task_secrets pattern - Add GitCredential struct and get_task_git_credentials to AIClient trait with a ServerApi implementation Co-Authored-By: Oz <oz-agent@warp.dev>
- Add driver/git_credentials.rs: atomic writes to ~/.git-credentials and ~/.config/gh/hosts.yaml, one-time git config setup (credential.helper store, url.insteadOf), git identity configuration, and refresh_loop() which re-fetches credentials every 50 minutes - Extend fetch_secrets_and_attachments to call taskGitCredentials in parallel at startup; writes credential files and git config - Add futures::select! refresh loop in run_internal, racing the harness execution against the infinite refresh loop for both Oz and ThirdParty harnesses Co-Authored-By: Oz <oz-agent@warp.dev>
- Write ~/.git-credentials and ~/.config/gh/hosts.yaml temp files with 0600 permissions (mode + set_permissions) matching the existing pattern in write_codex_auth_json, preventing other users from reading tokens - Add run_git_config_add (--add flag) so multi-value insteadOf entries coexist instead of the second overwriting the first - Derive SSH→HTTPS URL rewrites from credential hosts rather than hardcoding github.com, using --add for both scp-style and ssh:// forms per host Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
On transient failure, retry up to 3 times with 1min, 2min, 4min delays, keeping all retries within the ~10-minute buffer before token expiry. Co-Authored-By: Oz <oz-agent@warp.dev>
…tion Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
When enabled, the API key creation modal replaces the Team option with Agent, letting users select a named agent identity to scope the key to. Agents are fetched from GET /api/v1/agent/identities and the selected agent UID is sent via the existing agentUid field on GenerateApiKeyInput. Changes: - Add FeatureFlag::NamedAgents (dogfood-enabled) - Add agentUid to GraphQL schema and codegen GenerateApiKeyInput - Add AgentIdentity type and list_agent_identities to AuthClient - Add agent_uid parameter to create_api_key - Update CreateApiKeyModal with agent dropdown and empty-state linking to oz.warp.dev/agents - Show Scope column as Agent (not Team) when flag is enabled Co-Authored-By: Oz <oz-agent@warp.dev>
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds named-agent API key UI/API plumbing, but the diff also includes new cloud git credential management code. The changed Rust currently has compile errors, and there are correctness issues in the settings UI around API-key scope labeling and agent-list failures.
Concerns
- The new git credential fetch code calls
Duration::from_mins, which is not available onstd::time::Duration, in two changed files. - Existing team-owned API keys are shown as Agent whenever
FeatureFlag::NamedAgentsis enabled because the UI maps everyOwnerType::TeamtoApiKeyScope::Agent. - Agent identity load failures are swallowed, so users see a no-agents empty state and disabled create flow instead of a load error or retry path.
- Manual testing is required for changes that can be manually tested. Please include screenshots or a screen recording that show the API key modal/list changes working end to end, or justify why manual testing is not possible.
Verdict
Found: 2 critical, 3 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
- Fix Duration::from_mins (doesn't exist) to Duration::from_secs(5 * 60) - Always map Team-owned API keys to Team scope, not Agent - Surface error toast on failed list_agent_identities instead of silently ignoring Co-Authored-By: Oz <oz-agent@warp.dev>
…nt-api-keys # Conflicts: # app/src/ai/agent_sdk/driver/git_credentials.rs # app/src/ai/agent_sdk/mod.rs
Co-Authored-By: Oz <oz-agent@warp.dev>
…n Agent variant Co-Authored-By: Oz <oz-agent@warp.dev>
|
@oz-agent fix conflicts |
|
I'm working on changes requested in this PR (responding to a PR conversation comment). You can view the conversation on Warp. I pushed changes to this PR based on the comment. Next steps:
Powered by Oz |
|
Nice! Could we also update the list view to have the name of the agent that the key is associated with as a part of this PR? Might need to consult design about it |
@ianhodge Currently the server API for these keys only returns them as team or personal, so to do that, we'd need to make some api and server changes to resolve the service account to an agent and change the response. I thought about doing that, but do you think it could wait to be with the rest of the named agents work? or would the time to do this be now |
|
makes sense, let's land this for now but we should def try and get that change in before launch if possible right now it's kinda confusing to know the association for the keys |
Pull request was converted to draft
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds the named-agent API key creation path behind FeatureFlag::NamedAgents, including API/schema plumbing, fetching agent identities, and new modal UI.
Concerns
- Agent-scoped keys are not actually represented in the settings table because
ApiKeyScope::Agentis added only as a dead-code display variant; newly created and fetched keys still map scope fromowner_type, which the PR notes does not distinguish agents from teams.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| enum ApiKeyScope { | ||
| Personal, | ||
| Team, | ||
| /// Not yet constructed — the server doesn't distinguish agent-scoped keys |
There was a problem hiding this comment.
ApiKeyScope::Agent is never constructed: both fetched keys and the just-created key still derive scope from owner_type, which this comment says the server reports as team, so agent-scoped keys will render as Team instead of Agent. Pass the selected key type through the create event or add server-provided agent scope before showing the Scope column as agent-aware.
There was a problem hiding this comment.
see above convo, we will aim to land the server side change before launch
…Agents (warpdotdev#10390) ## Description Add support for creating API keys scoped to named agent identities in the Oz Cloud API Keys settings page, gated behind `FeatureFlag::NamedAgents` (dogfood-enabled). When the flag is enabled, the "Team" option in the key-type selector is replaced with "Agent". Users can select which named agent the key authenticates as from a dropdown populated via `GET /api/v1/agent/identities`. If no agents exist, an empty state links to `oz.warp.dev/agents` to create one. ### Changes - **`crates/warp_features`**: Add `FeatureFlag::NamedAgents` to dogfood - **`crates/warp_graphql_schema`** + **`crates/graphql`**: Add `agentUid: ID` to `GenerateApiKeyInput` - **`app/src/server/server_api/auth.rs`**: Add `AgentIdentity` type, `list_agent_identities()`, and `agent_uid` param to `create_api_key()` - **`app/src/settings_view/platform/create_api_key_modal.rs`**: Agent type selector, dropdown, empty state, create flow - **`app/src/settings_view/platform_page.rs`**: Scope column displays "Agent" when flag is on [Oz conversation](https://staging.warp.dev/conversation/d5027d88-07f2-482e-a2eb-39879d66fc9e) · [Plan](https://staging.warp.dev/drive/notebook/OC5WmSrFQZwF9BAYEhWMM6) ## Linked Issue - [ ] The linked issue is labeled `ready-to-spec` or `ready-to-implement`. - [x] Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes). https://www.loom.com/share/636237a795c34e1ca1806761b5018160 ## Testing Feature is behind `FeatureFlag::NamedAgents` (dogfood only). Verified compilation of `warp_features` and `warp_graphql` crates. Full app compilation blocked by pre-existing `http_client` error unrelated to this change. ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode Co-Authored-By: Oz <oz-agent@warp.dev> --------- Co-authored-by: Oz <oz-agent@warp.dev>
…Agents (warpdotdev#10390) ## Description Add support for creating API keys scoped to named agent identities in the Oz Cloud API Keys settings page, gated behind `FeatureFlag::NamedAgents` (dogfood-enabled). When the flag is enabled, the "Team" option in the key-type selector is replaced with "Agent". Users can select which named agent the key authenticates as from a dropdown populated via `GET /api/v1/agent/identities`. If no agents exist, an empty state links to `oz.warp.dev/agents` to create one. ### Changes - **`crates/warp_features`**: Add `FeatureFlag::NamedAgents` to dogfood - **`crates/warp_graphql_schema`** + **`crates/graphql`**: Add `agentUid: ID` to `GenerateApiKeyInput` - **`app/src/server/server_api/auth.rs`**: Add `AgentIdentity` type, `list_agent_identities()`, and `agent_uid` param to `create_api_key()` - **`app/src/settings_view/platform/create_api_key_modal.rs`**: Agent type selector, dropdown, empty state, create flow - **`app/src/settings_view/platform_page.rs`**: Scope column displays "Agent" when flag is on [Oz conversation](https://staging.warp.dev/conversation/d5027d88-07f2-482e-a2eb-39879d66fc9e) · [Plan](https://staging.warp.dev/drive/notebook/OC5WmSrFQZwF9BAYEhWMM6) ## Linked Issue - [ ] The linked issue is labeled `ready-to-spec` or `ready-to-implement`. - [x] Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes). https://www.loom.com/share/636237a795c34e1ca1806761b5018160 ## Testing Feature is behind `FeatureFlag::NamedAgents` (dogfood only). Verified compilation of `warp_features` and `warp_graphql` crates. Full app compilation blocked by pre-existing `http_client` error unrelated to this change. ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode Co-Authored-By: Oz <oz-agent@warp.dev> --------- Co-authored-by: Oz <oz-agent@warp.dev>
…Agents (warpdotdev#10390) ## Description Add support for creating API keys scoped to named agent identities in the Oz Cloud API Keys settings page, gated behind `FeatureFlag::NamedAgents` (dogfood-enabled). When the flag is enabled, the "Team" option in the key-type selector is replaced with "Agent". Users can select which named agent the key authenticates as from a dropdown populated via `GET /api/v1/agent/identities`. If no agents exist, an empty state links to `oz.warp.dev/agents` to create one. ### Changes - **`crates/warp_features`**: Add `FeatureFlag::NamedAgents` to dogfood - **`crates/warp_graphql_schema`** + **`crates/graphql`**: Add `agentUid: ID` to `GenerateApiKeyInput` - **`app/src/server/server_api/auth.rs`**: Add `AgentIdentity` type, `list_agent_identities()`, and `agent_uid` param to `create_api_key()` - **`app/src/settings_view/platform/create_api_key_modal.rs`**: Agent type selector, dropdown, empty state, create flow - **`app/src/settings_view/platform_page.rs`**: Scope column displays "Agent" when flag is on [Oz conversation](https://staging.warp.dev/conversation/d5027d88-07f2-482e-a2eb-39879d66fc9e) · [Plan](https://staging.warp.dev/drive/notebook/OC5WmSrFQZwF9BAYEhWMM6) ## Linked Issue - [ ] The linked issue is labeled `ready-to-spec` or `ready-to-implement`. - [x] Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes). https://www.loom.com/share/636237a795c34e1ca1806761b5018160 ## Testing Feature is behind `FeatureFlag::NamedAgents` (dogfood only). Verified compilation of `warp_features` and `warp_graphql` crates. Full app compilation blocked by pre-existing `http_client` error unrelated to this change. ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode Co-Authored-By: Oz <oz-agent@warp.dev> --------- Co-authored-by: Oz <oz-agent@warp.dev>
…Agents (warpdotdev#10390) ## Description Add support for creating API keys scoped to named agent identities in the Oz Cloud API Keys settings page, gated behind `FeatureFlag::NamedAgents` (dogfood-enabled). When the flag is enabled, the "Team" option in the key-type selector is replaced with "Agent". Users can select which named agent the key authenticates as from a dropdown populated via `GET /api/v1/agent/identities`. If no agents exist, an empty state links to `oz.warp.dev/agents` to create one. ### Changes - **`crates/warp_features`**: Add `FeatureFlag::NamedAgents` to dogfood - **`crates/warp_graphql_schema`** + **`crates/graphql`**: Add `agentUid: ID` to `GenerateApiKeyInput` - **`app/src/server/server_api/auth.rs`**: Add `AgentIdentity` type, `list_agent_identities()`, and `agent_uid` param to `create_api_key()` - **`app/src/settings_view/platform/create_api_key_modal.rs`**: Agent type selector, dropdown, empty state, create flow - **`app/src/settings_view/platform_page.rs`**: Scope column displays "Agent" when flag is on [Oz conversation](https://staging.warp.dev/conversation/d5027d88-07f2-482e-a2eb-39879d66fc9e) · [Plan](https://staging.warp.dev/drive/notebook/OC5WmSrFQZwF9BAYEhWMM6) ## Linked Issue - [ ] The linked issue is labeled `ready-to-spec` or `ready-to-implement`. - [x] Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes). https://www.loom.com/share/636237a795c34e1ca1806761b5018160 ## Testing Feature is behind `FeatureFlag::NamedAgents` (dogfood only). Verified compilation of `warp_features` and `warp_graphql` crates. Full app compilation blocked by pre-existing `http_client` error unrelated to this change. ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode Co-Authored-By: Oz <oz-agent@warp.dev> --------- Co-authored-by: Oz <oz-agent@warp.dev>
…Agents (warpdotdev#10390) ## Description Add support for creating API keys scoped to named agent identities in the Oz Cloud API Keys settings page, gated behind `FeatureFlag::NamedAgents` (dogfood-enabled). When the flag is enabled, the "Team" option in the key-type selector is replaced with "Agent". Users can select which named agent the key authenticates as from a dropdown populated via `GET /api/v1/agent/identities`. If no agents exist, an empty state links to `oz.warp.dev/agents` to create one. ### Changes - **`crates/warp_features`**: Add `FeatureFlag::NamedAgents` to dogfood - **`crates/warp_graphql_schema`** + **`crates/graphql`**: Add `agentUid: ID` to `GenerateApiKeyInput` - **`app/src/server/server_api/auth.rs`**: Add `AgentIdentity` type, `list_agent_identities()`, and `agent_uid` param to `create_api_key()` - **`app/src/settings_view/platform/create_api_key_modal.rs`**: Agent type selector, dropdown, empty state, create flow - **`app/src/settings_view/platform_page.rs`**: Scope column displays "Agent" when flag is on [Oz conversation](https://staging.warp.dev/conversation/d5027d88-07f2-482e-a2eb-39879d66fc9e) · [Plan](https://staging.warp.dev/drive/notebook/OC5WmSrFQZwF9BAYEhWMM6) ## Linked Issue - [ ] The linked issue is labeled `ready-to-spec` or `ready-to-implement`. - [x] Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes). https://www.loom.com/share/636237a795c34e1ca1806761b5018160 ## Testing Feature is behind `FeatureFlag::NamedAgents` (dogfood only). Verified compilation of `warp_features` and `warp_graphql` crates. Full app compilation blocked by pre-existing `http_client` error unrelated to this change. ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode Co-Authored-By: Oz <oz-agent@warp.dev> --------- Co-authored-by: Oz <oz-agent@warp.dev>
Description
Add support for creating API keys scoped to named agent identities in the Oz Cloud API Keys settings page, gated behind
FeatureFlag::NamedAgents(dogfood-enabled).When the flag is enabled, the "Team" option in the key-type selector is replaced with "Agent". Users can select which named agent the key authenticates as from a dropdown populated via
GET /api/v1/agent/identities. If no agents exist, an empty state links tooz.warp.dev/agentsto create one.Changes
crates/warp_features: AddFeatureFlag::NamedAgentsto dogfoodcrates/warp_graphql_schema+crates/graphql: AddagentUid: IDtoGenerateApiKeyInputapp/src/server/server_api/auth.rs: AddAgentIdentitytype,list_agent_identities(), andagent_uidparam tocreate_api_key()app/src/settings_view/platform/create_api_key_modal.rs: Agent type selector, dropdown, empty state, create flowapp/src/settings_view/platform_page.rs: Scope column displays "Agent" when flag is onOz conversation · Plan
Linked Issue
ready-to-specorready-to-implement.https://www.loom.com/share/636237a795c34e1ca1806761b5018160
Testing
Feature is behind
FeatureFlag::NamedAgents(dogfood only). Verified compilation ofwarp_featuresandwarp_graphqlcrates. Full app compilation blocked by pre-existinghttp_clienterror unrelated to this change.Agent Mode
Co-Authored-By: Oz oz-agent@warp.dev