feat(delegation): @Agent 提及支持单次委托配置(模型/思考/权限) - #616
Open
asteroida123 wants to merge 1 commit into
Open
Conversation
在 @agent 委托链路上增加单次(per-call)配置能力:@ 面板 agent 行尾显示 该 agent 全局委托默认的只读摘要与配置入口,点击入口插入 mention 并打开 懒加载的配置面板;修改只作用于本次委托,优先级为 per-call override > 持久化全局默认 > agent 原生默认。 交互契约: - 普通 @agent 选择 = 纯插入,不回调 onAgentMention、不探测、不带 override; - 行尾入口(span[role=button],Tab/Enter/Space 可达)携带只读摘要 (模型 · 模式,稳定 ID),点击才插入并打开 AgentDelegationConfigPopover; - 探测(describeAgentOptions)只发生在面板打开时,列表渲染零探测、零阻塞; - 点击已插入的 agent badge 可重开其配置面板(reference 节点 storage 回调); - 面板初始值继承全局默认,修改时发完整有效配置(后端整体替换、不合并), boolean 配置(如 Cline auto_approve)支持 true/false,重置即删除 override; - 同一 agent 多个 mention 共享一份配置(显式限制,写入测试); - 队列/重排队/草稿编辑全程保留 override(hydration 时写入恢复出的 badge,文档为唯一事实来源);popover 每次打开重新拉取全局基线。 后端(one-shot 语义不变,MCP schema 不变): - ConnectionCommand::Prompt 携带 delegation_overrides,connection loop 在 turn 开始前写入 SessionState,TurnComplete 随 turn_in_flight 清除, 断开随状态丢弃;admission gate 保证被拒并发 prompt 无法覆盖活跃值; - ParentSessionLookup.delegation_override 按请求 agent_type 读取当前 turn 的覆盖,DelegationRequest.per_call_defaults 兼容旧 payload (skip_serializing_if);broker 按三级优先级选值,绝不回写全局配置。 探针路径顺带修复:probe 连接不再注入 codeg-mcp 伴生进程——探测只为读 广告选项,注入使探测额外承担一次 MCP 握手(且在 MCP 同步不稳的适配器 上把整个探测拖成失败)。 基于 upstream/main(含 @-mention 路由帧与 resume_delegation)。
asteroida123
force-pushed
the
codex/agent-mention-config
branch
from
September 2, 2026 16:32
4c127c6 to
7b48123
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
现在通过
@Agent提及时,单次委托只能使用全局默认配置,无法针对某一次委托选择不同的模型、思考等级或权限配置。本 PR 支持在智能体选择面板中查看当前摘要,并通过按需打开的配置面板修改本次委托配置。未修改时继续使用全局默认配置。
主要改动
前端
@Agentmention 支持保存单次委托的配置覆盖;配置随编辑器文档、发送、排队、重排队和队列编辑流程保留。后端
ACP prompt transport 增加可选的单次 delegation overrides,未设置时保持旧 payload 不变。
当前 turn 使用的单次配置写入
SessionState,turn 完成、取消或断开后清理,避免配置污染后续对话。delegation broker 使用以下优先级:
per-call > 持久化全局默认 > agent 原生默认后端统一清理空白的 mode/config 值;空覆盖会回退到全局默认。
保持现有 one-shot delegation 的 task、status、cancel 和结果缓存语义不变,不修改 agent 原生配置文件或环境变量。
兼容性
测试与检查
git diff --check:通过。