Skip to content

fix(issues): let agents create requirements without an SOP - #1411

Merged
Robert0622 merged 2 commits into
Tencent:mainfrom
Robert0622:fix/issue-sop-mode-contract
Nov 26, 2026
Merged

Robert0622 merged 2 commits into
Tencent:mainfrom
Robert0622:fix/issue-sop-mode-contract

Conversation

@Robert0622

@Robert0622 Robert0622 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

问题

在 AI 助手或聊天 Bot 里说「建一条需求,不走任何 SOP,我在对话里直接改代码」,建出来的需求仍然绑定了项目默认 SOP(workflowId=generic-backend-delivery-<project>)。需求列表里显示「关联 SOP:后端交付 SOP」,详情页显示「触发后会按 SOP 执行」,并且会被当作可派发 SOP 的需求。网页「新建需求 → 不使用 SOP」是正常的,只有 Agent 走 issues_save 这条路会出问题。

原因

issues_save 的工具参数契约(mcpserver.ToolInputSchema)是从 docs/api/openapi.yaml 生成的,而 components.schemas.Issue 里没有 sopMode 字段(domain.Issue 里有)。所以模型通过 workbench_tool_schema 看不到这个字段,只能不填 workflowId 或者填空字符串。IssuesRepo.prepareIssueForSave 在 sopMode 为空时会调用 bindDefaultWorkflow,于是需求被绑上了默认 SOP。模型在下一轮回复里还会说「平台按项目默认值自动填了 SOP」。

另外有几处界面文案也假定需求一定走 SOP:

  • 对话草稿卡片不认识 sopMode。
  • Bot 确认页对 sopMode=none 的草稿仍然提供 SOP 选择和「创建后立即启动」,摘要写的是「项目默认 · xxx SOP」。
  • 带 workflowId 的 sopMode=none 草稿会被当成「走 SOP 的建议」。
  • 需求详情里,还没运行过的需求「触发方式」显示「直接运行」,这个词原本表示「从流程设计器或 API 直接启动、未关联需求」的运行。不使用 SOP 的需求详情里还写着「触发后会按 SOP 执行」「触发后由 SOP 节点 Agent 接手」。

复现(main f7b066d,本机部署,真实模型,项目绑定私有 GitHub 仓库)

提示词:「帮我建一条需求,标题「对话改代码-xxx」,正文「todo/app.py 增加 clear_done() 清理已完成项」。这条需求不要走任何 SOP,我会在对话里直接改代码,定时任务也不要认领它。」在卡片上点「确认保存需求」后,查看保存结果:

执行器 / 模型 确认方式 main:保存结果 本 PR:保存结果
CodeBuddy deepseek-v4.1-flash 请求批准 workflowId=generic-backend-delivery-e2e-auto,sopMode 为空 sopMode=none,没有 workflowId,automationState=ignored
Cursor grok-4.7 请求批准 绑定默认 SOP(草稿里自己加了 automationState=ignored) sopMode=none
OpenCode GLM-5.3-Flash(智谱) 请求批准 草稿显式传了 workflowId:"",仍然绑定默认 SOP sopMode=none
DeepSeek Harness deepseek-flash 完全权限 sopMode=none(模型自己猜中了字段) sopMode=none

main,CodeBuddy 生成的卡片和需求详情(「触发后会按 SOP 执行」「触发方式:直接运行」「关联 SOP:后端交付 SOP」):

main card
main drawer
main glm drawer

修复

  • docs/api/openapi.yaml:给 Issue 补上 sopMode(enum: ["", none, sop]),并写明 none、sop 和省略时各自的语义;workflowId 的说明里也指向它。issues_save 的契约和公共 MCP 工具会自动带上这个字段,不用改服务端写入逻辑(prepareIssueForSave 本来就会正确处理 sopMode=none)。
  • assistant_proposals.go:sopMode=none 的新建需求不算「交给 SOP」,不再带 proposal。
  • bot_drafts.go:拆出 botDraftNewIssue 和 botDraftWithoutSOP。对不走 SOP 的新需求,确认页不提供 SOP 选择和启动选项,摘要写「(SOP:不使用 SOP)」,确认后保存为 sopMode=none。
  • chatbot/src/operations.js:草稿卡片的 SOP 一栏显示「不使用 SOP」,不再显示即将被丢弃的 workflowId 对应的名称。
  • web/app/issue-model.js、web/app/issue-drawer.js:不使用 SOP 的需求在未开始时写「在对话里澄清需求、直接改代码;定时任务不会自动认领它」。还没有任务和运行的需求,「触发方式」显示「对话处理」或「尚未触发」,不再显示「直接运行」。

