feat(extensions): add OpenCode standalone tool compatibility - #1592
Merged
limityan merged 1 commit intoJul 17, 2026
Conversation
limityan
force-pushed
the
yanzhn/opencode-tool-compatibility
branch
from
July 17, 2026 05:36
ca2d3cc to
7caa1e1
Compare
Add provider-neutral discovery, approval, conflict, and script-runtime boundaries with Desktop and CLI/TUI product flows. Keep unsupported TypeScript, package plugins, hooks, and remote execution fail-closed.
limityan
force-pushed
the
yanzhn/opencode-tool-compatibility
branch
from
July 17, 2026 07:03
7caa1e1 to
a1f17df
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.
概要
/external-tools审核与 diagnostics,不阻塞普通聊天。当前兼容范围
支持无外部依赖的单文件
.jsstandalone Tool 子集,包括基础 schema、默认值、字符串结果、真实 workspace/session 上下文、合作式取消与硬终止。以下内容仅识别或明确不支持:TypeScript 执行、依赖 import/require、package plugin、Hook、TUI plugin renderer、完整 metadata/ask、Subagent 和 Remote worker。Node worker 继承当前用户的文件、网络、环境与进程权限;VM realm 不是 OS 沙箱,直接创建的后代进程仍有残余风险。
产品与可靠性
aria-live状态并转移焦点;窄终端仍优先显示Esc关闭提示。架构边界
审批的 snapshot 校验、偏好持久化和 product rebuild 现由同一
refresh_gate串行化,避免 watcher 在确认期间把 v1 替换为 v2 后仍应用陈旧 decision。锁序保持refresh_gate -> product_rebuild_gate,OpenCode 特有语义未进入主体运行时契约。验证
cargo +nightly check --workspacecargo +nightly test -p bitfun-core tool_approval_waits_for_refresh_and_rejects_a_changed_decision --lib(1 passed)cargo +nightly test -p bitfun-cli external_tool_(6 passed)cargo +nightly test -p bitfun-cli info_popup_(2 passed)pnpm --dir src/web-ui run test:run src/infrastructure/config/components/ExternalSourcesConfig.test.tsx(9 passed)pnpm run type-check:webpnpm run i18n:audit(0 warnings)node scripts/check-core-boundaries.mjspnpm run check:repo-hygienegit diff --check已有 MCP 依赖的 4 条 deprecated warning,以及最新 main 中 CLI daemon 的 2 条 dead-code warning,与本 PR 无关。
独立对抗性审查
最终快照基于最新
main完成独立资深架构与产品/TUI 两路复审,冻结差异一致,结论均为 P0=0、P1=0、P2=0。复审覆盖 owner/dependency 边界、审批竞态与锁序、跨进程偏好、Remote fail-closed、TUI 编号稳定性、真实 activation 反馈、Desktop module 级动作、错误文案、焦点恢复和窄终端提示。未捕获真实 Desktop IPC 或真实 TUI PTY,因此不把代码级复审表述为完整视觉/对比度/真实终端渲染验收。Bun、完整 TypeScript、依赖/package plugin、Hook、Subagent、通用 SDK、Remote worker、进程树回收和完整 OS sandbox 均保持为后续工作,不扩入本 PR。
体验基线
CI 状态
当前头提交
a1f17df6f的 5 项门禁全部通过:Frontend Build、CLI Tests,以及 Ubuntu、macOS、Windows 三平台 Rust Build Check(均包含 core/desktop Rust tests)。现有 Frontend annotations 位于未触及的既有文件,不属于本 PR。