OhMyAgent Desktop v4.0.0
v4.0.0 的主角是工具面(tool surface)治理:工具预设重构为 3 档能力域组合,新增按轮次意图收窄与技能严格模式,核心白名单从 23 个工具收缩到 10 个——系统提示词更精简,模型调用更准;同时 WebUI 聊天输入新增推理等级选择器,Feishu 卡片全面迁移到卡片 JSON 2.0。
🎯 工具面治理(本版本核心)
工具预设重构为 3 档能力域组合
- 工具预设收敛为 restricted(极简)/ standard(标准)/ full(完整) 三档能力域组合,Agent 预设默认
standard;移除全局tools.toolsProfile冗余设置(升级后请在 Agent 配置中指定预设,未指定时直接取 standard) - 核心工具白名单从 23 个收缩到 10 个:每轮固定注入系统提示词的工具更少,其余工具进入 tool-search 延迟池(按需发现、按需解锁)
- 技能支持
tools-surface: strict严格模式:技能激活时工具面收缩到该技能声明的工具集合
按轮次意图收窄
- 新增
src/agent/intent.ts:确定性规则将消息映射到意图域,命中时仅装配该域相关的工具,不相关的工具从本轮提示词中隐藏——单轮提示词更短、更聚焦
工具面健康度可观测
- 新增
src/agent/tool-surface-stats.ts:按轮记录可见工具数、延迟池大小、预设与技能严格标记(500 轮有界环形窗口 + 聚合快照),agent-factory 每轮输出tool surface stats调试日志,可与 tool_runs 的调用分布对比分析「工具面大小 vs. 任务成效」
工具描述正交性 linter
- 新增
src/tools/tool-linter.ts:检查空描述(错误)、超 2 句、超长、非动词开头,以及工具对之间的近重复描述(Jaccard 相似度,CJK 感知分词) - 新增 CLI 命令
ohmyagent tools lint(35 个内置定义:0 错误、7 条建议性警告)
提示词与编排修正
- 系统提示词工具目录现在标注延迟状态:延迟工具带
[deferred — discover via tool_search, invoke via tool_call]提示,修复模型幻觉直呼延迟工具而报 unknown tool 的问题;spawn 门关闭时 spawn 工具不再出现在目录中 - 团队自动触发改为能力门控:仅在当轮装配面包含
spawn_agent时注入反思;标准档下编排类工具(spawn_agent / plan_and_spawn / team_create / team_delete)属于标准能力但延迟发现,受限档永不注入
✨ WebUI 聊天输入升级
- 新增每轮推理等级选择器:推理等级绑定到当前会话,切换即时生效
- 模型与推理等级的会话固定立即持久化,Agent 固定同步生效,刷新后不丢失
- 修复移动端下拉菜单被顶部栏遮挡的问题:菜单向上展开、自适应高度,窗口/可视区变化时重新测量
- 修复手风琴组件裁剪 Select 下拉面板的问题;统一「工具预设」中文译名与排序(极简/标准/进阶/完整)
💬 Feishu 卡片 JSON 2.0 与问题卡打磨
- 独立交互卡片全面迁移到卡片 JSON 2.0:新增
render/card20.ts构建器(骨架、按钮、按钮行网格) - 问题卡按用户反馈调整:恢复一行一个全宽按钮;选项超过 10 字时在按钮上方渲染编号 Markdown 全文列表(按钮文本会截断,列表自然换行),长选项完整可读
- 修复问题卡「未作答却显示已收到」的竞态:steer 取消的问题现在诚实显示「🚫 问题已取消」;移除 5 分钟自动超时,问题无限等待(新消息作答/取消、/stop 拒绝仍是逃生通道)
- 任务失败分析卡新增**「编辑并应用」操作**;按钮操作后卡片原位替换,不再残留旧状态
- WS 客户端降噪:注册 no-op reaction 处理器、过滤 SDK 未处理事件警告(读回执等),日志不再被刷屏
✅ 配置校验与表单必填
- 配置加载fail-fast 强化,并抽取工具能力注册表;
policy.mode=safe下将 shell 生效执行模式从 trusted 降级为 safe,堵住策略绕过缺口 - WebUI 设置与引导向导全面标记必填项并校验:供应商/模型选择必填,自定义供应商必须填写 Base URL,webhook 模式与 embedding 按供应商联动必填,computer-use 必填字段跟随所选供应商
- 移除企业微信的 API Base 字段,空
api_base增加防护
🔧 其他
- 桌面端托盘 release notes 与 WebUI 使用同一 remark/GFM 渲染引擎
- 图像生成提示词移除不支持的
quality参数 - 新增 CI prettier 门禁与
git-blame-ignore-revs;全库 prettier 回填(无语义变更);安全与健壮性专项修复
v4.0.0's headline is tool-surface governance: tool profiles are rebuilt as 3 capability-domain presets, with per-turn intent narrowing and a skill strict mode added, and the core whitelist shrinks from 23 to 10 tools — leaner system prompts and more accurate tool calls. The WebUI chat input gains a reasoning level selector, and Feishu cards fully migrate to card JSON 2.0.
🎯 Tool Surface Governance (Headline)
Tool Profiles Rebuilt as 3 Capability-Domain Presets
- Profiles converge on restricted / standard / full capability-domain presets; agent profiles default to
standard. The redundant globaltools.toolsProfilesetting is removed (after upgrading, set the profile per agent — an unset profile takes standard directly) - Core tool whitelist shrinks from 23 to 10 tools: fewer tools injected into the system prompt each turn, with everything else in the tool-search deferral pool (discover on demand, unlock on demand)
- Skills support
tools-surface: strictstrict mode: when a skill activates, the tool surface contracts to exactly that skill's declared tools
Per-Turn Intent Narrowing
- New
src/agent/intent.ts: deterministic rule matching maps a message to an intent domain; on a hit only that domain's tools are assembled and unrelated tools are hidden from the turn — shorter, more focused per-turn prompts
Tool-Surface Health Observability
- New
src/agent/tool-surface-stats.ts: per-turn record of visible tool count, deferral-pool size, profile and skill-strict flags (bounded 500-turn ring window + aggregate snapshot); agent-factory emits atool surface statsdebug log each turn, and together with tool_runs call distributions this enables surface-size vs. outcome comparisons
Tool Description Orthogonality Linter
- New
src/tools/tool-linter.ts: flags empty descriptions (error), >2 sentences, over-length, non-verb starts, and near-duplicate descriptions between tool pairs (Jaccard similarity, CJK-aware tokenization) - New CLI command
ohmyagent tools lint(35 builtin definitions: 0 errors, 7 advisory warnings)
Prompt & Orchestration Fixes
- The system-prompt tools catalog now annotates deferral state: deferred entries carry a
[deferred — discover via tool_search, invoke via tool_call]hint, fixing models hallucinating direct calls to deferred tools (which failed as unknown tool); spawn tools are excluded from the catalog when the spawn gate is closed - Team auto-trigger is now capability-gated: reflections are injected only when the turn's assembled surface includes
spawn_agent; under the standard profile orchestration tools (spawn_agent / plan_and_spawn / team_create / team_delete) are a standard capability but deferred-discovery, and restricted never injects
✨ WebUI Chat Input Upgrade
- New per-turn reasoning level selector: the reasoning level pins to the current session and takes effect immediately
- Session pins for model and reasoning level persist immediately and the agent pin syncs too — nothing is lost on refresh
- Fixed mobile dropdowns being clipped by the top bar: menus open upward, self-size their max-height, and re-measure on window/visualViewport changes
- Fixed the accordion clipping Select dropdown panels; unified the zh-CN label and ordering for Tools Profile (极简/标准/进阶/完整)
💬 Feishu Card JSON 2.0 & Question Card Polish
- Standalone interactive cards fully migrate to card JSON 2.0: new
render/card20.tsbuilders (skeleton, buttons, button-row grid) - Question cards adjusted per user feedback: back to one full-width button per row; when any option exceeds 10 chars, a numbered markdown full-text list renders above the buttons (button text truncates, the list wraps naturally), so long options stay fully readable
- Fixed the question card race that showed "answer received" without user action: steer-cancelled questions now honestly render "🚫 question cancelled"; the 5-minute auto-timeout is removed and questions wait indefinitely (a new message answers/cancels, /stop rejects — escape hatches remain)
- The task-failure-analysis card gains an edit-and-apply action; the card is replaced in place after button actions instead of leaving stale state
- WS client noise reduction: no-op reaction handlers registered and SDK unhandled-event warnings filtered (read receipts etc.), so logs stop being spammed
✅ Config Validation & Required Fields
- Config loading is hardened to fail fast, and the tool capability registry is extracted; under
policy.mode=safethe effective shell exec mode downgrades from trusted to safe, closing a policy bypass gap - WebUI settings and the setup wizard now mark required fields everywhere and validate them: provider/model pickers required, Base URL required for custom providers, webhook-mode and embedding requirements follow the selected provider, computer-use required fields follow the provider
- The WeChat Work API Base field is removed, with a guard for empty
api_base
🔧 Other
- Desktop tray release notes now render with the same remark/GFM engine as the WebUI
- The image-generation prompt drops the unsupported
qualityparameter - New CI prettier gate and
git-blame-ignore-revs; a repo-wide prettier backfill (no semantic changes); a security & robustness review fix batch