影响面:只改契约文档,以及 sopMode=none 时的提示和展示分支。带 SOP 的需求、已经运行过的需求,以及现有 sopMode 的写入语义都不变。和 issues_save 相关的入口(助手确认、完全权限、帮我批准审查、Bot 网页确认)都已覆盖。

测试

新增测试(修复前都会失败,修复后都能通过):

  • internal/mcpserver TestIssueSaveContractOffersSOPMode:issues_save 的契约包含 sopMode;none、sop 和空值能通过校验,未定义的值会被拒绝。
  • internal/httpapi TestSOPProposalValidation(扩展):sopMode=none 的草稿会去掉 proposal。
  • internal/httpapi TestBotDraftRequirementWithoutSOP:确认页不提供 SOP 选择;确认后得到 sopMode=none,没有 workflowId,automationState=ignored。
  • chatbot composer-operations:卡片显示「不使用 SOP」。
  • webtest issue-conversation:未运行的需求不显示「直接运行」,不使用 SOP 的需求不显示「按 SOP 执行」。

回归:

  • go test ./internal/httpapi ./internal/mcpserver ./internal/repo ./internal/domain:只有 TestWorkspacePreparationAPISeparatesReadersAndWriters 失败,原因是本机没有 bwrap。main 上同样失败,修复前后的失败集合完全一致。
  • webtest:308/308 通过。
  • chatbot vitest:62 个文件,534 个用例全部通过。
  • 真实部署 A/B(见上表):4 个执行器在修复版上都正确保存为 sopMode=none,页面没有 console 或 HTTP 错误。

修复后(CodeBuddy 卡片、需求详情;Cursor 卡片;GLM 需求详情):

fix card
fix drawer
fix cursor card
fix glm drawer

本轮全量走查中顺带验证、没有发现问题的部分(main f7b066d)

  • 对话:CodeBuddy、Cursor grok-4.7 high、DeepSeek Harness、OpenCode(智谱 GLM-5.3-Flash)、Pi(DeepSeek flash)五个执行器的真实问答。
  • 自定义 HTTP MCP:通过 mcp.json 导入、编辑时保留脱敏的 header、五个执行器都能真实调用工具。
  • 附件读取、停止生成、生成中排队发送、会话的重命名、搜索和筛选。
  • 在原生沙箱里对私有库改代码、建分支并推送(CodeBuddy)。
  • 快速接入向导三步、新建需求(Markdown 预览、不使用 SOP)、GitHub issue 同步、需求搜索和筛选。
  • AI 定时任务:cron、立即运行、执行记录、停用。
  • SkillHub 市场浏览和搜索。
  • 统计、设置、访问密钥、平台管理、通道管理、能力资产等页面:逐个点击非破坏性按钮,没有页面错误。

另外记录了两点,没有在这个 PR 里改:新建 cron 定时任务后会立刻触发一次,已由 #1272 处理;GitHub 导入的 issue 沿用 GitHub 编号,会和本地需求的编号重复,比如都显示为 E2E-1。

🤖 Generated with Claude Code

The issues_save tool contract is generated from docs/api/openapi.yaml, whose
Issue schema lacked sopMode. Assistants and chat Bots asked for a requirement
"not on any SOP" therefore could not express it: the save bound the project
default SOP, so the requirement looked eligible for SOP delivery.

- Document Issue.sopMode ("", none, sop) so issues_save offers it.
- A draft with sopMode none is not an SOP proposal and offers no SOP
  choice on the Bot confirm page; its summary says "不使用 SOP".
- The chat draft card shows "不使用 SOP" instead of the SOP it drops.
- Requirements that never ran no longer say they run by SOP or were
  started directly ("直接运行") in the list and drawer.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Robert0622

Copy link
Copy Markdown
Collaborator Author

部署实测 b4761282:无需修改,可以合入

本机分别部署 main 2e5176f1 和本 PR(MySQL 8.4.7 全新库,没有对着 LoopForge 仓库测),用同样的提示词、同样的确认方式对照。真实模型只用了低成本模型。

