Repository navigation
[v2] Plugins 页去掉所有假的安装:无服务端支持的类型只浏览 - #366
Merged
EricWvi merged 6 commits intoNov 13, 2026
Merged
Conversation
TannyXie
force-pushed
the
fix/1098-no-fake-plugin-install
branch
from
November 13, 2026 01:36
46897ea to
cb3d8d5
Compare
EricWvi
requested changes
Nov 13, 2026
EricWvi
left a comment
Contributor
There was a problem hiding this comment.
服务端的改动方向对:新建市场 Agent、Hook、MCP 选择返回 plugin_kind_not_installable,预装 Agent 仍是 plugin_runtime_managed,工作流插件不限来源,WithDemoHook 已去掉。
前端没有按 owner 在 circus 运行 issue 里的结论做(见那里 11-13 01:28 和 01:32 的两条评论),需要修改:
- 不挂「仅空间选择」标记(
frontend-v2/src/features/settings/plugins/page.tsx:50、:588)。市场 Agent、Hook 一律只浏览,也不显示已选状态。已有的数据库记录不动。 - 删掉
localWorkflow白名单(frontend-v2/src/lib/settings-demo/plugin-catalog.ts:41-59,以及page.tsx里用到它的 3 处)。所有workflow插件,包括官方的workflow-examples和自定义来源的,都走服务端安装和移除;服务端路径本来就不看来源。再补一条 v2-server 测试:从带凭据的自定义来源安装一个工作流插件,能下载、校验并导入。 - 假的安装移到演示 mock,不直接删:放进
frontend-v2/src/lib/demo/,照dts.ts的写法经demoMockEnabled()接入,只有VITE_DEMO_MOCK=1时生效,状态只存浏览器、不发安装请求。要移过去的有:预装 Agent 的「安装」、MCP 示例条目和安装、Hook 示例条目和安装、市场 Agent 的安装、3–5 秒随机等待。测试覆盖开关打开和关闭两种情况。 - 已有的用户市场 Agent 选择也不能更新(
v2-server/internal/store/plugins.go的installSpacePlugin):现在只在ErrNotFound分支拒绝,requested_by_user_id不为空的旧记录走更新分支,仍然能重新安装或升级。更新分支也要对非 Skill、非工作流的类型返回plugin_kind_not_installable,并补测试。
工作流编辑器的「添加 MCP」:owner 同意部署版没有候选项(MCP 执行归另一个事项)。VITE_DEMO_MOCK=1 时,示例 MCP 随第 3 条的 mock 回来,在工作流编辑器里也能选到。
改完后重新附截图送审,截图要包括非官方工作流插件可以安装。
TannyXie
force-pushed
the
fix/1098-no-fake-plugin-install
branch
from
November 13, 2026 05:37
69e77d6 to
2ac6990
Compare
TannyXie
force-pushed
the
fix/1098-no-fake-plugin-install
branch
from
November 13, 2026 05:47
2ac6990 to
d2787aa
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.
做了什么
Plugins 页去掉所有假的安装:没有服务端支持的插件类型一律只浏览。
installSpacePlugin只允许 Skill 和官方工作流插件安装;市场 Agent、Hook、MCP、合集等新建选择返回400 plugin_kind_not_installable(预装 Agent 仍返回409 plugin_runtime_managed)。去掉目录同步时补的无包体示例 Hook(WithDemoHook)。install-delay.ts(3–5 秒随机等待);去掉withDemoCatalog补的 MCP 本地条目;去掉浏览器本地假安装状态在 Plugins 页的使用。决策待 owner 确认(#1129 已提,暂按推荐方案实现)
测试
TestPluginMarketLifecycle断言市场 Agent 安装被拒;TestHookInstallIsRejected;去掉WithDemoHook相关测试并更新 Syncer 断言;go test ./...全绿。v2 流程,送审附截图(见运行 issue)。