JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
update(doc): mode docs update
douran86f7c096a7e5
diff --git a/docs/en/CLI.md b/docs/en/CLI.mdindex 30792891b0..deb624616d 100644--- a/docs/en/CLI.md+++ b/docs/en/CLI.md@@ -65,6 +65,8 @@ Sets the working mode for the current channel. The Agent uses this when construc| `/mode code.normal` | Code mode + direct execution style (default) || `/mode code.team` | Code mode + team style |+> Note: this table is the Gateway controlled-channel whitelist. The TUI local `/mode` command also supports `/mode plan` (equivalent to `agent.plan`), `/mode team.normal` (equivalent to `team`), and `/mode team.plan` (directly sets `team.plan`); those forms are not recognized by Gateway controlled channels.+**Usage**```text@@ -98,6 +100,8 @@ Switches secondary style within the current primary mode, more concise than `/mo| `/switch normal` | Not supported | → `code.normal` || `/switch team` | Not supported | → `code.team` |+> The TUI source contains a `/switch` implementation, but the default TUI command registry does not currently register it. In TUI, prefer `/mode ...` or `/plan` for sub-mode switching.+**Usage**```text@@ -232,4 +236,4 @@ Cancel operation:- Mode is stored **per channel** (`channel_id` → `mode`). All subsequent messages on that channel will automatically include the current mode.- `default_mode` can be set in `config.yaml` as the initial value; `MessageHandler` reads it on startup.-- `/new_session` and `/mode` changes will automatically cancel tasks currently running in the session.\ No newline at end of file+- `/new_session` and `/mode` changes will automatically cancel tasks currently running in the session.diff --git a/docs/en/Modes.md b/docs/en/Modes.mdindex 9a14653eb5..914630a7d1 100644--- a/docs/en/Modes.md+++ b/docs/en/Modes.md@@ -12,7 +12,9 @@ JiuwenSwarm supports multiple runtime modes, each with its own tool set, permiss| Agent (Fast) | `agent.fast` | Full tools + passive memory, focused on quick responses || Code (Plan) | `code.plan` | Code mode + coding memory, focused on code generation planning || Code (Normal) | `code.normal` | Code mode + coding memory, focused on code execution |+| Code (Team) | `code.team` | Team collaboration launched from the Code profile || Team | `team` | Multi-agent collaboration mode, based on the `team` definition in config |+| Team (Plan) | `team.plan` | Team collaboration with planning-oriented team runtime settings |---@@ -22,22 +24,31 @@ Use the following commands during a channel conversation:```/mode agent # Switch to Agent mode (defaults to agent.plan)+/mode plan # TUI local shorthand, equivalent to agent.plan/mode code # Switch to Code mode (defaults to code.normal)/mode team # Switch to Team mode/mode agent.plan # Switch directly to Agent Plan sub-mode/mode agent.fast # Switch directly to Agent Fast sub-mode/mode code.plan # Switch directly to Code Plan sub-mode/mode code.normal # Switch directly to Code Normal sub-mode+/mode code.team # Switch directly to Code Team sub-mode+/mode team.normal # TUI local form, equivalent to team+/mode team.plan # TUI local form, directly sets Team Plan mode```+> Compatibility: `/mode plan`, `/mode team.normal`, and `/mode team.plan` are TUI-local command forms. Gateway controlled channels accept only `agent`, `code`, `team`, `agent.plan`, `agent.fast`, `code.plan`, `code.normal`, and `code.team`.+You can also use `/switch` to change sub-modes within the same category:```/switch plan # Under Agent → plan; under Code → plan/switch fast # Under Agent → fast/switch normal # Under Code → normal+/switch team # Under Code → code.team```+> The TUI source contains a `/switch` implementation, but the default TUI command registry does not currently register it. In TUI, prefer `/mode ...` for direct switching or `/plan` to enter the current family’s plan sub-mode.+---## Configuration@@ -125,12 +136,24 @@ channels:## Mode Behavior Differences-| Behavior | Agent (plan) | Agent (fast) | Code | Team |-|----------|-------------|-------------|------|------|-| Tool set | All tools | All tools | Whitelisted + coding memory | Per-team config |-| Memory strategy | Proactive (auto read/write) | Passive (on-demand) | Coding memory | Per-team config |-| Safety rails | None extra | None extra | FileSystemRail + SkillUseRail + LspRail | Per-team config |-| Iteration limit | `react.max_iterations` | `react.max_iterations` | `react.max_iterations` | Leader can set `max_iterations` |+Modes do more than rename the UI state: they decide which AgentServer runtime profile is used, which Rails are attached, and how memory or team coordination is injected.++| Mode | Runtime profile | Agent behavior focus | Main Rails / tool differences | Memory strategy |+|------|-----------------|----------------------|--------------------------------|-----------------|+| `agent.plan` | Deep Agent (`mode=agent`, `sub_mode=plan`) | Default planning-oriented chat. Best for complex task decomposition, long reasoning, skill evolution, and tasks that benefit from subagents. | Registers `TaskPlanningRail` and `SubagentRail`; enables `SkillEvolutionRail` / `SkillCreateRail` when configured; keeps normal Agent tools such as search, multimodal tools, and skills. | Uses `modes.agent.plan.memory`; defaults to proactive memory (`is_proactive: true`) so context is retrieved and consolidated more actively. |+| `agent.fast` | Deep Agent (`mode=agent`, `sub_mode=fast`) | Fast response mode. Less orchestration, more direct answering or tool use on demand. | Unregisters `TaskPlanningRail`, `SkillEvolutionRail`, `SkillCreateRail`, and `SubagentRail`; keeps common runtime prompt, safety, permission, search/multimodal/skill tooling. | Uses `modes.agent.fast.memory`; defaults to passive memory (`is_proactive: false`) and usually reads/writes memory on demand. |+| `code.plan` | Code Adapter (`mode=code`, `sub_mode=plan`) | Planning phase for coding work. Useful for reading the project, decomposing edits, and preparing an implementation path. | Uses the Code-specific English system prompt; fixed Rails include `LspRail`, `ProjectMemoryRail`, `CodingMemoryRail`, `AgentModeRail`, `StructuredAskUserRail`, `ConfirmInterruptRail`, filesystem/permission Rails; dynamic Rails/tools come from `modes.code.rails` / `modes.code.tools`. | Does not use the general `MemoryRail`; uses `CodingMemoryRail` and project memory files such as `JIUWENSWARM.md` / `CLAUDE.md`. |+| `code.normal` | Code Adapter (`mode=code`, `sub_mode=normal`) | Execution phase for coding work. Useful for editing files, running commands, verifying changes, and delivering results. | Mostly the same Code Rails/tools as `code.plan`; the difference is the current mode semantics and command flow. Some commands, such as `/init`, auto-switch from `code.plan` to `code.normal` before writing. | Same as `code.plan`: coding memory + project memory. |+| `code.team` | Code Adapter + Team sub-mode (`mode=code`, `sub_mode=team`) | Team collaboration launched from the Code profile. Useful when a coding project needs multiple members to split work while preserving code-workspace semantics. | The main agent stays on the Code profile; TeamManager starts team members and attempts to inherit the Code-side project directory, code tooling, and member skill toolkit. | Team members follow Team config; code/project context is influenced by both the Code profile and Team runtime. |+| `team` | Team runtime (`mode=team`) | Standard multi-agent collaboration. A leader decomposes, schedules, and summarizes work while role members execute subtasks. | Team members attach Rails such as `RuntimePromptRail`, `ResponsePromptRail`, `SysOperationRail`, `TaskPlanningRail`, `SecurityRail`, `HeartbeatRail`, and `AvatarPromptRail`; the leader additionally supports Team skill evolution/creation; tools come from the inheritable whitelist and team config. | Controlled by `modes.team.<name>.memory`, including shared `TEAM_MEMORY.md`, auto-extraction, and member memory prompt injection. |+| `team.plan` | Team Plan (canonicalized as `team.plan`, runtime uses the code/team path) | Planning-enhanced Team entry. Intended to give the Team stronger planning semantics, especially for leader coordination. | Sets `enable_team_plan`; the leader can keep the configured runtime language instead of being forced into the Code profile’s English runtime prompt; members still follow the Team / Code-Team inheritance path. | Same Team memory config; Team Plan changes coordination prompts rather than defining a separate memory block. |++### Quick Mental Model++- `agent.plan` and `agent.fast` use the same Deep Agent profile, but `agent.plan` keeps planning, subagent, and skill-evolution Rails while `agent.fast` removes those heavier orchestration pieces.+- `code.plan` and `code.normal` use the same Code Adapter. The difference is mostly mode semantics and command flow; both have the Code prompt, LSP, project memory, coding memory, and file/permission guardrails.+- `code.team` and `team` both enter team collaboration, but from different entry points: `code.team` starts from the Code profile and is better for code-project delegation; `team` is the standard Team runtime.+- `team.plan` is a planning-enhanced Team entry. The current implementation starts it through the code/team path and enables `enable_team_plan` in TeamManager.---@@ -139,4 +162,4 @@ channels:- [Configuration](Configuration.md) — Full `modes` section field reference in `config.yaml`- [CLI Commands](CLI.md) — Full command reference including `/mode` and `/switch`- [Slash Command Architecture](SlashCommandArchitecture.md) — Internal command parsing flow-- [Distributed Team](DistributedTeam.md) — Distributed deployment for Team mode\ No newline at end of file+- [Distributed Team](DistributedTeam.md) — Distributed deployment for Team modediff --git a/docs/en/SlashCommandArchitecture.md b/docs/en/SlashCommandArchitecture.mdindex 6b73110cb7..16e90f0bed 100644--- a/docs/en/SlashCommandArchitecture.md+++ b/docs/en/SlashCommandArchitecture.md@@ -39,7 +39,7 @@ Without clear layering and a single source of truth, the project risks: **semant**Definition**: User messages arriving at the Gateway that are identified by `MessageHandler` (or its unified entry point), potentially **only changing session/mode/routing without entering Agent conversation**.-**Typical commands**: `/new_session`, `/mode agent|code|team` and `/switch plan|fast|normal` on controlled channels, plus direct forms like `/mode agent.plan|agent.fast|code.plan|code.normal` (per current implementation).+**Typical commands**: `/new_session`, `/mode agent|code|team` and `/switch plan|fast|normal|team` on controlled channels, plus direct forms like `/mode agent.plan|agent.fast|code.plan|code.normal|code.team` (per current implementation). The TUI local command additionally supports `/mode plan`, `/mode team.normal`, and `/mode team.plan`; those forms are not part of the Gateway controlled-channel whitelist.**Requirements**:@@ -140,4 +140,4 @@ Without clear layering and a single source of truth, the project risks: **semant## 10. Current Command Status (based on `gateway/slash_command.py`)-The current command list has been split into a separate document: [`SlashCommands.md`](./SlashCommands.md).\ No newline at end of file+The current command list has been split into a separate document: [`SlashCommands.md`](./SlashCommands.md).diff --git a/docs/en/SlashCommands.md b/docs/en/SlashCommands.mdindex 5f7dc22801..bb94bb01a9 100644--- a/docs/en/SlashCommands.md+++ b/docs/en/SlashCommands.md@@ -34,7 +34,7 @@ Executed locally in the terminal UI, not through Gateway control pipeline.| `/sandbox` | Set sandbox mode (see below) || `/auto-harness` | Auto-Harness task management (`run`/`schedule`, see below) |-> Note: `/mode` controlled switching logic is primarily on Gateway side, see "`/mode` and `/switch`" below.+> Note: `/mode` controlled switching logic is primarily on Gateway side, see "`/mode` and `/switch`" below. The TUI local command additionally supports `/mode plan`, `/mode team.normal`, and `/mode team.plan`; see the TUI guide for details.### Gateway / Agent Parsing (Controlled Channel)@@ -110,10 +110,12 @@ Manages directories AI can access for file read, edit, and execute operations.- `/mode agent.fast` -> `agent.fast`- `/mode code.plan` -> `code.plan`- `/mode code.normal` -> `code.normal`+ - `/mode code.team` -> `code.team`- Second-level switching:- agent family: `/switch plan` <-> `agent.plan`, `/switch fast` <-> `agent.fast`- - code family: `/switch plan` <-> `code.plan`, `/switch normal` <-> `code.normal`+ - code family: `/switch plan` <-> `code.plan`, `/switch normal` <-> `code.normal`, `/switch team` <-> `code.team`- Invalid combinations (e.g., `/switch fast` under `code.*`) return: `Invalid command`.+- Controlled channels do not accept `/mode plan`, `/mode team.normal`, or `/mode team.plan`.- Note: Standalone `/team` command removed, use `/mode team` instead.### `/resume`@@ -593,7 +595,7 @@ The command receives the following JSON data on each execution:| `session_id` | Current session ID || `session_name` | Session title (set via `/rename`) || `cwd` | Current working directory |-| `mode` | Current mode (`agent.plan` / `agent.fast` / `code.plan` / `code.normal` / `team`) |+| `mode` | Current mode (`agent.plan` / `agent.fast` / `code.plan` / `code.normal` / `code.team` / `team` / `team.plan`) || `model` | Current model name || `provider` | Model provider || `version` | jiuwenswarm version |diff --git a/docs/zh/SLASH_COMMAND_ARCHITECTURE.md b/docs/zh/SLASH_COMMAND_ARCHITECTURE.mdindex 911466667e..5b9538f2eb 100644--- a/docs/zh/SLASH_COMMAND_ARCHITECTURE.md+++ b/docs/zh/SLASH_COMMAND_ARCHITECTURE.md@@ -39,7 +39,7 @@**定义**:到达 Gateway 用户消息中,由 `MessageHandler`(或其后继统一入口)识别后,**可能只改会话/模式/路由,而不进入 Agent 对话**的指令。-**典型**:`/new_session`、受控通道上的 `/mode agent|code|team` 与 `/switch plan|fast|normal`,以及 `/mode agent.plan|agent.fast|code.plan|code.normal` 直达写法(以当前实现为准)。+**典型**:`/new_session`、受控通道上的 `/mode agent|code|team` 与 `/switch plan|fast|normal|team`,以及 `/mode agent.plan|agent.fast|code.plan|code.normal|code.team` 直达写法(以当前实现为准)。TUI 本地额外支持 `/mode plan`、`/mode team.normal`、`/mode team.plan`,这些不属于 Gateway 受控通道白名单。**要求**:diff --git "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md" "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"index 6be063f00f..aa97094e38 100644--- "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"+++ "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"@@ -34,7 +34,7 @@| `/sandbox` | 设置沙箱模式(见下文) || `/auto-harness` | Auto-Harness 任务管理(`run`/`schedule`,见下文) |-> 说明:`/mode` 的受控切换逻辑以 Gateway 侧行为为主,详见下文「`/mode` 与 `/switch`」。+> 说明:本页的 `/mode` 与 `/switch` 以 Gateway 受控通道行为为主。TUI 本地命令另支持 `/mode plan`、`/mode team.normal`、`/mode team.plan`,详见 [TUI 使用指南](TUI使用指南.md)。### Gateway / Agent 侧解析(受控通道)@@ -110,10 +110,12 @@- `/mode agent.fast` -> `agent.fast`- `/mode code.plan` -> `code.plan`- `/mode code.normal` -> `code.normal`+ - `/mode code.team` -> `code.team`- 二级切换:- agent 族:`/switch plan` <-> `agent.plan`,`/switch fast` <-> `agent.fast`- - code 族:`/switch plan` <-> `code.plan`,`/switch normal` <-> `code.normal`+ - code 族:`/switch plan` <-> `code.plan`,`/switch normal` <-> `code.normal`,`/switch team` <-> `code.team`- 非法组合(如在 `code.*` 下执行 `/switch fast`)返回:`非法指令`。+- 受控通道不接受 `/mode plan`、`/mode team.normal`、`/mode team.plan`。- 备注:独立 `/team` 命令已移除,请统一使用 `/mode team`。### `/resume`@@ -604,7 +606,7 @@| `session_id` | 当前会话 ID || `session_name` | 会话标题(通过 `/rename` 设置) || `cwd` | 当前工作目录 |-| `mode` | 当前模式(`agent.plan` / `agent.fast` / `code.plan` / `code.normal` / `team`) |+| `mode` | 当前模式(`agent.plan` / `agent.fast` / `code.plan` / `code.normal` / `code.team` / `team` / `team.plan`) || `model` | 当前模型名称 || `provider` | 模型提供商 || `version` | jiuwenswarm 版本号 |diff --git "a/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md" "b/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md"index 4afb379649..def45ecdb9 100644--- "a/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md"+++ "b/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md"@@ -72,7 +72,7 @@| `/evolve_simplify` | - | 整理、合并某技能的演进经验 | `/evolve_simplify myskill 合并重复经验` | `agent.plan` / `team` || `/init` | - | 在 **Code 模式** 下初始化 `JIUWENSWARM.md` / `JIUWENSWARM.local.md` | `/init` | **仅 `code.*`** || `/mcp` | - | 管理 MCP 服务 | `/mcp list`、`/mcp add ...` | 全部 |-| `/mode` | - | 切换或查看模式 | `/mode`、`/mode code` | 全部 |+| `/mode` | - | 切换或查看模式 | `/mode`、`/mode code`、`/mode team.plan` | 全部 || `/permissions` | - | 设置 `permissions.tools` 中单工具的 allow/ask/deny | `/permissions ask write_file` | 全部 || `/plan` | - | 进入当前模式族的 plan 子模式,或发送规划请求 | `/plan`、`/plan open`、`/plan 迁移步骤` | 非 `team` || `/rename` | - | 查看/重命名/清空当前会话标题 | `/rename`、`/rename 标题`、`/rename clear` | 全部 |@@ -101,9 +101,12 @@- **`/mode`**(`mode.ts`)- 无参数:显示当前模式。- - 有参数:映射为 `agent.plan`、`agent.fast`、`code.plan`、`code.normal`、`team` 之一,并尝试 `mode.set` RPC,同时更新本地 UI 状态。- - 简写:`/mode agent` → `agent.plan`;`/mode code` → `code.normal`。-- **同族子模式**:可用 **`/mode code.plan`**、**`/mode agent.fast`** 等直达;**`/switch plan|fast|normal`** 在 `switch.ts` 中实现,但 **默认构建未注册**,需要子模式时请用 `/mode` 直达或 **`/plan`**(见下)在 Agent/Code 族内进入 plan。+ - TUI 当前接受:`agent`、`plan`、`agent.plan`、`agent.fast`、`code`、`code.normal`、`code.plan`、`code.team`、`team`、`team.normal`、`team.plan`。+ - 实际映射:`agent` / `plan` → `agent.plan`;`code` → `code.normal`;`team.normal` → `team`;其它直达值保持不变。+ - 切换时会尝试调用 `mode.set` RPC,同时更新本地 UI 状态;如果后端不支持 `mode.set`,TUI 仍会在后续发送消息时通过当前模式传递。+ - 从 `team` / `team.plan` / `code.team` 离开 Team 族且当前有 Team 任务运行时,TUI 会先弹出确认,确认后发送 `chat.interrupt` 再切换。+- **与 Gateway 受控通道的差异**:受控通道只接受 `/mode agent|code|team|agent.plan|agent.fast|code.plan|code.normal|code.team`;`/mode plan`、`/mode team.normal`、`/mode team.plan` 是 TUI 本地命令能力,不属于 Gateway slash 白名单。+- **同族子模式**:可用 **`/mode code.plan`**、**`/mode agent.fast`** 等直达;**`/switch plan|fast|normal|team`** 在 `switch.ts` 中实现,但 **默认 TUI 注册表未注册**,需要子模式时请用 `/mode` 直达或 **`/plan`**(见下)在 Agent/Code 族内进入 plan。#### `/workspace`(可信目录)diff --git "a/docs/zh/\345\221\275\344\273\244\350\241\214\346\214\207\344\273\244.md" "b/docs/zh/\345\221\275\344\273\244\350\241\214\346\214\207\344\273\244.md"index ef6b8f8672..7119038056 100644--- "a/docs/zh/\345\221\275\344\273\244\350\241\214\346\214\207\344\273\244.md"+++ "b/docs/zh/\345\221\275\344\273\244\350\241\214\346\214\207\344\273\244.md"@@ -65,6 +65,8 @@ Gateway 会:| `/mode code.normal` | 代码模式 + 直接执行风格(默认) || `/mode code.team` | 代码模式 + 组队风格 |+> 说明:以上是 Gateway 受控通道白名单。TUI 本地 `/mode` 还支持 `/mode plan`(等价于 `agent.plan`)、`/mode team.normal`(等价于 `team`)和 `/mode team.plan`(直达 `team.plan`);这些写法不会被 Gateway 受控通道识别。+**使用方式:**```text@@ -98,6 +100,8 @@ Gateway 会:| `/switch normal` | 不支持 | → `code.normal` || `/switch team` | 不支持 | → `code.team` |+> TUI 代码中也有 `/switch` 实现,但当前默认 TUI 命令注册表未注册该命令;在 TUI 中切换子模式请优先使用 `/mode ...` 或 `/plan`。+**使用方式:**```textdiff --git "a/docs/zh/\346\250\241\345\274\217\347\263\273\347\273\237.md" "b/docs/zh/\346\250\241\345\274\217\347\263\273\347\273\237.md"index 6be215ccdd..42892c9181 100644--- "a/docs/zh/\346\250\241\345\274\217\347\263\273\347\273\237.md"+++ "b/docs/zh/\346\250\241\345\274\217\347\263\273\347\273\237.md"@@ -12,7 +12,9 @@ JiuwenSwarm 支持多种运行模式,不同模式对应不同的工具集、| Agent(快速) | `agent.fast` | 全工具 + 被动记忆,侧重快速响应 || Code(规划) | `code.plan` | 编码模式 + 编码记忆,侧重代码生成的规划 || Code(常规) | `code.normal` | 编码模式 + 编码记忆,侧重代码执行 |+| Code(团队) | `code.team` | 以 Code 配置启动的团队协作模式 || Team | `team` | 多 Agent 协作模式,基于配置中的 `team` 定义 |+| Team(规划) | `team.plan` | 团队协作 + 规划型团队运行参数 |---@@ -22,22 +24,31 @@ JiuwenSwarm 支持多种运行模式,不同模式对应不同的工具集、```/mode agent # 切换到 Agent 模式(默认使用 agent.plan)+/mode plan # TUI 本地简写,等价于 agent.plan/mode code # 切换到 Code 模式(默认使用 code.normal)/mode team # 切换到 Team 模式/mode agent.plan # 直达 Agent 规划子模式/mode agent.fast # 直达 Agent 快速子模式/mode code.plan # 直达 Code 规划子模式/mode code.normal # 直达 Code 常规子模式+/mode code.team # 直达 Code 团队子模式+/mode team.normal # TUI 本地写法,等价于 team+/mode team.plan # TUI 本地写法,直达 Team 规划模式```+> 兼容性:`/mode plan`、`/mode team.normal`、`/mode team.plan` 是 TUI 本地命令能力;Gateway 受控通道只接受 `agent`、`code`、`team`、`agent.plan`、`agent.fast`、`code.plan`、`code.normal`、`code.team`。+也可用 `/switch` 在同一大类内切换子模式:```/switch plan # Agent 下切到 plan;Code 下切到 plan/switch fast # Agent 下切到 fast/switch normal # Code 下切到 normal+/switch team # Code 下切到 code.team```+> TUI 源码中有 `/switch` 实现,但当前默认 TUI 命令注册表未注册;TUI 用户请优先用 `/mode ...` 直达,或用 `/plan` 进入当前模式族的 plan 子模式。+---## 配置@@ -125,12 +136,24 @@ channels:## 模式行为差异-| 行为 | Agent (plan) | Agent (fast) | Code | Team |-|------|-------------|-------------|------|------|-| 工具集 | 全工具 | 全工具 | 白名单工具 + 编码记忆 | 全工具 |-| 记忆策略 | 主动(自动读写) | 被动(按需读写) | 编码记忆 | 按团队配置 |-| 安全 Rails | 无额外 | 无额外 | FileSystemRail + SkillUseRail + LspRail | 按团队配置 |-| 迭代上限 | `react.max_iterations` | `react.max_iterations` | `react.max_iterations` | 团队 leader 可单独配置 `max_iterations` |+不同模式不只是 UI 名称不同,还会决定 AgentServer 选择哪个运行时 profile、挂载哪些 Rails、如何注入记忆与团队协作能力。++| 模式 | 运行时 profile | Agent 行为侧重点 | 主要 Rails / 工具差异 | 记忆策略 |+|------|----------------|------------------|------------------------|----------|+| `agent.plan` | Deep Agent(`mode=agent`, `sub_mode=plan`) | 默认规划型对话。更适合复杂任务拆解、长期推理、技能演进与需要子代理协助的任务。 | 注册 `TaskPlanningRail`、`SubagentRail`;按配置启用 `SkillEvolutionRail` / `SkillCreateRail`;保留通用搜索、多模态、技能等普通 Agent 工具。 | 使用 `modes.agent.plan.memory`;默认主动记忆(`is_proactive: true`),会更积极地检索/沉淀上下文。 |+| `agent.fast` | Deep Agent(`mode=agent`, `sub_mode=fast`) | 快速响应型对话。更少规划编排,更偏直接回答或按需调用工具。 | 卸载 `TaskPlanningRail`、`SkillEvolutionRail`、`SkillCreateRail`、`SubagentRail`;仍保留通用运行时提示、安全、权限、搜索/多模态/技能工具。 | 使用 `modes.agent.fast.memory`;默认被动记忆(`is_proactive: false`),通常按需读写。 |+| `code.plan` | Code Adapter(`mode=code`, `sub_mode=plan`) | 编码任务的规划阶段。适合先读项目、拆解改动、制定实现步骤。 | 使用 Code 专用英文系统提示;固定挂载 `LspRail`、`ProjectMemoryRail`、`CodingMemoryRail`、`AgentModeRail`、`StructuredAskUserRail`、`ConfirmInterruptRail`、文件系统/权限 Rails;动态启用 `modes.code.rails` / `modes.code.tools` 中的能力。 | 不使用通用 `MemoryRail`;使用 `CodingMemoryRail` 与项目记忆(如 `JIUWENSWARM.md` / `CLAUDE.md`)。 |+| `code.normal` | Code Adapter(`mode=code`, `sub_mode=normal`) | 编码任务的执行阶段。适合改文件、跑命令、验证、交付结果。 | 与 `code.plan` 基本同一套 Code Rails/工具;区别主要是当前模式语义和前端/命令的执行意图,部分命令(如 `/init`)会从 `code.plan` 自动切到 `code.normal` 以便写入。 | 同 `code.plan`:编码记忆 + 项目记忆。 |+| `code.team` | Code Adapter + Team sub-mode(`mode=code`, `sub_mode=team`) | 以 Code profile 启动团队协作。适合代码项目中让团队成员分工,同时继承编码工作区与代码工具语义。 | 主 Agent 仍使用 Code profile;Team 成员会通过 TeamManager 启动,并尽量继承 Code 侧项目目录、代码工具和成员技能工具包。 | 团队成员使用 Team 配置;编码/项目上下文由 Code profile 和团队运行时共同影响。 |+| `team` | Team runtime(`mode=team`) | 标准多 Agent 协作。Leader 负责分解、调度、汇总,成员按角色并行处理。 | Team 成员挂载 `RuntimePromptRail`、`ResponsePromptRail`、`SysOperationRail`、`TaskPlanningRail`、`SecurityRail`、`HeartbeatRail`、`AvatarPromptRail` 等;Leader 额外支持 Team 技能演进/创建;工具来自可继承白名单和团队配置。 | 由 `modes.team.<name>.memory` 决定,可启用共享 `TEAM_MEMORY.md`、自动提取、成员记忆注入等。 |+| `team.plan` | Team Plan(规范化为 `team.plan`,运行时走 code/team 路径) | 团队规划增强模式。用于让 Team 以更强的规划语义启动,特别是 Leader 的规划/协调提示。 | 会设置 `enable_team_plan`;Leader 可保留配置语言的运行时提示,不强制使用 Code profile 的英文运行时提示;成员仍按团队/Code-Team 继承链配置。 | 同 Team 配置;Team Plan 主要改变团队运行提示和协调方式,不单独定义一套记忆配置。 |++### 关键区别速记++- `agent.plan` 与 `agent.fast` 使用同一个 Deep Agent profile,但前者挂载规划、子代理、技能演进等 Rails,后者会卸载这些偏“重编排”的能力。+- `code.plan` 与 `code.normal` 使用同一个 Code Adapter,差别主要是模式语义与命令流程;两者都拥有代码专属系统提示、LSP、项目记忆、编码记忆、文件/权限护栏。+- `code.team` 与 `team` 都会进入团队协作,但入口不同:`code.team` 从 Code profile 进入,适合代码项目分工;`team` 是标准 Team runtime。+- `team.plan` 是 Team 的规划增强入口,当前实现会通过 code/team 路径启动,并在 TeamManager 中打开 `enable_team_plan`。---@@ -139,4 +162,4 @@ channels:- [配置信息](配置信息.md) — `config.yaml` 中 `modes` 段的完整字段说明- [命令行指令](命令行指令.md) — `/mode` 和 `/switch` 的完整命令列表- [Slash 命令架构](SLASH_COMMAND_ARCHITECTURE.md) — 命令解析的内部处理流程-- [分布式 Team](分布式Team.md) — Team 模式的分布式部署\ No newline at end of file+- [分布式 Team](分布式Team.md) — Team 模式的分布式部署