1. 让助手建「不走 SOP」的需求,确认后看保存结果

执行器 / 模型 确认方式 main 本 PR
CodeBuddy deepseek-v4.1-flash(IOA) 请求批准 草稿没有 sopMode,保存后绑了 generic-backend-delivery ❌ 草稿 sopMode=none,保存后 sopMode=none、没有 workflowId、automationState=ignored ✅
Cursor grok-4.7(high) 请求批准 草稿 workflowId:"",仍绑默认 SOP ❌(跑了 379 秒) sopMode=none ✅(66 秒)
OpenCode glm-5.3-flash(智谱) 请求批准 草稿只带 automationState=ignored,仍绑默认 SOP ❌ sopMode=none ✅
DeepSeek Harness deepseek-flash 请求批准 同上,仍绑默认 SOP ❌ sopMode=none ✅
DeepSeek Harness deepseek-flash 自动执行 绑默认 SOP ❌ sopMode=none ✅
CodeBuddy deepseek-v4.1-flash 帮我批准(assisted) 绑默认 SOP ❌ sopMode=none ✅
CodeBuddy deepseek-v4.1-flash 请求批准,把已有的带 SOP 需求改成不走 SOP 仍是 generic-backend-delivery ❌ 改成 sopMode=none,workflowId 清空 ✅

2. 不受影响的部分(回归)

场景 main 本 PR
CodeBuddy:「按项目默认 SOP 交付」 绑 generic-backend-delivery 草稿 sopMode=sop,保存后同样绑 generic-backend-delivery ✅
Cursor grok-4.7 high:同上 绑默认 SOP 绑默认 SOP ✅
草稿没有 proposal(sopMode=none 不算「交给 SOP」) — 9 个草稿都没有 proposal ✅

3. 界面(Chromium,同一份数据)

位置 main 本 PR
对话草稿卡片(sopMode=none + workflowId=generic-backend-delivery)的 SOP 一栏 generic-backend-delivery 不使用 SOP ✅
不使用 SOP 的需求详情:触发方式 直接运行 对话处理 ✅
不使用 SOP 的需求详情:结果说明 触发后会按 SOP 执行 在对话里澄清需求、直接改代码;定时任务不会自动认领它 ✅
带 SOP、还没运行过的需求:触发方式 直接运行 尚未触发 ✅;仍提示「触发后会按 SOP 执行」

页面没有 JS 报错,也没有 5xx。

4. 测试

  • 新增的 3 个 Go 测试(TestIssueSaveContractOffersSOPMode、TestSOPProposalValidation 新增的用例、TestBotDraftRequirementWithoutSOP)在本 PR 上通过;只把测试文件放到 main 的代码上,3 个都失败,失败原因正是本 PR 修的问题。
  • go vet ./internal/httpapi ./internal/mcpserver 通过;chatbot 构建(含 vitest)通过;CI 16/16 通过。

没在部署里测的:飞书/企微 Bot 的网页确认页(需要真实 IM 通道),这条路径由 TestBotDraftRequirementWithoutSOP 覆盖(走的是真实 handler 和 repo)。

合并提醒:本 PR 和 #1286(SOP→LOOP 改名)在 5 个文件上有文本冲突:chatbot/src/operations.js、internal/httpapi/bot_drafts.go、bot_drafts_test.go、web/app/issue-drawer.js、web/app/issue-model.js。按之前定的顺序 #1286 最后合,所以本 PR 先合没问题;#1286 合之前要再合一次 main,并把本 PR 新加的「不使用 SOP」「尚未触发」这几条文案改成 LOOP。

token 是作者本人的账号,所以只评论、不点 Approve。

@Robert0622

Copy link
Copy Markdown
Collaborator Author

