Remove prompt requirement from cloud run initiation#11573
Conversation
Make SpawnAgentRequest.prompt an Option<String> with serde skip_serializing_if so the wire payload can omit the field when the client has no prompt to send. Existing callers wrap their previous String values in Some(...) so the on-the-wire shape is unchanged. The ambient CLI's run_agent path sends prompt: None (instead of an empty string) when neither --prompt nor --saved-prompt is provided, so the wire payload reflects the user's intent. Update view_impl.rs to only render a queued user-query block when the request prompt is Some(..), and the cloud-mode entry-block title fallback to read request.prompt.as_deref(). All existing handoff, fork, and child-agent flows continue to use the existing conversation_id-based fork plumbing. Co-Authored-By: Oz <oz-agent@warp.dev>
Retroactively documents the warp-4 half of Stage 1: widening SpawnAgentRequest.prompt from String to Option<String>, all constructors wrapping existing values in Some(...), and the two reader sites switching to .as_deref(). Pairs with the warp-server-4 sibling spec on the same slug. Co-Authored-By: Oz <oz-agent@warp.dev>
Move the warp-4 Stage 1 tech spec from the empty-prompt-handoff slug to the Linear-ID-keyed REMOTE-1499 slug, and add the canonical PRODUCT.md and TECH.md that describe the full feature behavior and architecture end-to-end across all stages. - specs/REMOTE-1499/PRODUCT.md: full product spec for the feature, covering the three empty-prompt entry points (chip / & / /handoff with no arg) as functionally equivalent immediate-handoff dispatches, the continue in the cloud wire substitution, snapshot rehydration, the queued-prompt indicator label variants decoupled from the wire substitution, the Cloud Mode Setup V2 pane teardown behavior, telemetry extensions, and the EmptyPromptHandoff feature flag. - specs/REMOTE-1499/TECH.md: full warp-4 tech spec across Stage 1 (wire contract), Stage 2a (entry points + substitution + indicator), Stage 2b (worker-derived skip-initial-turn client-side), Stage 2c (TerminalModel helper, AgentDriver restructure, IdleTimeoutSender helper, viewer arm), and Stage 2d (non-skip ServerSide marker + legacy fallback comments). - specs/REMOTE-1499/STAGE-1.md: Stage 1 sub-tech-spec scoped to what this branch delivers (Option<String> widening, twelve constructor sites, two borrow-site readers, the CLI ambient.rs skill-only path, tests). - Remove the old specs/empty-prompt-handoff/ directory entirely.
Specs read as fresh, neutral descriptions of the current architecture
rather than narrating the implementation process:
- Drop "Stage 2a/2b/2c/2d" sub-stage labels everywhere; the spec
vocabulary is just Stage 1 and Stage 2. Sub-stage decomposition was an
internal planning artifact.
- Drop historical framing ("originally the design plumbed X", "the
refactor replaced Y", "previously coerced Z", "the stored-flag shape
created a bug", "two-cause root cause", "the wedge"). Architecture
sections describe what the code does now; rejected alternatives appear
forward-looking under "Considered alternatives".
- Drop orchestrator-language framing on validation notes.
- Clarify that STAGE-2.md is added on the stacked branch, not on this
branch.
Update the stage-spanning PRODUCT.md and TECH.md under specs/REMOTE-1499/ to reflect the resolved design decisions: * Wire substitution is described as a coupled (display = wire) client-side decision. The "Continue" and "Apply the workspace changes from my previous session." strings drive both the wire prompt and the queued-prompt indicator; there is no separate indicator enum. * Document the source-content guardrail that gates the three immediate- handoff entry points: chip / & on empty buffer / /handoff no-arg only fire when the active source conversation has at least one exchange. Fallbacks: chip -> compose mode, & Enter -> no-op, /handoff no-arg -> no-op. * Server-side ShouldSkipInitialTurn simplifies to prompt.is_empty() now that the client always carries a non-empty substituted prompt when a snapshot is present. The InitialSnapshotToken check is removed. * Drop the "Open design questions" section entirely; every question is resolved. * Rename HandoffInjectionPath::SnapshotRehydrationOnly -> SnapshotRehydration. STAGE-1.md is unchanged - this stage still only widens SpawnAgentRequest.prompt to Option<String>. Validation: cargo fmt --all --check passes (no code changes on Stage 1). Co-Authored-By: Oz <oz-agent@warp.dev>
…tter enumeration and pin line numbers Triaged from review followup: 1. Add doc comment on SpawnAgentRequest.prompt explaining the None semantics. 2. Fix STAGE-1.md to enumerate the actual runtime None emitters (skill-only and conversation-only invocations; saved-prompt-only does not produce None since it resolves or fatal-errors). 3. Re-pin line-number references in STAGE-1.md to match Stage-1 file layout (ai.rs:206-208 after the doc comment, model_tests.rs:143/276/339 dropping the stale 318). Co-Authored-By: Oz <oz-agent@warp.dev>
…ration Section 1 (Stage 1) references now point to actual Stage 1 file layout: - ai.rs:206-208 (after the new doc comment) - model.rs:622-649 for build_handoff_spawn_request, :1111-1139 for spawn_agent Section 2.4 and 3.2 also re-pinned to Stage 1 model.rs locations (Stage 2 extends those functions in place). Stage 2-only references (workspace/view.rs, agent_input_footer, input.rs, slash_commands, driver.rs, Cargo.toml) are left as forward-looking placeholders since they describe code that doesn't exist or has different content on the Stage 1 base. Section 1's enumeration of None emitters corrected to 'skill-only and conversation-only invocations' with a note that saved-prompt invocations resolve to Some(text) or fatal-error. Co-Authored-By: Oz <oz-agent@warp.dev>
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
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 widens SpawnAgentRequest.prompt to Option<String>, updates construction and read sites to preserve the existing Some(...) behavior for interactive paths, and adds a serialization test for omitted prompts. I did not find blocking correctness or security issues in the changed code.
Concerns
- The new specs include author-local absolute paths in code-fence metadata; replace them with repo-relative paths or remove the metadata so the checked-in spec is portable.
Verdict
Found: 0 critical, 0 important, 1 suggestions
Approve with nits
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz

Description
This is the first step in a broader changeset to allow for local to cloud handoff with no prompt. This PR is completely structural, just changing it so that the prompt in
SpawnAgentRequestis optional. This is paired with a server-side PR to make the prompt optional on the server as well.The next step is to actually add the product surface for promptless local to cloud handoff. The overall plan is described in the broad product/tech spec in this PR, and then this changeset is described in
STAGE-1.md(the PR to follow will have its ownSTAGE-2.md)Agent Mode