CLI: expose named-agent prompt in oz agent create/update (REMOTE-2309) - #14261
Conversation
The public REST API already supports an optional named-agent `prompt` in
CreateAgentRequest/UpdateAgentRequest/AgentResponse, and the Oz web app uses
it, but the Oz CLI never exposed it. This adds CLI parity with no server
change.
crates/warp_cli/src/agent.rs:
- AgentCreateArgs: add `--prompt <TEXT>`.
- AgentUpdateArgs: add `--prompt <TEXT>` and `--remove-prompt`, mutually
exclusive via clap `conflicts_with` (mirrors `--description`/
`--remove-description`, `--base-model`/`--remove-base-model`,
`--environment`/`--remove-environment`).
app/src/server/server_api/ai.rs:
- CreateAgentRequest/UpdateAgentRequest: add `prompt: Option<String>` with
`skip_serializing_if = "Option::is_none"` (None = omit/unchanged;
Some("") = clear via the API's PATCH clear-via-empty semantics).
- AgentResponse: add `prompt: Option<String>` with `#[serde(default)]` so
`oz agent get`/`list` surface the server-returned prompt.
app/src/ai/agent_sdk/agent_management.rs:
- Extract `build_create_request`/`build_update_request` from the inline
`create`/`update` bodies so the field forwarding is unit-testable without
a live server; forward `prompt` (create) and the replace/remove/unchanged
mapping (update) matching the existing scalar-field pattern.
- `request_is_empty` now treats `prompt` as an update, so a bare
`oz agent update <UID>` still errors with "No updates requested".
- Add a "Prompt" column to the pretty/text agent table output.
Tests:
- crates/warp_cli/src/lib_tests.rs: clap conflict + accept-prompt/
accept-remove-prompt/leave-unset/create-accepts-prompt parsing tests.
- app/src/ai/agent_sdk/agent_management_tests.rs: build_*_request prompt
forwarding, request_is_empty, serde omit/serialize/clear semantics, and
AgentResponse prompt deserialization (present/absent/null).
Co-Authored-By: Oz <oz-agent@warp.dev>
|
@warp-dev-github-integration[bot] 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 prompt support to oz agent create/update, forwards the field through the typed public API request/response models, and surfaces prompts in CLI agent output.
Concerns
⚠️ [IMPORTANT] This is a user-facing CLI behavior/output change, but the provided PR description does not include screenshots or a screen recording demonstrating the new create/update/get/list behavior end to end. Repository review policy requires visual evidence for user-facing changes; a short terminal recording or screenshots of the CLI output would satisfy this.
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
There was a problem hiding this comment.
Overview
This PR adds the named-agent prompt field across the Oz CLI create/update arguments, local API request/response models, request forwarding, and tabular/serialized output. The create, replace, clear, unchanged, and clap-conflict behaviors match the ticket and existing remove-field patterns; all applicable GitHub CI checks are successful, and the focused warp_cli test/build gate passes locally (213 tests).
Verdict
Found: 0 critical, 0 important, 0 suggestions
Prior concerns: the earlier generic visual-evidence request does not apply because this is a headless CLI change, not a GUI/TUI surface.
Approve
Review run
https://oz.staging.warp.dev/runs/019f9574-e531-789c-8ca3-e7092fa421c1
Co-Authored-By: Oz <oz-agent@warp.dev>
Summary
The public REST API already supports an optional named-agent
promptinCreateAgentRequest/UpdateAgentRequest/AgentResponse(warp-server/public_api/openapi.yaml), and the Oz web app uses it, but the Oz CLI never exposed it. This adds CLI parity with no server change — an additive, localized analogue of the existingdescription/base_model/environmentremove-flag patterns.Behavior added:
oz agent create --name <NAME> --prompt <TEXT>sets the base prompt (CreateAgentRequest.prompt).oz agent update <UID> --prompt <TEXT>replaces the prompt (UpdateAgentRequest.prompt).oz agent update <UID> --remove-promptclears the prompt via the REST API's PATCH clear-via-empty semantics (Some(String::new())).--promptand--remove-promptconflict onupdate(clapconflicts_with).None).oz agent update <UID>with no changes still errors "No updates requested" (request_is_emptynow includesprompt).oz agent get/listsurface the prompt (ndjson/json via serde; pretty/text via a new "Prompt" column).Changes:
crates/warp_cli/src/agent.rs—--promptonAgentCreateArgs;--prompt/--remove-prompt(mutually exclusive) onAgentUpdateArgs.app/src/server/server_api/ai.rs—prompt: Option<String>onCreateAgentRequest/UpdateAgentRequest(skip_serializing_if = "Option::is_none") andAgentResponse(#[serde(default)]).app/src/ai/agent_sdk/agent_management.rs— extractedbuild_create_request/build_update_request(testable, no live server) forwardingpromptwith the replace/remove/unchanged mapping;request_is_emptyincludesprompt; "Prompt" table column.Verification
warp_clicrate:cargo test -p warp_cli --lib— 213 passed, 0 failed. New tests:agent_update_rejects_prompt_and_remove_prompt(clap conflict),agent_update_accepts_prompt_replacement,agent_update_accepts_remove_prompt,agent_update_leaves_prompt_unset_when_neither_flag_passed,agent_create_accepts_prompt.cargo build -p warp_clisucceeds.cargo fmt --checkpasses.appcrate regression tests added inagent_management_tests.rs:build_create_request_forwards_prompt,build_update_request_replaces_prompt,build_update_request_remove_prompt_clears_via_empty_string,build_update_request_leaves_prompt_unchanged_when_neither_flag_set,request_is_empty_treats_prompt_as_an_update,request_is_empty_clears_prompt_still_counts_as_an_update, create/update serde omit/serialize/clear semantics, andAgentResponseprompt deserialization (present/absent/null).Sandbox limitation (please note)
The
warp(app) crate could not be compiled or tested in this cloud sandbox: the environment has 3.8 GiB RAM / no swap, andcargo check/cargo test -p warp --libis OOM-killed (SIGKILL) even at-j 1with debuginfo off. The full./script/presubmit(workspace clippy + nextest) likewise cannot run here. Thewarp_clilayer (the user-facing CLI surface and clap arg-parsing) is fully built and tested locally; theapp-crate changes are simple additiveOption<String>field additions that follow the exact serde/forwarding pattern of the neighboringdescription/base_model/environment_idfields, and the newapp-crate regression tests are written and will compile/run in CI (which has adequate memory). Please rely on CI for theapp-crate build + test confirmation.This is a headless CLI change (no UI), so no
computer_use/screenshot verification applies.Originating thread: https://warpdotdev.slack.com/archives/C0BDQDW8V5E/p1784913085618339