CR + 部署实测:b4761282,LGTM(1 个和 #1286 合入顺序相关的提醒,非阻塞)

评审结论

  • docs/api/openapi.yaml 给 Issue 加 sopMode("" / none / sop)后,生成的 issues_save 工具契约带上了这个字段,Agent 终于能建「不使用 SOP」的需求;枚举之外的值(如 off)在 MCP 校验层就被拒,main 上是静默丢弃后绑项目默认 SOP。
  • assistantProposalTarget、botDraftIssueSOP / botDraftWithoutSOP / botDraftNewIssue 的拆分没问题:不使用 SOP 的新需求不再出现在 SOP 选择卡片里、也不计入「确认页可以更换仓库和 SOP」,摘要行显示「不使用 SOP」;更新已有需求的草稿不受影响。
  • 抽屉的「触发方式」改成按有无任务/运行判断,不使用 SOP 的需求显示「对话处理」,不再误写成「直接运行」。

部署实测(本机 MySQL 8.4.7,PR head 和 main f7b066d8(本 PR 的 base)各起一套平台,走平台自己的 /mcp,没有对着 LoopForge 仓库测)

场景 main f7b066d8 PR b4761282
tools/list 里 issues_save 的 body 有没有 sopMode 没有 有,enum ["", none, sop]
真实模型 deepseek-flash 拿平台下发的契约,按「这条需求不使用 SOP,直接在对话里澄清并改代码」建需求 模型没法表达,只能把这句话写进描述、外加 automationState:"disabled";落库后 workflowId=generic-backend-delivery,被绑上项目默认 SOP 模型直接传 sopMode:"none";落库 sopMode=none、workflowId 为空、automationState=ignored
直接调 issues_save:sopMode = none / sop / 空 都接受(无契约提示) 都接受;none 不绑 SOP,sop 和空绑项目默认
sopMode:"off" 静默接受,绑默认 SOP 400 arguments.body.sopMode has an undocumented value
编辑不使用 SOP 的需求、不带 sopMode — 仍是 none,不会被绑回 SOP
编辑时传 sopMode:"sop" → 再传 none — 先绑回 generic-backend-delivery,再改回 none 并清空 workflowId
需求抽屉(Chromium) 触发方式「直接运行」、关联 SOP「未关联」、「尚未执行 · 触发后会按 SOP 执行」 触发方式「对话处理」、关联 SOP「不使用 SOP」、「尚未开始 · 这条需求不使用 SOP,在对话里澄清需求、直接改代码;定时任务不会自动认领它。」
main:模型建出来的需求被绑了默认 SOP PR:不使用 SOP
main pr

测试

  • go test ./internal/httpapi/ ./internal/mcpserver/ ./internal/domain/:mcpserver、domain 全过;httpapi 只有 TestBrowserStreamPushesFramesAndRunsCommands、TestMainBotBrowserStartsAndDrivesRunBrowser 两个失败,是本机浏览器环境的原因,main 上同样失败,没有新增失败。
  • chatbot npm test 534/534 通过;CI 当前 15 项通过、1 项进行中。

提醒(非阻塞):本 PR 新加的用户可见文案「不使用 SOP」「尚未开始 · 这条需求不使用 SOP…」「在对话里澄清和改代码」等用的是 SOP 叫法。#1286(SOP → LOOP 改名)按约定最后合;如果本 PR 先合,#1286 下次合 main 时要把这几条一起改成 LOOP。

@crispinhu27 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

初审 head b476128(base main 2e5176f),结论 REQUEST_CHANGES:发现 1 条 P2 和 1 条 P3,都已在隔离环境里实际复现,详见行内评论。

主体修复已验证有效:

  • 在 head 上通过 /mcp 的 tools/list 能看到 sopMode(enum ["", none, sop]),base 上没有。
  • sopMode: none 保存后不绑定 SOP,automationState=ignored;同时传 workflowId 时会被清掉;只改标题再保存仍保持 none。
  • 不传 sopMode 时仍然绑定项目默认 SOP,和 base 一致。
  • 中文界面打开不使用 SOP 的需求:head 显示「对话处理 / 不使用 SOP / 这条需求不使用 SOP…」,base 显示「直接运行 / 触发后会按 SOP 执行」,没有页面错误。

测试对比(head 对比 base):

  • Go:build、vet 都通过。httpapi、mcpserver、repo、domain、botinteraction 等包的失败集合完全一致,都是 httpapi 里缺 bwrap、浏览器这类环境原因导致的 15 项。
  • chatbot vitest:head 534/534,base 533/533。
  • webtest:head 308/308,base 307/307。
  • 新增的 5 个测试在 base 上失败、在 head 上通过。
  • CI 16/16 通过。

不阻塞、和本 PR 无直接关系的观察:飞书/企微卡片上,不使用 SOP 的草稿仍会出现「确认并启动 SOP」按钮,原因是 push_card.go 按摘要里的「(SOP:」判断。head 上点了只会保存、不会启动,比 base 的行为好,所以不算回归,可以后续再收紧。

未做的验证:没有用真实模型走 AI 助手或聊天 Bot 的完整对话链路(没有模型凭据),只直接调用了 /mcp 的 issues_save;网页 bot-approve 页面和 chatbot 草稿卡片只跑了单元测试,没在浏览器里看。

Comment thread web/app/issue-drawer.js Resolved
Comment thread docs/api/openapi.yaml Resolved
…ed SOPs

- web/i18n-en.js: add the three strings this PR introduced for requirements
  without an SOP (trigger 对话处理, actor hint, outcome banner). English mode
  showed them in Chinese, and the banner was translated piecemeal into mixed
  Chinese and English.
- repo: when an edit lifts a no-SOP choice with sopMode=sop and sends no
  automationState, reset the ignored state that choice set to eligible, as
  binding or running an SOP from the page already does. The issues_save
  contract now offers sopMode=sop, and before this the requirement got its
  SOP back but scheduled SOPs still skipped it. A requirement ignored on its
  own, or an automationState sent in the same save, is kept.
- openapi: say that sop lets scheduled SOPs claim it again.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Robert0622

Copy link
Copy Markdown
Collaborator Author

处理 crispinhu27 的 P2、P3,新 head f9f1e1fd

改动

  • P2(英文界面出现中文):web/i18n-en.js 补上本 PR 新加的 3 条文案。
  • P3(sopMode: sop 说明和行为不一致):按第二种方案改服务端。IssuesRepo.prepareIssueForSave 中,旧需求是 sopMode=none、这次保存显式传 sopMode=sop、且没带 automationState 时,把沿用来的 ignored 改成 eligible,和 dispatch.go:274、issue_routes.go:302 一致。以下两种情况保持 ignored:本来就手动 ignored 的 SOP 需求;同一次保存显式传了 automationState。openapi 的说明也一并改准确。
  • 新增测试:webtest English mode translates how a requirement that never ran will be handled,Go TestRequirementBackToSOPRejoinsScheduledClaims(包括定时任务的 dispatchIssue 认领,以及两种保持 ignored 的情况)。两个测试在 b4761282 上都失败,在 f9f1e1fd 上都通过。

部署实测(本机同时起 b4761282 和 f9f1e1fd,MySQL 8.4.7,没有对着 LoopForge 仓库测)

场景 b4761282 f9f1e1fd
CodeBuddy deepseek-v4.1-flash:「把之前不走 SOP 的需求改回默认 SOP,让定时任务能认领」 草稿 sopMode=sop,保存后 automationState=ignored ❌ 草稿相同,保存后 eligible,绑 generic-backend-delivery ✅
Cursor grok-4.7 high:同上 ignored ❌ eligible ✅
DeepSeek Harness deepseek-flash:同上 草稿只带 sopMode=sop,ignored ❌ 模型自己带了 automationState=eligible,结果 eligible ✅
英文界面,不使用 SOP 的需求详情 Trigger 显示「对话处理」,横幅「这条需求No SOP, Clarify…」 Handled in chat;横幅「This requirement uses no SOP: clarify and change code in chat; scheduled jobs won't pick it up.」 ✅
英文界面,带 SOP、还没运行过的需求 Not triggered yet 不变 ✅
回归:CodeBuddy、OpenCode glm-5.3-flash 建不走 SOP 的需求 — sopMode=none、ignored ✅
回归:CodeBuddy「按默认 SOP 交付」 — 绑默认 SOP,automationState 为空(和 main 一样) ✅

页面没有 JS 报错。上一条评论里对 b4761282 的 9 组 main/PR 对照仍然成立,这次提交没有改到那些路径。

测试

  • go vet、gofmt 通过。go test 跑 httpapi、mcpserver、repo、domain、botinteraction 五个包:b4761282 和 f9f1e1fd 都是 15 个失败,名单完全相同,都是本机缺 bwrap、Docker、Chromium 造成的。
  • webtest 309/309 通过(多出的 1 个是新测试)。

不在本 PR 范围:英文详情页里「平台新建」「统计关联 TAPD」「继续开发分支」「自动新建」也没翻译,b4761282 上同样如此,不是本 PR 引入的。crispinhu27 提到的飞书/企微卡片「确认并启动 SOP」按钮,这次没改。

脚本和结果:loopforge-pr-fix-robert0622-1126-0400/。token 是作者本人的账号,所以只评论、不点 Approve,需要 crispinhu27 复审。

@Robert0622

Copy link
Copy Markdown
Collaborator Author

复测 f9f1e1fd:crispinhu27 提的两个问题都修好了,LGTM(上一条针对 b4761282 的 LGTM 作废,以这条为准)

上一轮我测了 sopMode:"sop" 会绑回默认 SOP,但没检查 automationState,漏掉了 P3。这次补上了。

部署实测(重新用 f9f1e1fd 构建平台,本机 MySQL 8.4.7,走平台的 /mcp)

  • 真实模型 deepseek-flash 拿平台下发的契约建「不使用 SOP」的需求:传的是 sopMode:"none",落库 sopMode=none、workflowId 为空、automationState=ignored。上一轮 9 项检查重跑,9/9 通过。
  • 对这条需求做编辑,结果如下:
操作 结果
只改优先级,不带 sopMode 仍是 none,没有被绑回 SOP
传 sopMode:"sop" workflowId=generic-backend-delivery,automationState=eligible(P3 已修,定时 SOP 可以重新认领)
再传 sopMode:"none" 清空 workflowId,automationState=ignored
传 sopMode:"sop",同时带 automationState:"disabled" 绑回默认 SOP,automationState 保持显式传入的 disabled
  • P2 英文词条:web/i18n-en.js 补了「对话处理」「在对话里澄清和改代码」和抽屉里那段说明。「不使用 SOP」「尚未开始」「未开始」原来就有词条。

测试

  • go test -run 'SOPMode|BotDraft|Proposal' ./internal/httpapi/ ./internal/mcpserver/ 通过,其中包括新增的 issue_sop_mode_test.go。
  • webtest 的 i18n-navigation、issue-conversation 共 8 项通过。
  • 写这条评论时 CI 12 项通过、3 项进行中。

和 #1286 合入顺序的提醒不变:本 PR 的「不使用 SOP」等文案,在 #1286 再合 main 时要一起改成 LOOP。

@crispinhu27 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复审 f9f1e1fd(base main 2e5176f1),对比上一轮 b4761282 上 REQUEST_CHANGES 提的两个问题。

历史问题(复测细节见原线程)

  • [P2] 英文界面中,不使用 SOP 的需求文案没有翻译:FIXED。用无头 Chromium 在英文界面实测,分别对照了 head 和 b4761282。
  • [P3] sopMode:sop 设回后,定时 SOP 仍然不认领:FIXED。通过 /mcp issues_save 和定时任务的 run 实测,对照了 head、b4761282 和 base。

审查范围

  • 完整 diff,以及增量 b4761282..f9f1e1fd(repo/issues.go、i18n-en.js、openapi、测试)。
  • 核对了增量逻辑会不会误改以下情况:用户显式设的 ignored、带 SOP 需求的普通编辑、done 状态的需求、网页端绑定 SOP 的路径。实测这几种情况结果都正确。

验证(隔离的非特权用户、MariaDB、合成数据)

  • go build ./... 通过。
  • go test ./internal/{httpapi,mcpserver,repo,domain}:head 和 base 的失败集合相同(都是 httpapi 里的 15 项,原因是环境缺 bwrap 等依赖),没有新增失败。
  • webtest:head 309/309 通过,base 307/307 通过。
  • chatbot vitest:534/534 通过。
  • 新增测试单独运行全部通过。
  • CI:16/16 通过。

未覆盖:没有接真实模型做端到端测试;契约部分用 /mcp 直接调用工具来验证。

以上结论只针对本次的审查范围和验证结果,不代表代码绝对没有缺陷。

@Robert0622
Robert0622 merged commit e85d5e8 into Tencent:main Nov 26, 2026
16 checks passed
Robert0622 pushed a commit that referenced this pull request Nov 26, 2026
Resolve the sandbox_manager.go conflict with #1412: removeMatching keeps
its per-caller remove func, and both callers now delete through
RemoveWorkspaceTree. DestroyRun retires a checkout and then removes it,
and ReclaimExcept prunes orphans and retired copies; with os.RemoveAll a
read-only Go module cache left .loopforge-reclaimed-* directories behind.
Add regression tests for both paths.

The second sop-mode test from #1411 builds its manager on sandboxRoot(t)
like the rest of the file; this branch dropped the path/filepath import.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Robert0622 pushed a commit that referenced this pull request Nov 26, 2026
The merge of main kept the product copy for requirements without a LOOP,
but comments, test fixtures and failure messages around #1411's sopMode
still said SOP. Use the LOOP terminology there too; protocol values such as
sopMode none/sop and Go identifiers keep their names.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Robert0622 added a commit that referenced this pull request Nov 26, 2026
* feat: rename SOP to LOOP across LoopForge

* Apply LOOP terminology to copy merged from main and fix CHANGELOG anchor

Rename the user-visible SOP copy that main added for the enterprise IM
channels, observability dashboard and docs, following the same rules as
the rest of this branch (routes, JSON fields and identifiers unchanged).

Keep accepting the old wording where it can still arrive: notification
cards skip both LOOP and SOP header lines, chat drafts recognise both
(LOOP:…) and (SOP:…) notes, and the clarification command accepts
"保存并启动 LOOP" as well as "保存并启动 SOP".

Point the CHANGELOG link at #updating-existing-public-loops.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* Renumber the LOOP terminology migration to 043 and re-apply the rename to main's new copy

main added 042_project_credentials.sql and 042_skill_bodies_to_files.sql,
so the terminology migration becomes 043_loop_terminology.sql; the
installer, its test and the deployment guide follow.

Rename the user-visible SOP copy from #1264, #1294, #1295, #1296 and
#1298 (project roles, join requests, project credentials, workspace
preview messages) with the same rules as the rest of the branch.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* Restore the legacy (SOP:…) draft note check clobbered by the rename sweep

Co-Authored-By: Claude Code <noreply@anthropic.com>

* fix(chatbot): recognize proposal receipts saved before the LOOP rename

Conversations saved before the rename still hold the SOP wording of the
declined and timed-out proposal receipts. The chat matched only the new
LOOP text, so these internal resume turns showed up as user messages.
Accept both wordings.

Rooms also parse LOOP「…」 authors with the correct length and keep
recognizing legacy SOP「…」 authors.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* Apply LOOP terminology to the chat attribution copy merged from main

#1300 added a clarification test that expects the bot reply "已启动 SOP" and a comment that says "a SOP started". This branch already renders "已启动 LOOP", so the test failed after merging main.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* Resume paused children marked before the LOOP rename

The child-resume marker merged from #1327 now reads "等待继续子 LOOP". A parent paused on a build that stored "等待继续子 SOP" still resumes its child after admission.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* test: cover run evaluation before approval

* test: exercise five previously uncovered platform routes

* fix: translate LOOP evaluation and runner allocation messages

* fix(engine): name LOOP in the remaining auto-assign errors

The default-executor fallback label and the no-compatible-sandbox
error still said SOP after the main merge.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* fix: name LOOP in errors merged from main

Four user-visible errors that arrived with main (#1342 work branch naming,
#1343/#1348 runner auto-assign, #1301 child artifacts) still said SOP.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* fix(migrations): preserve customized LOOP template copy

* test(install): copy migration 043 into the live install fixture

install-schema-extensions.sh now replays migrations/043_loop_terminology.sql,
but test-install-live.sh only copied 001/033/038/042 into its trimmed
fixture, so every live install identity stopped at the first install with
'cat: migrations/043_loop_terminology.sql: No such file or directory'.

Copy 043 as well, and add a test-install.py check that every migration the
installer replays is in the live fixture's copy list, so CI catches the
next one.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* Name LOOP in comments and test copy merged from main

The merge of main kept the product copy for requirements without a LOOP,
but comments, test fixtures and failure messages around #1411's sopMode
still said SOP. Use the LOOP terminology there too; protocol values such as
sopMode none/sop and Go identifiers keep their names.

Co-Authored-By: Claude Code <noreply@anthropic.com>

---------

Co-authored-by: roberttwang <roberttwang@tencent.com>
Co-authored-by: roberttwang <u_dc6754cd1ee5@users.noreply.local>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Codex <codex@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants