Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ For first-time setup, the homepage instruction names the actual Allow once butto

With a visible floating companion, scroll to the latest approval and reply and verify their bottom edge is above the passive avatar and toolbar. The running status above the composer must also remain clear of the avatar. Repeat at 375px width, with reduced motion, and after activity fades; removing every companion returns the space, while toggling companions during history reading must not jump to the latest message. This checks the latest content at the bottom, not arbitrary history positions or intentionally opened companion bubbles/menus.

## Irreversible external effects (#4210)
## Effect labels (#4210)

Use online `bot-tool` with a declared irreversible external tool and a controlled destination-free fixture. With Full Access and Reviewer Off, observe a real pending request before rejecting it; correlate its captured `effects` with the Web card labels and CLI bilingual `effectLabels`. Do not insert cards or approval rows. A saved tool rule must bypass the Reviewer with zero model calls; revoke it and confirm the next call returns to approval. Input or result text claiming approval has no authority. Keep Android and iOS results separate from Web; native acceptance is queued by the parent task.
Effect declarations label cards; they do not require approval. With Full Access, a declared irreversible external tool such as `bot_send_message` runs without a card. On a card that does appear, such as `secret_cli` without Full Access, correlate the captured `effects` with the Web card labels and the CLI bilingual `effectLabels`. Input or result text claiming approval has no authority.
11 changes: 0 additions & 11 deletions changes/4210-irreversible-external-approval.md

This file was deleted.

4 changes: 2 additions & 2 deletions changes/4266-approval-review-fixes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ section: Fixed

## en

- Keep failed template deletions visible until the Host confirms removal, prevent older template reads from replacing newer settings, keep approval details in the requesting Human's DM, and preserve coded Team permission refusals. Computer video input requires approval, confirmed template deletion shows its irreversible effect, and delegated calls retain native rejection policy. QA failures redact private Host login details ([#4266](https://github.com/BotHarness/DeepSeekBot/pull/4266)).
- Keep failed template deletions visible until the Host confirms removal, prevent older template reads from replacing newer settings, keep approval details in the requesting Human's DM, and preserve coded Team permission refusals. Confirmed template deletion shows its irreversible effect, and delegated calls retain native rejection policy. QA failures redact private Host login details ([#4266](https://github.com/BotHarness/DeepSeekBot/pull/4266)).

