fix(app-shell): ToolPreview 不再渲染已退役的 ToolSchema 标记徽标 (#3236) - #3258
Merged
xuyushun441-sys merged 1 commit intoAug 3, 2026
Merged
Conversation
…3236) The tool preview's header strip read four keys straight off the raw draft and painted a pill for each: `requiresConfirmation`, `active`, `builtIn` and `category`. All four were removed from `@objectstack/spec`'s `ToolSchema` — `requiresConfirmation` in the 16.x line (objectstack#3715, ADR-0033 §2) and the other three in 17.0.0 (objectstack#3896). The schema is `.strict()` and rejects each by name, verified against the `@objectstack/spec@17.0.0-rc.1` this repo depends on. New metadata cannot reach these pills, but rows stored before the removals still carry the keys and kept lighting them up. `Requires confirmation` advertised a safety pause no execution path performs (the real gate is `action.ai.requiresConfirmation` + the HITL approval queue) and `Disabled` claimed a withdrawal while the registry kept handing the tool to the LLM — the objectui#2962 shape of a badge advertising a capability the runtime does not have. Deleted the reads, the pills, and the now-callerless `tone` vocabulary on the `Pill` helper. Added ToolPreview.test.tsx, which feeds a stale draft carrying all four keys and asserts none of them renders. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVPjPzmmAJ2Ngtvgg5MSRa
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
xuyushun441-sys
marked this pull request as ready for review
August 3, 2026 08:02
xuyushun441-sys
deleted the
claude/issue-3236-toolpreview-requiresconfirmation
branch
August 3, 2026 08:03
This was referenced Aug 3, 2026
Closed
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.
Fixes #3236
改了什么
packages/app-shell/src/views/metadata-admin/previews/ToolPreview.tsx的头部条原先直接从 raw draft 上读四个键、每个画一枚 pill。四个键全部已从@objectstack/spec的ToolSchema移除,现已删除:requiresConfirmationRequires confirmation(琥珀色 + 警告图标)activeActive/DisabledbuiltInbuilt-incategory保留的头部条内容:label、机器名、以及
objectNamepill(objectName仍是 spec 认的键)。参数表、Example LLM Call、Output Schema 一律未动。Pill的tone(green/amber)词汇随徽标一起删掉 —— 删完已无调用者,留着正是徽标长回来的入口。active/builtIn的核实结论(issue 要求先核实再动)已核实,确属同型残留,一并清理。 不是照着 issue 猜的,是对着本仓实际安装的
@objectstack/spec@17.0.0-rc.1跑出来的:spec 源码里的注释也把这四个并列写死了:「
category、permissions、active和builtIn由 2026-07 #3896 安全审计关闭一并移除」。顺带发现:
category也是同型残留(issue 只点了active/builtIn)。它由同一次 #3896 移除、在同一条头部条上渲染,是同一次核实查出来的,因此一并删,单独在这里说明。permissions本预览从未读取,无需处理。为什么这不是"少画个徽标"的小事
spec 已
.strict()具名拒收,所以新元数据带不进来 —— 但退役前入库的陈旧存量行仍带着这些键,预览照亮不误。危害方向是明确的:Requires confirmation在宣传一个从未存在的安全暂停。没有任何执行路径读过它 —— 不是 LLM tool set(工具只以 name/description/parameters 到达模型)、不是ToolRegistry.execute、不是POST /ai/tools/:name/execute。审阅者看到一个破坏性工具被标成"有确认门",而它并没有。真正的门是action.ai.requiresConfirmation+ HITL 审批队列。Disabled宣称工具已被撤下,而ToolRegistry.getAll()仍在把它交给 LLM、execute 路由仍在跑它。即 objectui#2962 的同型形状:一个 UI 徽标宣传运行时并不兑现的能力。
测试(objectui#3236 要求的钉子)
新增
packages/app-shell/src/views/metadata-admin/previews/ToolPreview.test.tsx:喂一个仍带全部四个退役键的陈旧 draft(requiresConfirmation: true、active: false、builtIn: true、category: 'data'),断言一枚都不渲染;另有正向断言,保证 label / 机器名 / description /objectNamepill / 参数表 / Example LLM Call 都还在。反向验证做了:把徽标分支临时加回去,断言确实会红(不是永远为真的空断言):
删掉徽标后:
同目录/同视图回归(root config,含全部 metadata-admin 测试):
Changeset
已加
.changeset/toolpreview-drop-retired-flag-pills.md(@object-ui/app-shell: patch)。判断依据:虽然是纯删代码,但用户可见 —— admin 预览里几枚徽标消失了(其中Active是以前无条件渲染的),审阅 tool 元数据的人会直接看到差别,该进 release notes。按 AGENTS.md 版本策略不声明major;check-changeset-no-major.mjs与check-changeset-fixed.mjs均已本地跑过通过。范围外发现
apps/console/src/preview-samples.ts的tool样例仍带category/active/requiresConfirmation三个已退役键 —— 同型残留,但在apps/console而非本次 scope fence(packages/app-shell)内,未在本 PR 改动,已另开 #3257 记录。除此之外,全仓扫描(
packages/apps/content/examples/e2e/)已无其他requiresConfirmation/ toolbuiltIn残留。🤖 Generated with Claude Code
https://claude.ai/code/session_01NVPjPzmmAJ2Ngtvgg5MSRa
Generated by Claude Code