• Will Chen's avatar
    Remove deprecated agent mode and consolidate with build mode (#2435) · a6baaef1
    Will Chen 提交于
    ## Summary
    - Remove "Build with MCP" option from chat mode selector dropdowns
    - Route build mode to MCP agent code path when MCP servers are enabled
    - Add MCP chip showing "N MCP" next to Build button when servers enabled
    - Show MCP tools picker in build mode when MCP servers are enabled
    - Skip deprecated agent mode in keyboard shortcut toggle cycle
    - Update e2e tests to use build mode instead of agent mode
    
    ## Test plan
    - [x] MCP e2e tests pass (verified locally)
    - [ ] Verify Build mode works normally without MCP servers configured
    - [ ] Configure an MCP server and verify the "N MCP" chip appears next
    to Build button
    - [ ] Verify clicking MCP tools picker shows enabled MCP servers
    - [ ] Verify sending a message in Build mode with MCP servers uses the
    agent code path
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    <!-- devin-review-badge-begin -->
    
    ---
    
    <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2435">
      <picture>
    <source media="(prefers-color-scheme: dark)"
    srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img
    src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
    alt="Open with Devin">
      </picture>
    </a>
    <!-- devin-review-badge-end -->
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > **Medium Risk**
    > Changes the chat-mode UI and the main chat streaming branching so
    Build may enter the MCP/tooling code path when MCP servers are enabled;
    this can alter assistant behavior and tool-consent flows. Lockfile churn
    may also affect dependency installs across environments.
    > 
    > **Overview**
    > **Removes the user-facing “Build with MCP”/`agent` mode selection**
    and treats stored `agent` settings as **Build** for backwards
    compatibility.
    > 
    > **Build now conditionally enables MCP tooling**: the MCP tools picker
    appears in Build only when at least one MCP server is enabled, and the
    main streaming handler runs the MCP agent pre-pass only when Build has
    enabled MCP servers (or when legacy `agent` is set).
    > 
    > Adds a small **“N MCP” status chip** next to Build when MCP servers
    are enabled, updates the keyboard mode-toggle cycle to skip deprecated
    `agent`, updates MCP e2e tests to select Build, and includes a large
    `package-lock.json` metadata update (peer flag changes).
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    6338761b9e45313d399dd2f4873e5ef9a53ff36a. This will update automatically
    on new commits. Configure
    [here](https://cursor.com/dashboard?tab=bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Removed the deprecated Agent mode by folding it into Build. Build now
    uses MCP tooling only when MCP servers are enabled; the UI shows an MCP
    count chip and tools picker, and old “agent” settings still work.
    
    - **Refactors**
    - Removed Agent from mode selectors; legacy “agent” appears as Build and
    the keyboard toggle skips it.
    - Build routes through the MCP agent path only when enabled MCP servers
    exist; otherwise behaves like normal Build.
    - Preserved compatibility for users with “agent” in settings and in the
    streaming path.
    - Updated E2E tests to use Build and aligned test_helper with the
    modular PageObject structure.
    
    - **New Features**
      - Added an “N MCP” chip next to Build when servers are enabled.
      - Show the MCP tools picker in Build when MCP servers are enabled.
    
    <sup>Written for commit 6338761b9e45313d399dd2f4873e5ef9a53ff36a.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    ---------
    Co-authored-by: 's avatarClaude Opus 4.5 <noreply@anthropic.com>
    Co-authored-by: 's avatarclaude[bot] <41898282+claude[bot]@users.noreply.github.com>
    a6baaef1
chat_stream_handlers.ts 70.2 KB