Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
docs(orca): clarify selectable worker permission default
fmfsaisaidbc76821211f
diff --git a/apps/desktop/help-knowledge/collaboration.md b/apps/desktop/help-knowledge/collaboration.mdindex 39b4e07323..772ba9f34a 100644--- a/apps/desktop/help-knowledge/collaboration.md+++ b/apps/desktop/help-knowledge/collaboration.md@@ -9,7 +9,7 @@ Collaboration ("协同" / Collab) lets one session — the **lead** — bring in**Turning it on:**- In any regular project or dialogue session, open the composer's **+** menu and choose **Collaboration mode**. You can also choose it before sending the first message of a new task. Claude Code and Codex can lead locally or over SSH; Pi can lead in local sessions.-- Pick the first worker's agent (Claude Code, Codex, or Pi), and optionally its role / model / effort / an initial task. SSH remote leads currently use Claude Code or Codex workers. Worker permissions initially default to **Full access**. You can switch to **Auto-review**, and whichever mode you create the Worker with becomes the default for the next Worker.+- Pick the first worker's agent (Claude Code, Codex, or Pi), and optionally its role / model / effort / an initial task. SSH remote leads currently use Claude Code or Codex workers. If you have not chosen a Worker permission before, the initial default is **Full access** — it is a selectable default, not a fixed mode. You can choose **Auto-review** instead. Once you create a Worker with either mode, Cindy remembers that choice for the next Worker instead of replacing it with the product default.- Start. This creates the team plus that first worker.**Adding more workers:**@@ -19,7 +19,7 @@ Collaboration ("协同" / Collab) lets one session — the **lead** — bring in**While collaborating:**-- Each worker is a full session with its own history, tools, working directory, and model. In **Auto-review**, safe work can proceed automatically, while higher-risk actions may still be denied or require confirmation. The Worker creation panel remembers your last permission choice alongside its Agent and model preferences. The same default is used when an agent tool creates a Worker; an explicit `start_team` permission updates that shared default. Raising it from Auto-review to Full access waits for your confirmation first; cancelling or letting the confirmation time out leaves the default and team unchanged. Changing it does not affect the lead or workers that already exist. Workers inherit the lead's working directory by default (or share the worktree when the lead uses one).+- Each worker is a full session with its own history, tools, working directory, and model. **Full access** skips routine approvals; **Auto-review** lets safe work proceed automatically while higher-risk actions may still be denied or require confirmation. The Worker creation panel remembers your last permission choice alongside its Agent and model preferences. The same remembered choice is used when an agent tool creates a Worker; an explicit `start_team` permission updates that shared choice. Raising it from Auto-review to Full access waits for your confirmation first; cancelling or letting the confirmation time out leaves the preference and team unchanged. Changing it does not affect the lead or workers that already exist. Workers inherit the lead's working directory by default (or share the worktree when the lead uses one).- A worker's model defaults to your last new-session choice for that vendor, falling back to the lead's model.- Only one worker is **focused** (shown) at a time — switch between them with the worker tabs / dropdown. You can intervene in any worker directly, and archive workers individually.diff --git a/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts b/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.tsindex 7808afca04..80a52b9424 100644--- a/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts+++ b/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts@@ -28,7 +28,7 @@ export const HELP_KNOWLEDGE: HelpKnowledgeDoc[] = [id: "collaboration",title: "Collaboration mode (lead + workers)",summary: "Turn on Collab to bring one or more worker agents in beside your session and delegate tasks to them.",- content: "Collaboration (\"协同\" / Collab) lets one session — the **lead** — bring in one or more **worker** agents to run alongside it (a \"team\"). The lead delegates tasks to workers through a built-in MCP, and you can watch and steer each worker.\n\n**Turning it on:**\n\n- In any regular project or dialogue session, open the composer's **+** menu and choose **Collaboration mode**. You can also choose it before sending the first message of a new task. Claude Code and Codex can lead locally or over SSH; Pi can lead in local sessions.\n- Pick the first worker's agent (Claude Code, Codex, or Pi), and optionally its role / model / effort / an initial task. SSH remote leads currently use Claude Code or Codex workers. Worker permissions initially default to **Full access**. You can switch to **Auto-review**, and whichever mode you create the Worker with becomes the default for the next Worker.\n- Start. This creates the team plus that first worker.\n\n**Adding more workers:**\n\n- From the collaboration tab's worker list, use **Create new worker** (+) to add more.\n- Default limits are a **soft cap of 5** and a **hard cap of 8** workers per lead — you'll see a warning past the soft cap, and creation is blocked at the hard cap. Both are adjustable (1–20) in the Collaboration section under **Settings > General**.\n\n**While collaborating:**\n\n- Each worker is a full session with its own history, tools, working directory, and model. In **Auto-review**, safe work can proceed automatically, while higher-risk actions may still be denied or require confirmation. The Worker creation panel remembers your last permission choice alongside its Agent and model preferences. The same default is used when an agent tool creates a Worker; an explicit `start_team` permission updates that shared default. Raising it from Auto-review to Full access waits for your confirmation first; cancelling or letting the confirmation time out leaves the default and team unchanged. Changing it does not affect the lead or workers that already exist. Workers inherit the lead's working directory by default (or share the worktree when the lead uses one).\n- A worker's model defaults to your last new-session choice for that vendor, falling back to the lead's model.\n- Only one worker is **focused** (shown) at a time — switch between them with the worker tabs / dropdown. You can intervene in any worker directly, and archive workers individually.\n\n**Turning it off:**\n\n- Closing collab **confirms with you first** (in-progress work is lost), then ends the workflow and archives **all** the team's workers. The conversation history stays searchable.\n\n**Notes:**\n\n- A local lead can be a Claude Code, Codex, or Pi **project or dialogue** session. On an SSH remote lead, the lead and workers currently use Claude Code or Codex; Pi sessions are local-only. Remote workers are spawned on the **same remote host**, and the collaboration MCP reaches the remote side over an SSH remote-forward to the local bridge (with a persistent bearer token). A worker can't start its own sub-collab (no nesting).\n- A lead can have only **one active collaboration workflow** at a time. If you have two clients open on the same account (e.g. dev + release) and start collab on the same session in both, the second fails with \"开启协同失败\" because a workflow is already active — close one client or end the existing collab.",+ content: "Collaboration (\"协同\" / Collab) lets one session — the **lead** — bring in one or more **worker** agents to run alongside it (a \"team\"). The lead delegates tasks to workers through a built-in MCP, and you can watch and steer each worker.\n\n**Turning it on:**\n\n- In any regular project or dialogue session, open the composer's **+** menu and choose **Collaboration mode**. You can also choose it before sending the first message of a new task. Claude Code and Codex can lead locally or over SSH; Pi can lead in local sessions.\n- Pick the first worker's agent (Claude Code, Codex, or Pi), and optionally its role / model / effort / an initial task. SSH remote leads currently use Claude Code or Codex workers. If you have not chosen a Worker permission before, the initial default is **Full access** — it is a selectable default, not a fixed mode. You can choose **Auto-review** instead. Once you create a Worker with either mode, Cindy remembers that choice for the next Worker instead of replacing it with the product default.\n- Start. This creates the team plus that first worker.\n\n**Adding more workers:**\n\n- From the collaboration tab's worker list, use **Create new worker** (+) to add more.\n- Default limits are a **soft cap of 5** and a **hard cap of 8** workers per lead — you'll see a warning past the soft cap, and creation is blocked at the hard cap. Both are adjustable (1–20) in the Collaboration section under **Settings > General**.\n\n**While collaborating:**\n\n- Each worker is a full session with its own history, tools, working directory, and model. **Full access** skips routine approvals; **Auto-review** lets safe work proceed automatically while higher-risk actions may still be denied or require confirmation. The Worker creation panel remembers your last permission choice alongside its Agent and model preferences. The same remembered choice is used when an agent tool creates a Worker; an explicit `start_team` permission updates that shared choice. Raising it from Auto-review to Full access waits for your confirmation first; cancelling or letting the confirmation time out leaves the preference and team unchanged. Changing it does not affect the lead or workers that already exist. Workers inherit the lead's working directory by default (or share the worktree when the lead uses one).\n- A worker's model defaults to your last new-session choice for that vendor, falling back to the lead's model.\n- Only one worker is **focused** (shown) at a time — switch between them with the worker tabs / dropdown. You can intervene in any worker directly, and archive workers individually.\n\n**Turning it off:**\n\n- Closing collab **confirms with you first** (in-progress work is lost), then ends the workflow and archives **all** the team's workers. The conversation history stays searchable.\n\n**Notes:**\n\n- A local lead can be a Claude Code, Codex, or Pi **project or dialogue** session. On an SSH remote lead, the lead and workers currently use Claude Code or Codex; Pi sessions are local-only. Remote workers are spawned on the **same remote host**, and the collaboration MCP reaches the remote side over an SSH remote-forward to the local bridge (with a persistent bearer token). A worker can't start its own sub-collab (no nesting).\n- A lead can have only **one active collaboration workflow** at a time. If you have two clients open on the same account (e.g. dev + release) and start collab on the same session in both, the second fails with \"开启协同失败\" because a workflow is already active — close one client or end the existing collab.",},{id: "commands",diff --git a/docs/dev-rules/orca-team-architecture.md b/docs/dev-rules/orca-team-architecture.mdindex 7e41b3ad45..87260fee40 100644--- a/docs/dev-rules/orca-team-architecture.md+++ b/docs/dev-rules/orca-team-architecture.md@@ -119,7 +119,7 @@ PR #101 之后,Orca 的 main 侧业务由独立 service 承接,`register.ts`Worker 权限是 **Worker 创建偏好**,与 Agent、模型、effort、Fast 的“下次创建默认值”同类,不是 Lead 权限的继承项,也不是 Team 数据库字段:- 真源是 renderer `workerCreationPrefs` localStorage;main 只保存内存镜像,应用启动和偏好变化时由 renderer 同步。-- 首次使用默认 `bypassPermissions`(Full access)。UI 每次创建 Worker 都可选择 `auto` 或 `bypassPermissions`,提交后成为下一次默认值;已经保存过的选择继续优先,不随产品默认值变化而改写。+- 没有保存过权限偏好时,产品默认是 `bypassPermissions`(Full access);这只是可选择的初始值,不是固定模式。UI 每次创建 Worker 都可改选 `auto` 或 `bypassPermissions`,提交后成为下一次默认值;已经保存过的选择继续优先,不随产品默认值变化而改写。- MCP `start_team` 可显式指定 `worker_permission_mode`;省略时沿用当前偏好。显式从 `auto` 升级到 `bypassPermissions` 时,Main 必须在写入偏好或创建 Team 前等待宿主持有的用户确认,不能只依赖 MCP 审批、tool 描述或 prompt;取消/超时不得产生副作用。确认通过后才更新 main 镜像,并通知 renderer 回写同一份 localStorage。已由用户保存为 `bypassPermissions` 时,后续沿用不重复确认。- `create_worker` / `create_workers` 省略权限参数,统一读取当前偏好;不继承 Lead 的 `sessions.permission_mode`,也不修改已经创建的 Worker。- device-link 新控制端只有在被控端 capabilities 明确声明支持 Worker 权限选择时才允许开启协同;已有旧版远程 Team 继续兼容旧创建行为,不宣称或回写该端不支持的偏好。@@ -262,7 +262,7 @@ Worktree 现状:Orca 与普通 session 对齐,worktree 是可选项,不强当前文档要求保留以下回归方向:- Service 边界:`orcaLifecycleService`、`orcaWorkerCreationService`、`orcaTeamService` 的单测覆盖 start/enable/create/dispatch/idle/archive/auto-bridge 关键路径。-- Worker 创建权限偏好:覆盖 UI/MCP 未指定默认 `auto`、MCP 显式 `auto → bypassPermissions` 必须先经用户确认且取消/超时零副作用、复用 Team 时省略不重置/显式才更新、首个与后续 Worker 都读取共享创建偏好、已有 Worker 权限不反写、renderer localStorage 启动同步与 tool 写回,以及旧 device-link 被控端被阻止开启协同并提示升级。+- Worker 创建权限偏好:覆盖无保存偏好时默认 `bypassPermissions`、已保存的 `auto` / `bypassPermissions` 继续优先、MCP 显式 `auto → bypassPermissions` 必须先经用户确认且取消/超时零副作用、复用 Team 时省略不重置/显式才更新、首个与后续 Worker 都读取共享创建偏好、已有 Worker 权限不反写、renderer localStorage 启动同步与 tool 写回,以及旧 device-link 被控端被阻止开启协同并提示升级。- MCP 工具:`cindy_orca` 16 工具(13 team + 3 只读诊断)的 role gate、ctx 缺失、worker/main 误调用、soft/hard limit、duplicate label、budget model API mode gate;`create_workers` 另覆盖默认 hard limit、配置 hard=3、部分成功、连续失败与 hard-limit 后不再调用 host;诊断工具的纯只读语义(无 active team 时返回空 workspace、不建 team);排队消息控制 3 工具的归属校验(跨 lead 拒绝)、非 lead 条目拒绝(`NOT_LEAD_MESSAGE`)、steering 拒绝(`MESSAGE_CONSUMING`)、撤回结清 accepted 暂存。- Codex MCP context:`CodexMcpThreadContextStore` 覆盖按 threadId 查 context、unknown / missing threadId fail-closed、unregister 后清理、`vendorOptions` 引用保持;`codexHttpBridge` 覆盖从 JSON-RPC `params._meta.threadId` 注入真实 session context。- Host 归属校验:`send_to_worker`、`idle_worker`、`archive_worker` 经共享 `resolveWorkerRef`(同时接受 worker_id / session_id 两种 id)必须以 caller 自身 Lead 身份校验,拒绝跨 workflow worker id 与 ctx 缺失;即使模型传错 id 或换用另一种 id,也不能越权操作。diff --git a/packages/lizi-mcps/src/xdt-helper/start_team.ts b/packages/lizi-mcps/src/xdt-helper/start_team.tsindex dc114987fa..81d8485eba 100644--- a/packages/lizi-mcps/src/xdt-helper/start_team.ts+++ b/packages/lizi-mcps/src/xdt-helper/start_team.ts@@ -34,7 +34,7 @@ export interface StartTeamDeps {const DESCRIPTION ='为当前 session 创建 orca team, 进入多 worker 协同模式。' +'失败码: LEAD_NOT_SUPPORTED / WORKER_CANNOT_NEST / ALREADY_ENABLED / USER_CANCELLED / CONFIRM_TIMEOUT。' +- 'worker_permission_mode 可选:auto(Auto-review)或 bypassPermissions(Full access);省略时沿用上次 Worker 创建偏好,首次使用默认 bypassPermissions。当前 session 已是 Lead 时,必须显式指定模式才能更新默认值。' ++ 'worker_permission_mode 可选:auto(Auto-review)或 bypassPermissions(Full access);省略时沿用上次 Worker 创建偏好。没有保存过偏好时默认 bypassPermissions,但这只是可选初始值,可以显式选择 auto;手动选择后继续沿用该选择。当前 session 已是 Lead 时,必须显式指定模式才能更新默认值。' +'显式指定后,它会成为 UI 与 agent tool 后续创建 Worker 的共同默认权限;不改变 Lead 自己的权限。从 auto 升级到 bypassPermissions 时,主机会等待用户确认;取消或超时不会更新偏好、也不会开启 team。' +'注:start_team 开启的是 session 级、持久、UI 可见的多 worker 协同。若用户要的是一个 subagent(一次性、用完即弃的子任务执行体),请用你自己的原生 subagent 机制(如 Codex 的 spawn_agent、Claude Code 的 Task 工具),不要为此 start_team 开协同。' +'Orca 协同永远不是 subagent 的替代品;你没有原生 subagent 机制时,如实告知用户并请他决定,不要拿 Orca 顶替,也不要自己起进程冒充。';@@ -52,7 +52,7 @@ export function registerStartTeamTool(.enum(['auto', 'bypassPermissions']).optional().describe(- 'Worker 创建默认权限。省略时沿用已保存偏好(首次为 bypassPermissions);当前 session 已是 Lead 时须显式指定才能更新默认值;指定后,UI 与后续 create_worker/create_workers 都沿用该模式。',+ 'Worker 创建默认权限。省略时沿用已保存偏好;没有保存过偏好时初始为 bypassPermissions,但可显式选择 auto,手动选择后 UI 与后续 create_worker/create_workers 都沿用该模式。当前 session 已是 Lead 时须显式指定才能更新默认值。',),},handler: async ({ worker_permission_mode }) => {