Skip to content

[QUALITY-598] Exclude child agent initial prompt from history completions#10304

Merged
cephalonaut merged 1 commit into
masterfrom
matthew/child-visibility
May 7, 2026
Merged

[QUALITY-598] Exclude child agent initial prompt from history completions#10304
cephalonaut merged 1 commit into
masterfrom
matthew/child-visibility

Conversation

@cephalonaut
Copy link
Copy Markdown
Contributor

@cephalonaut cephalonaut commented May 6, 2026

Description

Skip the synthetic orchestrator prompt in child agent conversations by using .skip(1) on root_task_exchanges() when the conversation is a child (is_child_agent_conversation()). User follow-up queries in the same child conversation are preserved.

This approach requires no persistence changes — is_child_agent_conversation() is derived from parent_conversation_id/parent_agent_id which are already persisted in AgentConversationData. It works correctly across app restarts and server-restored conversations.

Also clears children_by_parent in reset() for consistency (pre-existing omission).

Linked Issue

Testing

Manual: ran orchestration spawning child agents, verified the orchestrator's initial prompt no longer appears in agent input completions while user follow-up queries in revealed child panes still appear.

Agent Mode

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

Conversation | Plan

CHANGELOG-BUG-FIX: Child agent initial prompts (from orchestrator) no longer appear in the agent input completion history.

@cla-bot cla-bot Bot added the cla-signed label May 6, 2026
@cephalonaut cephalonaut marked this pull request as ready for review May 7, 2026 00:24
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 7, 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 adds a flat child-conversation index and uses it to filter child-agent conversation prompts out of AI prompt history across live, cleared, and persisted sources.

Concerns

  • Manual testing is required for changes that can be manually tested. Please include screenshots or a screen recording that show the prompt completion history excluding child agent prompts while preserving regular user prompts, or justify why visual evidence is not possible.

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

@cephalonaut cephalonaut requested a review from liliwilson May 7, 2026 00:29
@cephalonaut cephalonaut changed the title [QUALITY-598] Exclude child agent prompts from history completions [QUALITY-598] Exclude agent-initiated prompts from history completions May 7, 2026
@cephalonaut cephalonaut force-pushed the matthew/child-visibility branch from 38b5434 to ae599e4 Compare May 7, 2026 19:32
@cephalonaut cephalonaut changed the title [QUALITY-598] Exclude agent-initiated prompts from history completions [QUALITY-598] Exclude child agent initial prompt from history completions May 7, 2026
@cephalonaut cephalonaut requested a review from liliwilson May 7, 2026 20:51
@cephalonaut
Copy link
Copy Markdown
Contributor Author

Hey Lili - realized previous approach was too broad. I really just want to skip first exchange of child conversations so that the initial child agent prompt is not included.

@cephalonaut cephalonaut force-pushed the matthew/child-visibility branch from ae599e4 to cfe7375 Compare May 7, 2026 20:56
Skip the synthetic orchestrator prompt in child agent conversations
by using .skip(1) on root_task_exchanges() when the conversation is
a child. This preserves user follow-up queries while requiring no
persistence changes — is_child_agent_conversation() is derived from
parent_conversation_id/parent_agent_id which are already persisted.

Also clears children_by_parent in reset() for consistency.

Closes QUALITY-598

Co-Authored-By: Oz <oz-agent@warp.dev>
@cephalonaut cephalonaut force-pushed the matthew/child-visibility branch from cfe7375 to 2fccbd9 Compare May 7, 2026 21:03
Copy link
Copy Markdown
Contributor

@liliwilson liliwilson left a comment

Choose a reason for hiding this comment

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

Nice, this makes sense to me!

@cephalonaut cephalonaut enabled auto-merge (squash) May 7, 2026 21:56
@cephalonaut cephalonaut merged commit ec1788f into master May 7, 2026
38 of 40 checks passed
@cephalonaut cephalonaut deleted the matthew/child-visibility branch May 7, 2026 22:07
trungtai1805 pushed a commit to trungtai1805/warp that referenced this pull request May 9, 2026
…ions (warpdotdev#10304)

## Description
Skip the synthetic orchestrator prompt in child agent conversations by
using `.skip(1)` on `root_task_exchanges()` when the conversation is a
child (`is_child_agent_conversation()`). User follow-up queries in the
same child conversation are preserved.

This approach requires no persistence changes —
`is_child_agent_conversation()` is derived from
`parent_conversation_id`/`parent_agent_id` which are already persisted
in `AgentConversationData`. It works correctly across app restarts and
server-restored conversations.

Also clears `children_by_parent` in `reset()` for consistency
(pre-existing omission).

## Linked Issue
-
[QUALITY-598](https://linear.app/warpdotdev/issue/QUALITY-598/exclude-child-agent-prompts-from-history-completions)

## Testing
Manual: ran orchestration spawning child agents, verified the
orchestrator's initial prompt no longer appears in agent input
completions while user follow-up queries in revealed child panes still
appear.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

---

[Conversation](https://staging.warp.dev/conversation/1cd70e6d-e2d8-44a1-86fd-33a12fdd585c)
| [Plan](https://staging.warp.dev/drive/notebook/RatsJ03TieFO8Ax5hxso9b)

CHANGELOG-BUG-FIX: Child agent initial prompts (from orchestrator) no
longer appear in the agent input completion history.

Co-authored-by: Oz <oz-agent@warp.dev>
tungd pushed a commit to tungd/warp that referenced this pull request May 11, 2026
…ions (warpdotdev#10304)

## Description
Skip the synthetic orchestrator prompt in child agent conversations by
using `.skip(1)` on `root_task_exchanges()` when the conversation is a
child (`is_child_agent_conversation()`). User follow-up queries in the
same child conversation are preserved.

This approach requires no persistence changes —
`is_child_agent_conversation()` is derived from
`parent_conversation_id`/`parent_agent_id` which are already persisted
in `AgentConversationData`. It works correctly across app restarts and
server-restored conversations.

Also clears `children_by_parent` in `reset()` for consistency
(pre-existing omission).

## Linked Issue
-
[QUALITY-598](https://linear.app/warpdotdev/issue/QUALITY-598/exclude-child-agent-prompts-from-history-completions)

## Testing
Manual: ran orchestration spawning child agents, verified the
orchestrator's initial prompt no longer appears in agent input
completions while user follow-up queries in revealed child panes still
appear.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

---

[Conversation](https://staging.warp.dev/conversation/1cd70e6d-e2d8-44a1-86fd-33a12fdd585c)
| [Plan](https://staging.warp.dev/drive/notebook/RatsJ03TieFO8Ax5hxso9b)

CHANGELOG-BUG-FIX: Child agent initial prompts (from orchestrator) no
longer appear in the agent input completion history.

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.

2 participants