Skip to content

Agent Mode: model who drives a conversation as a ConversationDriver enum - #16355

Merged
kevinyang372 merged 1 commit into
masterfrom
kevin/acp-2b-conversation-driver
Oct 9, 2026
Merged

kevinyang372 merged 1 commit into
masterfrom
kevin/acp-2b-conversation-driver

Conversation

@kevinyang372

@kevinyang372 kevinyang372 commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Description

Prep PR for the ACP harness stack (inserted between 2/4 and 3/4), from the design discussion on #16331. No behavior change.

AIConversation carried three overlapping booleans that each answered part of "who owns this turn": is_viewing_shared_session (~25 call sites conflating "not owned here" with "inputs arrive via the stream"), is_cli_agent_transcript, and is_remote_child. The next PR needs a fourth mode (an external harness that authors the stream but whose lifecycle this client does not own), and bolting on another boolean would mean auditing every site again.

What:

  • ai/agent/conversation_driver.rs: enum ConversationDriver { Native, SharedSessionViewer, CliAgentTranscript, RemoteChild } with exhaustive-match predicates that call sites can ask instead of "is this a viewer?": owns_turn_lifecycle, executes_tool_calls_locally, reconstructs_inputs_from_messages, reports_task_status, is_read_only_ui, is_persisted_locally.
  • AIConversation stores a single driver (plus driver() / set_driver()); the three booleans and their setters remain as thin wrappers whose docs point at the predicate to migrate to, so no call site outside conversation.rs changes. Inside conversation.rs the three input-reconstruction sites and the persistence guard move to the predicates they actually mean.
  • The parent/child relationship (parent_conversation_id) is an orthogonal axis and is left alone.

Audit: no production or test path ever sets two of the old booleans on one conversation (is_cli_agent_transcript only via start_new_conversation from mutually exclusive AgentViewEntryOrigins; mark_as_remote_child only on a fresh child; set_is_viewing_shared_session(true) only on cloud-restored/forked conversations with is_remote_child hard-coded false), so a flat enum loses nothing. set_is_viewing_shared_session(false) only demotes a SharedSessionViewer back to Native, matching the old independent-bool semantics under that invariant.

Deliberately not migrated (candidates for a follow-up, each a one-line change once the enum exists): local_agent_task_sync_model.rs (reports_task_status), agent_input_footer (is_read_only_ui), and the viewer-only timing / exchange-move / temp-dir-cleanup sites in conversation.rs.

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

New conversation_driver_tests.rs (per-variant predicate table) and conversation_tests.rs cases for constructor → driver mapping and wrapper/setter semantics. Ran the conversation, blocklist controller, history model, shared session, pane group, orchestration, task sync, and agent-view suites (~1,250 tests) — all pass. cargo clippy -D warnings and ./script/format clean.

  • I have manually tested my changes locally with ./script/run

Agent Mode

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

Co-Authored-By: Warp agent@warp.dev

@kevinyang372
kevinyang372 marked this pull request as ready for review October 8, 2026 02:57
@kevinyang372
kevinyang372 requested a review from bnavetta October 8, 2026 02:57
@warp-for-oss

warp-for-oss Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

@kevinyang372

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

Powered by Oz

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

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.

Overview

This PR replaces the overlapping AIConversation ownership booleans with a ConversationDriver enum, keeps compatibility wrappers for existing call sites, and adds focused unit coverage for driver predicates, constructor mapping, restore mapping, and wrapper semantics.

Concerns

  • No blocking concerns found. I did not find material spec drift; the provided spec context contains no approved repository spec. The security pass did not identify new input, auth, secrets, logging, command execution, or data-handling risks.
  • Comment audit: the added/changed doc comments on ConversationDriver and the legacy wrapper methods document current API semantics and migration guidance without narrating implementation internals; the new test comment explains the compatibility invariant being asserted.
  • Test audit: the new tests cover the per-variant predicate table and the legacy constructor/wrapper behavior affected by the refactor.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /warp-agent-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@kevinyang372
kevinyang372 force-pushed the kevin/acp-2-child-process branch from 28fb8e0 to 1589cda Compare October 8, 2026 03:14
@kevinyang372
kevinyang372 force-pushed the kevin/acp-2b-conversation-driver branch from c9abdfe to 955b01c Compare October 8, 2026 03:15
@kevinyang372
kevinyang372 force-pushed the kevin/acp-2-child-process branch from 1589cda to 95fac3c Compare October 8, 2026 17:24
@kevinyang372
kevinyang372 force-pushed the kevin/acp-2b-conversation-driver branch from 955b01c to 0051d79 Compare October 8, 2026 17:24
@kevinyang372
kevinyang372 force-pushed the kevin/acp-2-child-process branch from 95fac3c to f1f397f Compare October 8, 2026 18:34
@kevinyang372
kevinyang372 force-pushed the kevin/acp-2b-conversation-driver branch 2 times, most recently from af940d8 to d2de106 Compare October 8, 2026 22:41
@kevinyang372
kevinyang372 force-pushed the kevin/acp-2-child-process branch 2 times, most recently from 2e84c08 to fe5c450 Compare October 9, 2026 03:48
@kevinyang372
kevinyang372 force-pushed the kevin/acp-2b-conversation-driver branch from d2de106 to a91b229 Compare October 9, 2026 03:48
Base automatically changed from kevin/acp-2-child-process to master October 9, 2026 04:35
Replace the three overlapping ownership booleans on AIConversation
(is_viewing_shared_session, is_cli_agent_transcript, is_remote_child) with a
single ConversationDriver field plus derived behaviour predicates. The legacy
accessors stay as thin wrappers so call sites are unchanged; only the
in-file reads in conversation.rs move to the predicates they actually mean.
@kevinyang372
kevinyang372 force-pushed the kevin/acp-2b-conversation-driver branch from a91b229 to 8be8e96 Compare October 9, 2026 04:37
@warp-factories

warp-factories Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

@kevinyang372 Warp CI failed on this PR. May the windows runner test factory diagnose it, commit fixes, and push to this same branch? Explicit consent also opts this PR into automatic handling of future CI failures; we will not open a replacement PR or merge.

Please reply to this request with an explicit yes or no, mentioning @warp and “windows runner test”.

Responding as windows runner test: Open session · View in factory

@warp-factories warp-factories Bot added the factory-ci-permission-pending Awaiting PR author consent for factory CI diagnosis and branch fixes label Oct 9, 2026

@bnavetta bnavetta left a comment

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.

Nice!

@kevinyang372
kevinyang372 merged commit 760d01e into master Oct 9, 2026
47 of 49 checks passed
@kevinyang372
kevinyang372 deleted the kevin/acp-2b-conversation-driver branch October 9, 2026 18:03
@warp-factories warp-factories Bot removed the factory-ci-permission-pending Awaiting PR author consent for factory CI diagnosis and branch fixes label Oct 9, 2026
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