Skip to content

QUALITY-731: round-trip orchestrator agent short name through task records#11090

Open
cephalonaut wants to merge 4 commits into
masterfrom
matthew/roundtrip-agent-name
Open

QUALITY-731: round-trip orchestrator agent short name through task records#11090
cephalonaut wants to merge 4 commits into
masterfrom
matthew/roundtrip-agent-name

Conversation

@cephalonaut
Copy link
Copy Markdown
Contributor

Description

Threads the orchestrator-supplied agent short name (run_agents.agent_run_configs[i].name) through the server task record so shared-session viewers can display the short label (e.g. frontend-tests) instead of the descriptive title or a truncated prompt.

Wire contract

  • REST/JSON: optional name field alongside the existing required title.
  • GraphQL: new optional CreateAgentTaskInput.agentName: String mutation field.
  • Rust: Option<String>, deserialized with #[serde(default)] for backward-compat.
  • DB column: agent_name (server PR).

SpawnAgentRequest.name uses skip_serializing_if = "Option::is_none" so older servers see the same payload shape as today.

Client changes

  • AmbientAgentTask gains name: Option<String> and a display_name() helper that returns trimmed name → trimmed title"Agent", so the UI never renders a blank pill.
  • AIClient::create_agent_task takes an agent_name: Option<String> argument; whitespace-only values normalize to None.
  • launch_remote_child forwards request.name into SpawnAgentRequest.name (trimmed, empty → None).
  • prepare_local_harness_child_launch / launch_local_harness_child thread the same name into create_agent_task so local harness children get the orchestrator label, not just remote ones.
  • OrchestrationViewerModel::apply_children_fetch uses task.display_name() for the child conversation's pill label and stashes the descriptive task.title via set_fallback_display_title so it stays discoverable.
  • ConversationDetailsData::from_task uses display_name() for the side-pane header title; the raw prompt remains in source_prompt.

Server PR: https://github.com/warpdotdev/warp-server/pull/11223

Testing

  • Targeted unit tests (cargo test -p warp):
    • ai::ambient_agents::task::tests::display_name_* — 5 cases covering name, title, whitespace, blank, and trim fallback.
    • terminal::shared_session::viewer::orchestration_viewer_model::tests::registers_child_agent_name_* — 4 cases covering name-vs-title registration and the blank/whitespace fallbacks.
    • ai::conversation_details_panel::tests::test_from_task_uses_orchestrator_short_name_as_panel_title and the matching missing-name fallback case.
    • pane_group::pane::local_harness_launch::tests::prepare_local_codex_child_* — confirms the agent_name argument is threaded into create_agent_task (both with and without a value).
    • server::server_api::ai::tests::spawn_agent_request_serializes_name_when_present / _omits_name_when_none — pins the on-wire JSON shape.
  • cargo fmt -- --check clean.
  • cargo clippy --workspace --exclude warp_completer --exclude command-signatures-v2 --all-targets --tests -- -D warnings clean.

Agent Mode

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

…cords

Threads the orchestrator-supplied short name (`run_agents.agent_run_configs[i].name`)
through SpawnAgentRequest and AmbientAgentTask so shared-session viewers can
display the short label (e.g. "frontend-tests") instead of the descriptive
title or a truncated prompt.

Wire contract: REST/JSON `name`, GraphQL `agentName`, Rust `agent_name`,
DB `agent_name`. SpawnAgentRequest.name uses `skip_serializing_if = "Option::is_none"`;
AmbientAgentTask.name uses `#[serde(default)]` for backward-compatible
deserialization from older servers.

New display_name() helper on AmbientAgentTask returns trimmed name -> trimmed
title -> "Agent" so the UI never falls back to a blank label.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 16, 2026
cephalonaut and others added 2 commits May 15, 2026 23:40
Keep the viewer pill/breadcrumb/hover/transcript surfaces using the orchestrator-supplied short name via display_name(), but leave ConversationDetailsData::from_task on task.title for now. Product may ultimately want to show both name and title in the side pane; defer that decision until there is real feedback rather than guess at the shape.

Removes the two details-panel display_name tests added in the initial implementation. The viewer/details fixture in create_test_task still includes name: None to satisfy the new field on AmbientAgentTask. Updates the client TECH.md to document the deferral.

Co-Authored-By: Oz <oz-agent@warp.dev>
Trim/remove comment blocks added in the initial QUALITY-731 commit that
either restated 'name vs title' multiple times or repeated information
already visible from the symbol or types. Keeps the doc comment on
display_name() (the lookup-order contract), tightens the field doc on
AmbientAgentTask.name, and shortens the per-site notes around None
literals and trim points. No behavior changes.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cephalonaut cephalonaut marked this pull request as ready for review May 16, 2026 03:48
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 16, 2026

@cephalonaut

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR threads the orchestrator-supplied child agent name through the task request/response paths and updates viewer registration to prefer the new display-name fallback. The REST and GraphQL payloads remain optional/backward-compatible, and the local/remote child paths both normalize empty names before persistence.

Concerns

  • Non-blocking: the added client spec references a contributor-local absolute path; use a portable reference so the checked-in spec remains useful outside that workstation.

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

Comment thread specs/QUALITY-731/TECH.md
- `app/src/ai/blocklist/history_model.rs (398-433)` — `start_new_child_conversation` writes its `name` argument directly into `AIConversation::agent_name`.
- `app/src/ai/agent/conversation.rs (776-785, 1293-1309)` — `agent_name()` backs orchestration labels; `title()` falls back to `fallback_display_title`.
- `app/src/ai/conversation_details_panel.rs (285-352)` — `ConversationDetailsData::from_task` currently uses `task.title` as the side-pane title.
The matching server spec in `/Users/matthew/src/roundtrip-agent-name/warp-server/specs/QUALITY-731/TECH.md` defines the wire contract: task responses include optional JSON `name` while retaining descriptive `title`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 [SUGGESTION] Avoid checking in a contributor-local absolute path; reference the linked server PR or a repository-relative spec path instead.

Suggested change
The matching server spec in `/Users/matthew/src/roundtrip-agent-name/warp-server/specs/QUALITY-731/TECH.md` defines the wire contract: task responses include optional JSON `name` while retaining descriptive `title`.
The matching server spec in the linked warp-server PR defines the wire contract: task responses include optional JSON `name` while retaining descriptive `title`.

…l comment)

Apply four reviewer findings:

- Sync the client GraphQL schema docstring for CreateAgentTaskInput.agentName
  with the server wording and explicit reference to run_agents.agent_run_configs[i].name,
  so the file does not drift on the next graphql-codegen run.
- Align the REST trim in launch_remote_child with the GraphQL trim in
  AIClient::create_agent_task; both use the (let trimmed = name.trim(); ...)
  pattern, with a cross-reference comment on each side.
- Note in orchestration_viewer_model.rs that on the name=None back-compat path
  agent_name and fallback_display_title are deliberately both seeded from
  task.title because the two surfaces consume different fallback chains.
- Add an in-code comment on ConversationDetailsData::from_task pointing at
  specs/QUALITY-731/TECH.md to flag the deferred title surface.

Declined Finding 8: the make_task wrapper provides cleaner call sites for the
seven non-name test cases.

Co-Authored-By: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant