Skip to content

Feature Request: Proposal a Fourth Mode "Dual" — Pro for Reasoning + Flash for Execution #1676

@encyc

Description

@encyc

提案:第四种模式 —— "Dual" 双模型路由模式

在现有的 Agent / Yolo / Plan 三种模式之外,增加第四种 Dual 模式——用 deepseek-v4-pro 做推理和规划(reasoning & planning),用 deepseek-v4-flash 做工具执行(execution),在不大幅降低质量的前提下减少 token 花费。

动机

  • deepseek-v4-pro 在复杂推理、架构设计、安全审计等场景远强于 Flash
  • 但工具调用(读文件、搜代码、跑命令、diff 等)不需要深度推理,Flash 完全够用,且便宜 ~6×
  • 目前 /model auto 的自动路由是按 turn 整体选择一个模型(要么 Pro 要么 Flash),无法在一个 turn 内做 phase 切换
  • 如果能在同一轮对话中:Pro 负责「想」,Flash 负责「做」,可以显著降低费用

现有基础设施(已部分就绪)

  1. Auto model routing (/model auto):auto_model_heuristic + resolve_auto_route_with_flash,per-turn 选模型
  2. Sub-agent routersubagent_flash_router,Flash 决定子 agent 用 Pro 还是 Flash
  3. AutoRouteSelection / AutoRouteRecommendation:模型 + reasoning effort 路由数据结构
  4. 三种现有模式:Agent、Yolo、Plan

关键缺失

  • Turn 内 phase 切换:当前 Engine 的 turn 循环不支持中途切换模型
  • 消息历史衔接:Pro 的 reasoning_content → Flash 的 tool call → Pro 的 synthesis 需要在 API 层面正确拼接
  • 工具执行模型选择:什么时候切 Flash、什么时候保留 Pro 的判断逻辑

技术可行性分析

方案 复杂度 描述
A: 串行分 phase Pro 先做 planning → Flash 执行工具 → Pro 做 synthesis。每轮 2 次 API 调用
B: 子 agent 委派 低-中 Pro 作为主 agent 规划,Flash 子 agent 执行工具。复用现有 sub-agent 设施
C: 动态 mid-turn 切换 Pro/Flash 在同一 turn 内根据 tool call 类型动态切换。最深度的集成

方案 B 最可行:已有 sub-agent auto-router(subagent_flash_router),只需增加一个 Dual 模式开关,让主 agent 用 Pro、子 agent 用 Flash。

预期效果

  • 复杂任务(架构设计、多文件重构、安全审计):质量保持 Pro 水平
  • Token 花费:tool execution 部分省 ~80%(Flash vs Pro 的价格差)
  • 延迟:子 agent 并行执行可能反而更快

开放问题

  1. 用户如何感知当前在 Dual 模式——footer 显示什么?
  2. 是否需要一个「Dual 强度」配置(偏激进 Flash vs 偏保守 Pro)?
  3. 兼容性:Dual 模式下 /model auto 如何交互?
  4. 是否所有 tool call 都用 Flash,还是某些高风险的(如 shell exec、git push)保留 Pro?

欢迎社区讨论!如果你有类似需求或有更好的设计思路,请在下面留言。

Related

  • 现有 auto model routing: crates/tui/src/commands/config.rs resolve_auto_route_with_flash
  • 子 agent router: crates/tui/src/tools/subagent/mod.rs subagent_flash_router
  • AppMode 枚举: crates/tui/src/tui/app.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions