From 5415a4bc5ea1840d422e1f272824fc8bd6207190 Mon Sep 17 00:00:00 2001 From: roberttwang Date: Tue, 17 Nov 2026 13:27:08 +0000 Subject: [PATCH 1/4] =?UTF-8?q?feat(installer):=20replay=20the=20SOP=20?= =?UTF-8?q?=E3=80=8C=E5=8F=91=E8=B5=B7=20MR=E3=80=8D=20migration=20on=20in?= =?UTF-8?q?stall=20and=20pull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit migrations/033_generic_sop_mr_node.sql was not part of scripts/install-schema-extensions.sh, so an existing installation only gained the 「发起 MR」 node when an operator ran it by hand. ./start.sh pull upgraded the image but kept the seven-node templates, and every run still succeeded with its work branch unpushed. The installer and ./start.sh pull now replay it together with 001 and 031. The script is idempotent and rewrites a template only while its node graph and 交付汇总 position are the shipped original, so operator-edited templates and project copies are untouched. Behaviour change: after the upgrade a run of the backend, frontend and defect-fix SOPs needs a Git credential with push access; without one it stops at 发起 MR for a person instead of succeeding. --- CHANGELOG.md | 2 +- docs/deployment.md | 8 ++++---- migrations/033_generic_sop_mr_node.sql | 15 +++++++++------ scripts/install-schema-extensions.sh | 10 +++++++--- scripts/test-install-live.sh | 2 +- scripts/test-install.py | 5 ++++- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de2189a45..1cceaab88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ Platform releases use `vX.Y.Z` tags and publish `ghcr.io/tencent/loopforge`. Loo - 「创建并去对话澄清」 sends again. The first message of the new conversation @-mentions the requirement, and the turn links that issue to the conversation while starting; the start then compared the conversation it read before linking and refused its own link with 「关联需求已更新,请重新发送」 every time. The same happened to any later message that @-mentioned an issue in a conversation without a linked issue. A turn now accepts the issue it linked itself; a conversation rebound to another issue while the turn starts is still refused. - A conversation's 子 Agent shows the model it ran on: its row in the artifacts list reads 「已完成 · 模型 …」, the header of an opened subagent names the model next to its status, and each dispatch in 会话过程 notes 「模型 · …」 under the task it was given. The model is the one the subagent reports running on: its first line in the CLI stream is saved as an `agentModel` activity event under the dispatch, so an alias such as `lite` shows the model it resolved to. Until it reports, and for replies saved before this change, the panel falls back to the model the Agent call named (the `model` argument), else the model of the reply that dispatched it, which the subagent inherits; a dispatch still running uses the model the running reply was sent with. Activity events of an Agent call carry the new `model` field only when the call named one. -- The built-in backend, frontend and defect-fix SOPs gain a 「发起 MR」 node between 人工验收 and 交付汇总 (#717). It commits the work branch, pushes it and opens an MR/PR against the run's target branch, then records the link, branches and commit SHA in `mr-body.md`. Its command gate checks every writable repository of the run: one with commits beyond the target branch fails while it has uncommitted changes, while its checkout is off the run's work branch, or until `git ls-remote origin` shows that work branch at HEAD. A repository the run left unchanged is skipped. A second gate of the new mode `mr` has the engine look the MR up on the host with the same lookup delivery tracking uses (GitHub and Gongfeng): every writable repository whose work branch on origin carries commits beyond the target branch needs an MR from that work branch into that target branch that carries the pushed tip: an open one whose head is the tip (or whose host reports no head), or a merged one whose head is the tip. An agent that reports pass without opening an MR, opens it against the wrong branch, or leaves only an earlier merged MR on a reused work branch does not reach 交付汇总. The lookup runs as the run: on GitHub with the Git token the run pushed with (its responsible user's), falling back to the Owner of the run's own project; on Gongfeng through the run project's MCP as the responsible user. A repository bound to several projects is no longer checked as whichever project bound it first, and a failed lookup names the identity it used. A host the platform cannot query (an SSH repository, a failed lookup) goes straight to a person. `mr` gates take no commands, and the role editor keeps them when a role is saved. The gates retry once with their feedback and then wait for a person, so a run no longer succeeds with every source change left in a workspace that is reclaimed right after success. Run-scoped commands now get `AGENTFLOW_WORK_BRANCHES` (one `dirwork branchtarget branch` line per writable repository) and repository-scoped commands get `AGENTFLOW_WORK_BRANCH` and `AGENTFLOW_BASE_BRANCH`; the target branch is the one frozen into the run, including a requirement's release branch and a scheduled SOP's integration branch. 交付汇总 no longer pushes or opens a PR itself. Runs without a bound repository still deliver from the task workspace. New installs get the new templates from the seed. Existing installs keep their templates until an operator runs `migrations/033_generic_sop_mr_node.sql` by hand (see docs/deployment.md); it rewrites a template only while its node graph and 交付汇总 position are the shipped original and its 交付汇总 prompt only while unedited. SOPs already adopted into a project are copies and keep their old graph. The product SOP delivers documents only and is unchanged. +- The built-in backend, frontend and defect-fix SOPs gain a 「发起 MR」 node between 人工验收 and 交付汇总 (#717). It commits the work branch, pushes it and opens an MR/PR against the run's target branch, then records the link, branches and commit SHA in `mr-body.md`. Its command gate checks every writable repository of the run: one with commits beyond the target branch fails while it has uncommitted changes, while its checkout is off the run's work branch, or until `git ls-remote origin` shows that work branch at HEAD. A repository the run left unchanged is skipped. A second gate of the new mode `mr` has the engine look the MR up on the host with the same lookup delivery tracking uses (GitHub and Gongfeng): every writable repository whose work branch on origin carries commits beyond the target branch needs an MR from that work branch into that target branch that carries the pushed tip: an open one whose head is the tip (or whose host reports no head), or a merged one whose head is the tip. An agent that reports pass without opening an MR, opens it against the wrong branch, or leaves only an earlier merged MR on a reused work branch does not reach 交付汇总. The lookup runs as the run: on GitHub with the Git token the run pushed with (its responsible user's), falling back to the Owner of the run's own project; on Gongfeng through the run project's MCP as the responsible user. A repository bound to several projects is no longer checked as whichever project bound it first, and a failed lookup names the identity it used. A host the platform cannot query (an SSH repository, a failed lookup) goes straight to a person. `mr` gates take no commands, and the role editor keeps them when a role is saved. The gates retry once with their feedback and then wait for a person, so a run no longer succeeds with every source change left in a workspace that is reclaimed right after success. Run-scoped commands now get `AGENTFLOW_WORK_BRANCHES` (one `dirwork branchtarget branch` line per writable repository) and repository-scoped commands get `AGENTFLOW_WORK_BRANCH` and `AGENTFLOW_BASE_BRANCH`; the target branch is the one frozen into the run, including a requirement's release branch and a scheduled SOP's integration branch. 交付汇总 no longer pushes or opens a PR itself. Runs without a bound repository still deliver from the task workspace. New installs get the new templates from the seed; existing installs get them from `migrations/033_generic_sop_mr_node.sql`, which `scripts/install-schema-extensions.sh` replays on install and on `./start.sh pull`, so upgrading needs no manual step (see docs/deployment.md); it rewrites a template only while its node graph and 交付汇总 position are the shipped original and its 交付汇总 prompt only while unedited. SOPs already adopted into a project are copies and keep their old graph. The product SOP delivers documents only and is unchanged. - A conversation reply that is still running keeps running through a slow heartbeat. A poll, the conversation list, a follow-up message or a steer used to record it as interrupted after 45 seconds without a stored heartbeat; the process then cancelled the CLI and the next message failed with 「工作区正在使用或保存,请稍后重试」 for up to 15 minutes. Reads of a turn this process executes no longer reap it, and an unchanged heartbeat on MySQL no longer counts as a lost turn. On MySQL a heartbeat's age is measured on the database clock that stamped it, so skew between an API host and MySQL neither reaps a live turn nor keeps a dead one; whether a lease holder stopped renewing is likewise judged from `run_workspace_checkpoints.lease_renewed_at`, stamped on the database clock, not from another replica's `lease_until`. When a turn whose process died is reaped, the workspace lease it recorded is released if nothing renewed it for 45 seconds, so the next message starts at once; a lease another turn took, one still renewed on another replica, and a background save are kept. `migrations/032_assistant_generation_workspace_lease.sql` adds the three columns by hand; startup AutoMigrate adds them too. - The platform image bundles DeepSeek Harness `@deepseek-ai/dsh@0.2.2-rc.1` next to Codex and CodeBuddy, so a DeepSeek key works in conversations and SOP roles without an install step. 0.3.8 had no `dsh` and answered a DeepSeek Harness chat with “AI 助手生成失败,请稍后重试”. The image download grows by about 180 MB. An installation without the image installs the same pinned version from the conversation: every dsh release is a prerelease requiring Node 24.9, and npm on Node 22 found no version for the bare package name. diff --git a/docs/deployment.md b/docs/deployment.md index 15a9c4a0d..0f1115e98 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -137,7 +137,7 @@ Configure provider credentials in the platform UI, not the host's global CLI con ## Observability schema -After the base tables have been created, run `bash scripts/install-schema-extensions.sh` for the Compose database. It installs absent `run_telemetry.adapter` and `run_logs.level` columns and their indexes from upstream migration `001_run_obs_generated_columns.sql`, then replays the `INSERT IGNORE` starter catalog. Both steps can be repeated without touching existing rows. The installer runs it before printing the address, and `./start.sh pull` runs it again after recreating containers, so an older data volume upgraded to a newer image picks up the columns the new code reads. Application startup does not run data migrations. +After the base tables have been created, run `bash scripts/install-schema-extensions.sh` for the Compose database. It installs absent `run_telemetry.adapter` and `run_logs.level` columns and their indexes from upstream migration `001_run_obs_generated_columns.sql`, then replays the `INSERT IGNORE` starter catalog and the built-in catalog rewrites from `031_generic_backend_openssh.sql` and `033_generic_sop_mr_node.sql`. Every step can be repeated without touching existing rows. The installer runs it before printing the address, and `./start.sh pull` runs it again after recreating containers, so an older data volume upgraded to a newer image picks up the columns the new code reads and the built-in SOP graphs the new code ships. Application startup does not run data migrations. For an external MySQL deployment, review that migration and check column existence before applying its corresponding statements. Stored generated columns can rebuild large existing tables; schedule the operation accordingly. @@ -147,7 +147,7 @@ For an external MySQL deployment, review that migration and check column existen | Kind | Example | What an operator does | | --- | --- | --- | -| Already applied by the installer and `./start.sh pull` | `001_run_obs_generated_columns.sql`, `migrations/seed/*.sql`, `031_generic_backend_openssh.sql` | Nothing; the script above covers it | +| Already applied by the installer and `./start.sh pull` | `001_run_obs_generated_columns.sql`, `migrations/seed/*.sql`, `031_generic_backend_openssh.sql`, `033_generic_sop_mr_node.sql` | Nothing; the script above covers it | | Must run once when upgrading | `009_bot_interactions_utf8mb4.sql` (`CONVERT TO` an existing table), new tables and columns added by hand | Run it on the database after reviewing prerequisites | | Backfills and one-time rewrites of existing rows | `016_public_optional_repositories.sql`, `021_assistant_session_sources.sql` | Run it if the history matters; skipping it changes no schema but leaves old rows unconverted | @@ -161,13 +161,13 @@ docker compose exec -T mysql sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" mysql -u loopfor This repeatable SQL changes only instruction fields that still match the original public seed. It preserves operator edits and project copies. New installations already receive these instructions from the public catalog seed; application startup does not migrate data. -To add the 「发起 MR」 node to the built-in backend, frontend and defect-fix SOPs of an existing installation, apply `033_generic_sop_mr_node.sql` the same way: +The 「发起 MR」 node of the built-in backend, frontend and defect-fix SOPs comes with `033_generic_sop_mr_node.sql`, which `scripts/install-schema-extensions.sh` replays on install and on `./start.sh pull`, so an upgrade needs no manual step. To apply it to an installation already running a newer image (or after editing the graph back to the shipped one), run it by hand: ```bash docker compose exec -T mysql sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" mysql -u loopforge loopforge' < migrations/033_generic_sop_mr_node.sql ``` -After it, a run of these SOPs commits and pushes its work branch and opens an MR/PR before 交付汇总, so the Git credentials of the run's responsible user need push access. The installer and `./start.sh pull` do not run it. It rewrites a template only while its node graph and 交付汇总 position are the shipped original, and the 交付汇总 prompt only while unedited; it is safe to repeat. Project SOPs adopted from these templates are copies and are not changed. +After it, a run of these SOPs commits and pushes its work branch and opens an MR/PR before 交付汇总, so the Git credentials of the run's responsible user need push access: without them the run stops at 发起 MR for a person instead of succeeding. It rewrites a template only while its node graph and 交付汇总 position are the shipped original, and the 交付汇总 prompt only while unedited; it is safe to repeat. Project SOPs adopted from these templates are copies and are not changed. ## GitHub credentials diff --git a/migrations/033_generic_sop_mr_node.sql b/migrations/033_generic_sop_mr_node.sql index f11615d1c..042b0b496 100644 --- a/migrations/033_generic_sop_mr_node.sql +++ b/migrations/033_generic_sop_mr_node.sql @@ -13,12 +13,15 @@ -- every pushed work branch with new commits needs a non-closed MR into the -- run's target branch, and a host that cannot be queried goes to a person. -- --- New installs get these templates from the seed. This script changes the --- behaviour of existing SOPs, so it is not run on install or ./start.sh pull; --- an operator runs it by hand. Only templates whose node graph and deliver --- position are still the shipped original are rewritten; the deliver prompt is --- replaced only when unedited. Project SOPs already adopted from these --- templates are copies and are not touched. +-- New installs get these templates from the seed; existing installs get them +-- from this script, which scripts/install-schema-extensions.sh replays on +-- install and on ./start.sh pull, so ./start.sh pull upgrades the graph +-- without a manual step. Only templates whose node graph and deliver position +-- are still the shipped original are rewritten; the deliver prompt is replaced +-- only when unedited. Project SOPs already adopted from these templates are +-- copies and are not touched. After it, a run of these SOPs needs a Git +-- credential with push access when a repository is bound: without one it stops +-- at 发起 MR for a person instead of succeeding. SET NAMES utf8mb4; START TRANSACTION; UPDATE generic_templates diff --git a/scripts/install-schema-extensions.sh b/scripts/install-schema-extensions.sh index 521f06277..f44822506 100755 --- a/scripts/install-schema-extensions.sh +++ b/scripts/install-schema-extensions.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash # Bring the Compose database up to what this release reads but gorm # AutoMigrate cannot create: the generated columns from migration 001, the -# INSERT IGNORE starter catalog and the built-in Dockerfile update from -# migration 031. All steps are safe to repeat, so the installer and +# INSERT IGNORE starter catalog, the built-in Dockerfile update from +# migration 031 and the 「发起 MR」 node of the built-in code delivery SOPs from +# migration 033. All steps are safe to repeat, so the installer and # `./start.sh pull` run it after the platform is healthy. set -euo pipefail cd "$(dirname "$0")/.." @@ -13,4 +14,7 @@ if ! bash scripts/install-observability-schema.sh; then printf ' Run migrations/001_run_obs_generated_columns.sql against the LoopForge database, then retry.\n' >&2 exit 1 fi -cat migrations/seed/*.sql migrations/031_generic_backend_openssh.sql | docker_access compose exec -T mysql sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" mysql -u loopforge loopforge' +cat migrations/seed/*.sql \ + migrations/031_generic_backend_openssh.sql \ + migrations/033_generic_sop_mr_node.sql \ + | docker_access compose exec -T mysql sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" mysql -u loopforge loopforge' diff --git a/scripts/test-install-live.sh b/scripts/test-install-live.sh index 4758b748f..12d7d2975 100644 --- a/scripts/test-install-live.sh +++ b/scripts/test-install-live.sh @@ -22,7 +22,7 @@ for actor in "${actors[@]}"; do fixture="$task_dir/$actor" mkdir -p "$fixture/scripts" "$fixture/migrations/seed" "$fixture/user-home" cp scripts/{install.sh,configure.sh,docker-access.sh,ghcr-mirror.sh,install-address.py,install-compose.py,install-observability-schema.sh} "$fixture/scripts/" - cp migrations/001_run_obs_generated_columns.sql migrations/031_generic_backend_openssh.sql "$fixture/migrations/" + cp migrations/001_run_obs_generated_columns.sql migrations/031_generic_backend_openssh.sql migrations/033_generic_sop_mr_node.sql "$fixture/migrations/" cp migrations/seed/*.sql "$fixture/migrations/seed/" cp compose.yaml "$fixture/" read -r http_port mysql_port < <(python3 - <<'PY' diff --git a/scripts/test-install.py b/scripts/test-install.py index facc5f892..c1ce0b19b 100644 --- a/scripts/test-install.py +++ b/scripts/test-install.py @@ -35,7 +35,7 @@ def setUp(self): for name in ('install.sh', 'configure.sh', 'docker-access.sh', 'ghcr-mirror.sh', 'install-address.py', 'install-compose.py', 'install-observability-schema.sh', 'install-schema-extensions.sh'): shutil.copyfile(ROOT / 'scripts' / name, self.root / 'scripts' / name) shutil.copyfile(ROOT / 'start.sh', self.root / 'start.sh') - for name in ('001_run_obs_generated_columns.sql', '031_generic_backend_openssh.sql'): + for name in ('001_run_obs_generated_columns.sql', '031_generic_backend_openssh.sql', '033_generic_sop_mr_node.sql'): (self.root / 'migrations' / name).write_text((ROOT / 'migrations' / name).read_text()) (self.root / 'migrations/seed/001_test.sql').write_text('INSERT IGNORE INTO agents (id) VALUES (1);\n') (self.root / 'mock').mkdir() @@ -204,6 +204,9 @@ def test_start_pull_reapplies_schema_extensions_after_containers_are_up(self): self.assertIn('ALTER TABLE run_telemetry', sql) self.assertIn('ALTER TABLE run_logs', sql) self.assertIn('INSERT IGNORE', sql) + # The 「发起 MR」 node of the code delivery SOPs is replayed too, instead + # of waiting for an operator to run migration 033 by hand. + self.assertIn('JSON_ARRAY_APPEND', sql) # Recreated containers come first; the old volume then gets the columns. self.assertLess(log.index('up -d --no-build --wait'), log.index('exec -T mysql')) From 4d22019e0e25448cdc3bfb4cec98ed8c707015b3 Mon Sep 17 00:00:00 2001 From: Robert0622 <53806540+Robert0622@users.noreply.github.com> Date: Fri, 20 Nov 2026 21:02:42 +0800 Subject: [PATCH 2/4] Migrate only untouched delivery graphs and exercise the installer fixture --- migrations/033_generic_sop_mr_node.sql | 45 +++++++++++++++----------- scripts/test-install-live.sh | 2 +- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/migrations/033_generic_sop_mr_node.sql b/migrations/033_generic_sop_mr_node.sql index 042b0b496..6e0a406f4 100644 --- a/migrations/033_generic_sop_mr_node.sql +++ b/migrations/033_generic_sop_mr_node.sql @@ -23,6 +23,24 @@ -- credential with push access when a repository is bound: without one it stops -- at 发起 MR for a person instead of succeeding. SET NAMES utf8mb4; +-- The three original graphs differ only in the template prefix of their agent IDs. +SET @lf_033_nodes = '[ + {"id": "clarify", "name": "需求定型", "type": "agent", "agentId": "__template__-clarify", "maxAttempts": 2, "position": {"x": 100, "y": 150}, "artifactOutputs": [{"name": "clarify", "path": "requirement.md", "mediaType": "text/markdown", "required": true}]}, + {"id": "design", "name": "方案设计", "type": "agent", "agentId": "__template__-design", "maxAttempts": 2, "position": {"x": 345, "y": 150}, "artifactOutputs": [{"name": "design", "path": "design.md", "mediaType": "text/markdown", "required": true}]}, + {"id": "implement", "name": "开发实现", "type": "agent", "agentId": "__template__-implement", "maxAttempts": 2, "position": {"x": 590, "y": 150}, "artifactOutputs": [{"name": "implement", "path": "implementation.md", "mediaType": "text/markdown", "required": true}]}, + {"id": "review", "name": "独立评审", "type": "agent", "agentId": "__template__-review", "maxAttempts": 2, "position": {"x": 835, "y": 150}, "artifactOutputs": [{"name": "review", "path": "review.md", "mediaType": "text/markdown", "required": true}]}, + {"id": "test", "name": "测试验证", "type": "agent", "agentId": "__template__-test", "maxAttempts": 2, "position": {"x": 1080, "y": 150}, "artifactOutputs": [{"name": "test", "path": "test-report.md", "mediaType": "text/markdown", "required": true}]}, + {"id": "accept", "name": "人工验收", "type": "approval", "maxAttempts": 1, "rejectTo": "implement", "position": {"x": 1325, "y": 150}}, + {"id": "deliver", "name": "交付汇总", "type": "agent", "agentId": "__template__-deliver", "maxAttempts": 2, "position": {"x": 1570, "y": 150}, "artifactOutputs": [{"name": "deliver", "path": "delivery.md", "mediaType": "text/markdown", "required": true}]} +]'; +SET @lf_033_edges = '[ + {"id": "e-0", "source": "clarify", "target": "design", "when": "success"}, + {"id": "e-1", "source": "design", "target": "implement", "when": "success"}, + {"id": "e-2", "source": "implement", "target": "review", "when": "success"}, + {"id": "e-3", "source": "review", "target": "test", "when": "success"}, + {"id": "e-4", "source": "test", "target": "accept", "when": "success"}, + {"id": "e-5", "source": "accept", "target": "deliver", "when": "success"} +]'; START TRANSACTION; UPDATE generic_templates SET payload = JSON_ARRAY_APPEND( @@ -31,16 +49,13 @@ SET payload = JSON_ARRAY_APPEND( '$.Workflow.edges', CAST('{"id": "e-6", "source": "mr", "target": "deliver", "when": "success"}' AS JSON), '$.Agents', CAST('{"version": 1, "updatedAt": "2026-11-16T00:00:00Z", "id": "generic-backend-delivery-mr", "name": "发起 MR", "executorId": "codebuddy", "rules": ["public-engineering"], "skills": [], "mcpServers": [], "prompt": "工作领域:后端服务、数据与 API。人工验收已通过,本节点把本轮代码改动提交到工作分支、推送并发起 MR/PR,不再修改业务逻辑。\\n\\n1. 未绑定代码仓库时不推送、不创建 MR/PR:在 mr-body.md 写明「未绑定代码仓库,源码保留在任务工作区」并列出交付文件,然后提交 pass。\\n2. 已绑定仓库时逐个处理每个仓库检出目录,本轮没有改动的仓库跳过,不创建空 MR/PR:确认当前在本轮工作分支上,不得在主分支提交,也不得切换或新建分支;检查 git status 与 diff,只提交本任务相关的源码改动,不提交 .agentflow、依赖目录、构建产物和 SOP 阶段文档;用概括本次改动的提交信息 commit,再 git push -u origin 当前工作分支。平台已注入 Git 凭据,不得打印、回显或写入任何令牌。\\n3. 以仓库上下文中的目标分支为目标创建 MR/PR:GitHub 仓库优先用已配置的 GitHub MCP,没有时用 curl 调 GitHub API,令牌取 $AGENTFLOW_GIT_TOKEN;其它托管平台用已配置的对应 MCP。本轮工作分支已有指向同一目标分支的 MR/PR 时更新它,不重复创建。\\n4. 标题概括本次改动;描述写需求摘要、改动要点、测试结果(依据 test-report.md)和已知限制。不得合并 MR/PR,不得推送主分支或强推。\\n5. 把每个仓库的 MR/PR 链接、源分支、目标分支和提交 SHA 写到 mr-body.md。\\n6. 推送或创建 MR/PR 失败(缺少凭据、无权限、网络错误等)时不得提交 pass:在 mr-body.md 记录失败原因,提交 human,并在 actionRequired 写明需要人工处理什么,例如配置 Git Token 后重试,或到托管平台手动创建 MR。\\n\\nMR 约束:{{existingMR}}\\n\\n完成本节点约定的工作并交付产物。\\n\\n### 输入\\n\\n- 任务需求:{{input}}\\n- 仓库上下文:{{repository}}", "loop": {"enabled": true, "maxIterations": 2, "exitCondition": "all_gates_pass", "onExhausted": "human"}, "verification": [{"id": "mr-pushed", "name": "改动已提交并推送", "mode": "command", "stage": "after_execution", "commands": ["fail=0\\ntab=\\"$(printf ''\\\\t'')\\"\\nwhile IFS=\\"$tab\\" read -r d work base; do\\n [ -n \\"$d\\" ] || continue\\n dirty=\\"$(git -C \\"$d\\" status --porcelain --untracked-files=all -- . \\":(exclude).agentflow\\" \\":(exclude,glob)**/node_modules/**\\")\\" || { printf \\"%s 不是可用的 Git 检出目录\\\\n\\" \\"$d\\"; fail=1; continue; }\\n if [ -n \\"$dirty\\" ]; then printf \\"%s 有未提交的改动:\\\\n%s\\\\n\\" \\"$d\\" \\"$dirty\\"; fail=1; continue; fi\\n refs=HEAD\\n if git -C \\"$d\\" rev-parse -q --verify \\"refs/heads/$work\\" >/dev/null; then refs=\\"HEAD refs/heads/$work\\"; fi\\n ahead=\\"$(git -C \\"$d\\" rev-list --count $refs --not \\"refs/remotes/origin/$base\\")\\" || { printf \\"%s 找不到目标分支 origin/%s\\\\n\\" \\"$d\\" \\"$base\\"; fail=1; continue; }\\n [ \\"$ahead\\" != 0 ] || continue\\n branch=\\"$(git -C \\"$d\\" branch --show-current)\\"\\n if [ \\"$branch\\" != \\"$work\\" ]; then printf \\"%s 当前在 %s,不在本轮工作分支 %s\\\\n\\" \\"$d\\" \\"${branch:-分离的 HEAD}\\" \\"$work\\"; fail=1; continue; fi\\n head=\\"$(git -C \\"$d\\" rev-parse HEAD)\\"\\n pushed=\\"$(git -C \\"$d\\" ls-remote origin \\"refs/heads/$work\\")\\" || { printf \\"%s 无法读取远端 origin\\\\n\\" \\"$d\\"; fail=1; continue; }\\n if [ \\"${pushed%%\\"$tab\\"*}\\" != \\"$head\\" ]; then printf \\"%s 的工作分支 %s 在 origin 上不是 %s,本轮提交还没推送\\\\n\\" \\"$d\\" \\"$work\\" \\"$head\\"; fail=1; fi\\ndone </dev/null; then refs=\\"HEAD refs/heads/$work\\"; fi\\n ahead=\\"$(git -C \\"$d\\" rev-list --count $refs --not \\"refs/remotes/origin/$base\\")\\" || { printf \\"%s 找不到目标分支 origin/%s\\\\n\\" \\"$d\\" \\"$base\\"; fail=1; continue; }\\n [ \\"$ahead\\" != 0 ] || continue\\n branch=\\"$(git -C \\"$d\\" branch --show-current)\\"\\n if [ \\"$branch\\" != \\"$work\\" ]; then printf \\"%s 当前在 %s,不在本轮工作分支 %s\\\\n\\" \\"$d\\" \\"${branch:-分离的 HEAD}\\" \\"$work\\"; fail=1; continue; fi\\n head=\\"$(git -C \\"$d\\" rev-parse HEAD)\\"\\n pushed=\\"$(git -C \\"$d\\" ls-remote origin \\"refs/heads/$work\\")\\" || { printf \\"%s 无法读取远端 origin\\\\n\\" \\"$d\\"; fail=1; continue; }\\n if [ \\"${pushed%%\\"$tab\\"*}\\" != \\"$head\\" ]; then printf \\"%s 的工作分支 %s 在 origin 上不是 %s,本轮提交还没推送\\\\n\\" \\"$d\\" \\"$work\\" \\"$head\\"; fail=1; fi\\ndone </dev/null; then refs=\\"HEAD refs/heads/$work\\"; fi\\n ahead=\\"$(git -C \\"$d\\" rev-list --count $refs --not \\"refs/remotes/origin/$base\\")\\" || { printf \\"%s 找不到目标分支 origin/%s\\\\n\\" \\"$d\\" \\"$base\\"; fail=1; continue; }\\n [ \\"$ahead\\" != 0 ] || continue\\n branch=\\"$(git -C \\"$d\\" branch --show-current)\\"\\n if [ \\"$branch\\" != \\"$work\\" ]; then printf \\"%s 当前在 %s,不在本轮工作分支 %s\\\\n\\" \\"$d\\" \\"${branch:-分离的 HEAD}\\" \\"$work\\"; fail=1; continue; fi\\n head=\\"$(git -C \\"$d\\" rev-parse HEAD)\\"\\n pushed=\\"$(git -C \\"$d\\" ls-remote origin \\"refs/heads/$work\\")\\" || { printf \\"%s 无法读取远端 origin\\\\n\\" \\"$d\\"; fail=1; continue; }\\n if [ \\"${pushed%%\\"$tab\\"*}\\" != \\"$head\\" ]; then printf \\"%s 的工作分支 %s 在 origin 上不是 %s,本轮提交还没推送\\\\n\\" \\"$d\\" \\"$work\\" \\"$head\\"; fail=1; fi\\ndone < Date: Fri, 20 Nov 2026 21:09:29 +0800 Subject: [PATCH 3/4] Align the release upgrade note with automatic migration 033 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c3a7bfb5..c5bbbac10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,7 @@ Platform releases use `vX.Y.Z` tags and publish `ghcr.io/tencent/loopforge`. Loo Repositories saved earlier with a token in `cloneUrl` keep cloning until they are saved again. Saving one from the studio stores the URL without the token, so first put the Git token in 个人配置, then save the repository. Until then the token also lands in each workspace's `.git/config`, where the agent can read it, so re-save such repositories soon after upgrading. -Startup AutoMigrate creates the tables and columns of migrations `028` to `035`, and the installer and `./start.sh pull` apply `031`. `030` only aligns the stored `shared` flag of `generic-docker` with what the application already reads and is optional. To add the 「发起 MR」 node to the built-in SOPs of an existing installation, run `migrations/033_generic_sop_mr_node.sql` by hand (see `docs/deployment.md`). Rotate any agent CLI key that ran an SOP role before this release. +Startup AutoMigrate creates the tables and columns of migrations `028` to `035`, and the installer and `./start.sh pull` apply `031` and `033`. `030` only aligns the stored `shared` flag of `generic-docker` with what the application already reads and is optional. The Compose upgrade adds the 「发起 MR」 node to unmodified built-in delivery SOPs. Manual deployments can apply `migrations/033_generic_sop_mr_node.sql` as described in `docs/deployment.md`. Rotate any agent CLI key that ran an SOP role before this release. ## 0.3.8 — header sign-in hardening and a GHCR mirror option From 3d8908c5e6ca38fe9adc7e127af68dc82877f785 Mon Sep 17 00:00:00 2001 From: Robert0622 <53806540+Robert0622@users.noreply.github.com> Date: Fri, 20 Nov 2026 21:12:12 +0800 Subject: [PATCH 4/4] Use the test store when verifying conversation CLI version diagnostics --- internal/httpapi/assistant_diagnostics_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/httpapi/assistant_diagnostics_test.go b/internal/httpapi/assistant_diagnostics_test.go index bb280d843..29cc65f69 100644 --- a/internal/httpapi/assistant_diagnostics_test.go +++ b/internal/httpapi/assistant_diagnostics_test.go @@ -85,7 +85,7 @@ func TestAssistantDiagnosticsReceiveVersionFromConversationProcess(t *testing.T) d := newAssistantDiagnosticsCollector(g) ctx := context.WithValue(context.Background(), assistantDiagnosticsKey{}, d) root := t.TempDir() - h := &assistantHandlers{deps: &deps{}} + h, _ := workbenchFixture(t) session := &AgentToolSession{ChatOwnerID: 1, ChatSessionID: "version-session", RuntimeMode: domain.AssistantModePlatform} req := assistantCLIRequest{Prompt: "test", SessionRoot: root, Execute: h.conversationExecutor(session, root)} if _, _, err := runAssistantCLI(ctx, req, domain.User{ID: 1, CodeBuddyAPIKey: "test-private-key"}, nil); err != nil {