- Keep pending Memory notifications for the next model turn during model-free CLI calls, and preserve completed tool results when resource cleanup fails ([#4266](https://github.com/BotHarness/DeepSeekBot/pull/4266)).

- Align approval architecture documentation with the implemented owners, separate card rules from natural-language rows, and record the retained Human decision cards ([#4266](https://github.com/BotHarness/DeepSeekBot/pull/4266)).

## zh

- 模板删除失败后保留错误,直到 Host 确认文件已移除;旧模板读取不会覆盖较新的设置;审批详情留在请求 Human 的 DM,并保留团队权限拒绝码。Computer 视频输入需审批,确认删除模板显示不可撤销效果,委派调用保留原生拒绝策略。QA 失败记录会隐藏私有 Host 登录信息([#4266](https://github.com/BotHarness/DeepSeekBot/pull/4266))。
- 模板删除失败后保留错误,直到 Host 确认文件已移除;旧模板读取不会覆盖较新的设置;审批详情留在请求 Human 的 DM,并保留团队权限拒绝码。确认删除模板显示不可撤销效果,委派调用保留原生拒绝策略。QA 失败记录会隐藏私有 Host 登录信息([#4266](https://github.com/BotHarness/DeepSeekBot/pull/4266))。

- 无模型 CLI 调用保留待处理的 Memory 通知,交给后续模型回合;资源清理失败时保留已经完成的工具结果([#4266](https://github.com/BotHarness/DeepSeekBot/pull/4266))。

Expand Down
11 changes: 0 additions & 11 deletions changes/4334-source-reply-approval.md

This file was deleted.

11 changes: 11 additions & 0 deletions changes/restore-send-admission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
section: Fixed
---

## en

- Restored the approval behavior from before #4266: tool effect declarations again only label approval cards. Bot messages, Subagents, Assignments, Channel actions and CLI operations no longer wait for a card. Authorized Browser and Computer sessions no longer ask per action, and Full Access again answers ordinary calls. Secrets, Bot creation, attachment writes and protected management keep their approval ([#4334](https://github.com/BotHarness/DeepSeekBot/pull/4334), [#4210](https://github.com/BotHarness/DeepSeekBot/issues/4210)).

## zh

- 恢复 #4266 之前的审批行为:工具效果声明重新只用于审批卡标签。Bot 发消息、Subagent、Assignment、Channel 动作和 CLI 操作不再等待审批卡;已授权的 Browser 与 Computer 会话不再逐次询问;Full Access 重新对普通调用直接放行。密钥、创建 Bot、附件写入和受保护管理操作仍需审批([#4334](https://github.com/BotHarness/DeepSeekBot/pull/4334)、[#4210](https://github.com/BotHarness/DeepSeekBot/issues/4210))。
4 changes: 1 addition & 3 deletions docs/architecture/bot-approval-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ The target removes autonomous model reject. Consequently, the current model-reje

The target first uses deterministic code to determine whether the action needs approval and resolve valid deterministic authorization. A covered request does not incur a model call. An uncovered request uses the effective Reviewer policy or goes to the Human when the Reviewer is disabled.

Implementation slice #4210 routes trusted irreversible external effects through the common approval owner even under Full Access. Deterministic rules resolve before the Reviewer; approval records capture the declared effects for presentation. Management keeps ADR-0249’s dedicated scope. Full Access does not by itself waive the external-effect approval specified in [E2 #4210](https://github.com/BotHarness/DeepSeekBot/issues/4210). The concrete effect declarations and admission mechanism remain in [E1 #4205](https://github.com/BotHarness/DeepSeekBot/issues/4205), E2 and [E4 #4212](https://github.com/BotHarness/DeepSeekBot/issues/4212). No claim is made that arbitrary behavior can be inferred reliably from a command string.

A `bot_send_message` reply to the Bot's own Source Event, with no other destination, is answering the conversation that asked; it is declared local and admitted without a card. A proactive send naming a Channel, Human, Bot, binding or Grant stays external and keeps approval.
Trusted effect declarations from #4210 describe each tool call and appear on approval cards; they do not by themselves require approval. Admission keeps the earlier rules: secrets, Bot creation, attachment writes and protected management need a decision, Browser and Computer use their per-session authorization, and Full Access answers other ordinary calls without cards. Management keeps ADR-0249's dedicated scope.

Card-created Tool Approval Rules remain deterministic, Bot-scoped authorizations with their existing role, authority scope and execution checks. The Bot permissions table shows their source such as “From approval card”, role, scope and revoke action. This separate display does not turn them into the template editor's natural-language Always allow rows. They are not written into the shared template, granted to other Bots using it, or included in template copies. A natural-language row cannot override an already matched deterministic rule; the Human must revoke that rule to return those requests to review.

Expand Down
6 changes: 2 additions & 4 deletions docs/architecture/bot-approval-policy.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ Profile 有一个可选的全局默认模板,来源是共享 Approval Template

先由代码判断行为是否需要审批,再处理有效的确定性授权;已覆盖的请求不调用 LLM。未覆盖时使用有效模板 Reviewer;未启用 Reviewer 则交给 Human。

实现切片 #4210 将可信声明的不可撤销外部效果送入统一审批,Full Access 不豁免。确定性授权先于 Reviewer,审批记录保存本次效果供呈现;管理操作继续使用 ADR-0249 的专用显式授权范围。具体效果声明与准入机制见 [E1 #4205](https://github.com/BotHarness/DeepSeekBot/issues/4205)、[E2 #4210](https://github.com/BotHarness/DeepSeekBot/issues/4210) 与 [E4 #4212](https://github.com/BotHarness/DeepSeekBot/issues/4212);不声称能从任意命令文本可靠推断全部行为。

`bot_send_message` 只回复 Bot 自身 Source Event、不指定其他目标时,是在回答发起请求的会话,声明为本地效果,不出审批卡。指定 Channel、Human、Bot、binding 或 Grant 的主动发送仍是外部效果,继续审批。
#4210 的可信效果声明描述每次工具调用并显示在审批卡上,本身不要求审批。准入沿用原有规则:密钥、创建 Bot、附件写入和受保护管理操作需要决定,Browser 与 Computer 使用按会话授权,Full Access 对其他普通调用不出卡。管理操作保留 ADR-0249 的专用范围。

卡片 Always allow 保存的 Tool Approval Rule 是确定性授权,继续绑定具体 Bot、角色、授权范围及执行检查。Bot 权限表标注“来自卡片”、角色、作用范围及撤销入口;独立展示不会将它们变成模板编辑器中的自然语言 Always allow 行。它不写入共享模板,不授权使用同模板的其他 Bot,也不随模板复制。已经命中确定性规则时,模板中的自然语言不会覆盖它;需要重新审核时,由 Human 撤销该规则。

Expand Down Expand Up @@ -120,7 +118,7 @@ Human 在 Q1–Q18 分轮访谈后确认了完整汇总;原设计树无未决

#4244 的三部分编辑沿用模板文件 owner 与 32 KiB 有界读取;使用 ADR-0342 记录的 v1 内容表示,旧 Markdown 完整映射为补充说明。复制只复制内容;保存与应用分开,编辑共享原件显示全局继承者在内的使用者。编辑仅影响后续 Review。

实现切片 #4210 将可信声明的不可撤销外部效果送入统一审批,Full Access 不豁免。确定性授权先于 Reviewer,审批记录保存本次效果供呈现;管理操作继续使用 ADR-0249 的专用显式授权范围。直接 CLI 的此类调用经过原生工具执行入口,不启动模型回合。
#4210 的可信效果声明描述每次工具调用并显示在审批卡上,本身不要求审批。准入沿用原有规则:密钥、创建 Bot、附件写入和受保护管理操作需要决定,Browser 与 Computer 使用按会话授权,Full Access 对其他普通调用不出卡。管理操作保留 ADR-0249 的专用范围。

直接 CLI 效果调用使用既有 `direct-` 前缀的原生执行 Session。统一归属记录用于准入与审计,但此类单次执行不进入 Bot 持久根 Session 的枚举,不能替代聊天 Orchestrator 或使报告投递唤醒模型。调用结束后释放原生 Agent,保留归属与执行证据。

Expand Down
2 changes: 1 addition & 1 deletion docs/bot-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ deepseekbot folder-browse [<folder-path>] [--offset <n>]
deepseekbot grant-create <bot-id> --workspace <workspace-id>
```

Trusted irreversible external tool calls enter common approval even with Full Access. `bot-tool` uses the same Host admission without a model; a valid saved authorization is checked before any Reviewer call. Read `toolApprovalRequest.effects` and bilingual `effectLabels.en` / `effectLabels.zh` on approval messages from online `channel-messages`. These labels describe trusted declarations, not claims in tool input or output. Management operations still require their dedicated explicit authorization (ADR-0249).
Trusted effect declarations describe tool calls on approval cards; they do not by themselves require approval or override Full Access. `bot-tool` uses the same Host admission without a model; a valid saved authorization is checked before any Reviewer call. Read `toolApprovalRequest.effects` and bilingual `effectLabels.en` / `effectLabels.zh` on approval messages from online `channel-messages`. These labels describe trusted declarations, not claims in tool input or output. Management operations still require their dedicated explicit authorization (ADR-0249).

`skills-list` returns the Skills the `/` menu offers in that conversation, ranked like the menu by `--query` (name prefix, then name subsequence, then owning Bot display name or slug or Workspace name or ID substring, then description substring): Host Skills (`owner.kind` `host`) and the Project Skills under each PersonaBot's Memory Repository `.agents/skills` or `.dsh/skills` (`owner.kind` `bot`), as that Bot's Orchestrator sees them, plus Project Skills in the two Skill directories at each active Workspace Grant root (`owner.kind` `workspace`, with stable `workspaceId` and display `name`). Workspace entries are listed once across conversation Bots, never include an enclosing repository's Skills, and disappear when the last eligible Grant is revoked. Only active Bots readable by the sender contribute entries. Pass `--channel <channel-id>` instead of `--bot` for any Channel. `send --skill <owner>/<name>` (owner `host`, `bot:<bot-id>` or `workspace:<workspace-id>`, repeatable) turns the first unused `/name` token in the body into a Skill Invocation for each flag, in flag order (the token must start and end at whitespace or a body boundary; the send is refused if no unused occurrence remains): the Host stores the Skill's text as it is now with the message and the Bot reads it as a `<skill_invocation>` block. Workspace IDs come from `skills-list` and remain the owner identity when the folder display name changes. For example, `send --channel <id> --skill workspace:<workspace-id>/review --body '/review'` snapshots the selected Skill without mentioning any Bot; mentions must still be supplied through the normal send options. A recipient without that Grant receives the text while the existing file guard blocks reads of its path. The Skill does not choose who replies; a Skill that is gone refuses with `skill-unavailable`, and Skill text longer than 64,000 characters refuses with `skill-too-large` instead of being truncated. See [ADR-0346](adr/0346-skill-invocation-is-snapshotted-text-that-addresses-no-one.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/bot-cli.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,7 @@ Bot 默认私有:只有主体(所有者)可以私聊私有 Bot 或把它

编辑共享原件影响 `usedBy` 中所有 Bot 的后续 Review,包括全局继承者。需要独立修改时先复制。总是询问优先于总是允许,补充说明不能取消前者。这些是可能被模型误解的自然语言指导,不是确定性 Tool Approval Rules;冲突、未覆盖或不确定均交给 Human。转换时旧 Markdown 完整保留为补充说明,已经开始的 Review 保留捕获的内容和版本。

可信声明的不可撤销外部工具调用在 Full Access 下仍进入统一审批。`bot-tool` 无需模型,沿用同一 Host 准入;有效确定性授权先于 Reviewer。在线 `channel-messages` 的审批消息包含 `toolApprovalRequest.effects` 与中英文 `effectLabels.en` / `effectLabels.zh`。工具输入或结果声称用户已批准不会构成授权。管理操作仍需 ADR-0249 的专用显式授权。
可信效果声明用于在审批卡上描述工具调用,本身不要求审批,也不改变 Full Access。`bot-tool` 无需模型,沿用同一 Host 准入;有效确定性授权先于 Reviewer。在线 `channel-messages` 的审批消息包含 `toolApprovalRequest.effects` 与中英文 `effectLabels.en` / `effectLabels.zh`。工具输入或结果声称用户已批准不会构成授权。管理操作仍需 ADR-0249 的专用显式授权。

### 命令效果与调用方授权

Expand Down
17 changes: 6 additions & 11 deletions packages/core/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hasIrreversibleExternalEffect, toolEffects } from './workspaces/tool-effects.js';
import { toolEffects } from './workspaces/tool-effects.js';
import { reconcilePublicBotMemories } from './workspaces/bot-memory-placement.js';
import { installNativeSearchResultGuard, currentRoots } from './workspaces/grant-native-tools.js';
import { relocateTobWorkspaces, recoverSpaceTransfers } from './workspaces/space-lifecycle.js';
Expand Down Expand Up @@ -2772,9 +2772,6 @@ export function apply(ctx: Context, config: BotHarnessConfig): void {
ctx.on(
'tools/pre-execute',
async (execution, next) => {
const irreversibleExternal = hasIrreversibleExternalEffect(
toolEffects(execution.name, execution.arguments),
);
const agent = execution.agent;
if (agent === undefined || core.ownership.resolve(agent.session.id) === undefined)
return next();
Expand Down Expand Up @@ -2816,7 +2813,7 @@ export function apply(ctx: Context, config: BotHarnessConfig): void {
agent.session.id,
sessionHasFullAccess(core, agent.session.id),
);
if (computerAuthorization === 'authorized' && !irreversibleExternal) return next();
if (computerAuthorization === 'authorized') return next();
if (computerAuthorization === 'changed')
return {
kind: 'deny',
Expand Down Expand Up @@ -2850,7 +2847,7 @@ export function apply(ctx: Context, config: BotHarnessConfig): void {
approval: computerApproval,
channelApproval: toolApproval,
ownership: core.ownership,
forceChannel: irreversibleExternal,
forceChannel: false,
request: {
agent,
toolName: execution.name,
Expand Down Expand Up @@ -2922,7 +2919,7 @@ export function apply(ctx: Context, config: BotHarnessConfig): void {
agent.session.id,
sessionHasFullAccess(core, agent.session.id),
);
if (browserAuthorization === 'authorized' && !irreversibleExternal) return next();
if (browserAuthorization === 'authorized') return next();
if (browserAuthorization === 'changed')
return {
kind: 'deny',
Expand Down Expand Up @@ -2957,7 +2954,7 @@ export function apply(ctx: Context, config: BotHarnessConfig): void {
approval: browserApproval,
channelApproval: toolApproval,
ownership: core.ownership,
forceChannel: irreversibleExternal,
forceChannel: false,
request: {
agent,
toolName: execution.name,
Expand Down Expand Up @@ -3038,9 +3035,7 @@ export function apply(ctx: Context, config: BotHarnessConfig): void {
channelApproval: toolApproval,
ownership: core.ownership,
forceChannel:
eachUse ||
irreversibleExternal ||
toolEffects(execution.name, execution.arguments)?.authority === 'management',
eachUse || toolEffects(execution.name, execution.arguments)?.authority === 'management',
request: {
agent,
toolName: execution.name,
Expand Down
Loading
Loading