diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afb39dc2b..a5841111d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -145,7 +145,7 @@ jobs: Digest: \`${IMAGE}@${DIGEST}\`. - Where \`ghcr.io\` is slow, set \`MIRROR\` to a registry host that replaces it (for example \`MIRROR=ghcr.nju.edu.cn ./start.sh\`). This trusts that host: the download is tagged as the pinned name. Check it with \`docker image inspect --format '{{index .RepoDigests 0}}' ${IMAGE}:${VERSION}\` and compare the digest after \`@\`. Existing installations: check out \`${TAG}\`, run \`./start.sh\`, and apply the new files under \`migrations/\` listed in [CHANGELOG.md](https://github.com/${GITHUB_REPOSITORY}/blob/${TAG}/CHANGELOG.md). + Where \`ghcr.io\` is slow, set \`MIRROR\` to a registry host that replaces it (for example \`MIRROR=ghcr.nju.edu.cn ./start.sh\`). This trusts that host: the download is tagged as the pinned name. Check it with \`docker image inspect --format '{{index .RepoDigests 0}}' ${IMAGE}:${VERSION}\` and compare the digest after \`@\`. For an existing installation, read the [upgrade instructions in CHANGELOG.md](https://github.com/${GITHUB_REPOSITORY}/blob/${TAG}/CHANGELOG.md) before starting \`${TAG}\`. EOF )" if gh release view "${TAG}" >/dev/null 2>&1; then diff --git a/CHANGELOG.md b/CHANGELOG.md index 48c3c9e59..e6e79c51b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,18 +2,27 @@ Platform releases use `vX.Y.Z` tags and publish `ghcr.io/tencent/loopforge`. LoopForge Local packages use `local-vX.Y.Z` tags and are published by manually running the `release-local` workflow. -## Unreleased - -- On macOS `/bin/bash` 3.2, a missing local image or a failed automatic mirror pull no longer aborts `./start.sh` before the official image pull. -- `./start.sh` and `./start.sh pull` time `ghcr.io` and `ghcr.nju.edu.cn`. Nanjing is used only when the ghcr.io manifest digest was verified and the mirror returned the same digest; the pull is that digest, then tagged back to the name pinned in `compose.yaml`. A missing official digest, a digest mismatch, or a failed mirror pull stays on `ghcr.io`. `MIRROR=ghcr.io` forces the upstream registry; `MIRROR=` still forces that host and does not fall back. Accepting Nanjing, or setting `MIRROR`, trusts that host. The choice is not saved in `.env`. `registry-mirrors` such as `https://docker.nju.edu.cn` only accelerates Docker Hub. - -## 0.4.0 — scheduled task history, an MR node in delivery SOPs and agent CLIs in conversation workspaces +## 0.4.1 — Git and MCP credentials, SOP orchestration and conversation workspaces +- Configure HTTPS Git credentials per host, authorize the IP addresses of self-hosted HTTPS Git servers, and distribute trusted SSH host keys to execution machines. MCP servers, market items and SOP nodes can use configured credentials. +- Use personal conversation workspaces, refresh the repository context on demand and restore a conversation's model and send preferences. Replies report the CLI and version that ran them. Conversation workspaces can recover after their Docker instance stops. +- Runners support Antigravity login and managed updates for six agent CLIs. Installations can use other supported providers for platform model features that previously required CodeBuddy. +- AI scheduled tasks can reference project assets and wait for a triggered SOP to finish. Execution history records token usage and the dashboard shows totals. - The SOP designer's AI orchestrator runs as its own conversation surface (`surface: "sop-designer"` on `POST /api/assistant/chat` and `/api/assistant/generations`) instead of a workbench chat with a long prompt built in the browser. The server now writes the designer system prompt, the project's roles (all of them, no longer the first 40), the canvas snapshot and the SOPs the user named into each turn as data, so the transcript keeps only what the user typed. A designer turn always runs in confirm mode with read-only platform tools only: no workspace, browser or external MCP, and the model can submit nothing but one `workflows_save` draft. Its conversation is private to the author, no longer appears in the workbench history (where it used to show up with the generated prompt as its title) and cannot be continued there; `GET /api/assistant/sessions?surface=sop-designer&workflowId=…` lists it. A second message in the same orchestrator conversation no longer fails with 「共享会话已更新,请重新打开后发送」, which happened because the canvas resent a simplified history of a project-shared session. `workflows_save` drafts from any conversation now warn about duplicate node ids, edges to missing nodes, self loops and cycles before they are saved, and the 「构建静态站点」 node no longer warns that role `af-preview-builder` does not exist. - The orchestrator panel embeds the chatbot (`/chatbot/?surface=sop-designer`) instead of its own hand-written chat. Replies render Markdown with the execution trace, a running turn can be stopped, the turn runs as a background generation, so closing the panel or reloading the page no longer loses it, and reopening a SOP shows its earlier conversation. The CLI and model choice keeps its own memory as before. Each reply's draft shows its warnings and can be put on the canvas again. The canvas and the chat talk only through `agentflow-sop-designer-*` window messages; the canvas still animates nodes and wires as the draft streams in. - Editing a SOP in the orchestrator no longer rewrites the whole graph. On a canvas with steps the model submits `operations` (`add_node`, `update_node`, `remove_node`, `add_edge`, `remove_edge`, `update_workflow`) and the server applies them to the canvas it received, so steps, prompts, scripts, layout and the 「构建静态站点」 node the user did not mention stay exactly as they were. An operation that does not fit the canvas (an unknown node, a duplicate edge, removing a node another step rejects to) goes back to the model with the reason instead of reaching the canvas. The canvas no longer guesses intent from the wording: it no longer matches 「重新…」 or 「去掉预览」 phrases or SOP names in the message; the server lists the project's SOPs and the model reads the one the user means. A draft with a different SOP id replaces the canvas only after the user confirms. - The orchestrator offers the model only roles a SOP save accepts: roles of this project and roles another project shares. A built-in role that belongs to no project used to be offered, and the draft then failed on save with 「角色 … 不属于当前项目且尚未共享」. `workflows_save` drafts from any conversation now warn about such a role before saving. A script longer than 400 characters reaches the model as a marker that says it is omitted, not as an empty string; the model used to report the script as empty and offer to write one, and a marker copied back into a draft is replaced by the canvas's script. - The side browser no longer stays on a blurry frame after a scroll or drag on a page that stops changing. Scrolling switches the screencast to half-size frames and it restarts at full size once input settles, but Chromium does not always re-send a page that is not repainting; the panel now captures the page when no frame arrives within 300 ms. +- The floating page-feedback button is gone. The page-feedback API goes with it. Existing `page_feedbacks` and `page_feedback_images` tables are left in place and are no longer created for new databases. +- On macOS `/bin/bash` 3.2, a missing local image or a failed automatic mirror pull no longer aborts `./start.sh` before the official image pull. +- `./start.sh` and `./start.sh pull` time `ghcr.io` and `ghcr.nju.edu.cn`. Nanjing is used only when the ghcr.io manifest digest was verified and the mirror returned the same digest; the pull is that digest, then tagged back to the name pinned in `compose.yaml`. A missing official digest, a digest mismatch, or a failed mirror pull stays on `ghcr.io`. `MIRROR=ghcr.io` forces the upstream registry; `MIRROR=` still forces that host and does not fall back. Accepting Nanjing, or setting `MIRROR`, trusts that host. The choice is not saved in `.env`. `registry-mirrors` such as `https://docker.nju.edu.cn` only accelerates Docker Hub. + +**Upgrading from v0.4.0.** Stop the old API and workers and keep MySQL running. Manually apply [`036_git_http_credentials.sql`](migrations/036_git_http_credentials.sql) from this release before starting the upgraded platform or running `./start.sh pull`. Verify private repository access after the upgrade. After the rollback window, follow the [credential migration guide](docs/deployment.md#migrating-existing-github-credentials) to apply `037_retire_plain_git_token.sql`. + +The Compose installer and `./start.sh pull` replay `033_generic_sop_mr_node.sql` and then `038_generic_sop_host_credentials.sql` for unmodified built-in delivery SOPs. See [Updating existing public SOPs](docs/deployment.md#updating-existing-public-sops) for manual deployments. Installations that need historical scheduling totals can backfill retained executions with the optional `039_schedule_execution_legacy_stats.sql` after meeting the prerequisites in its header. + +## 0.4.0 — scheduled task history, an MR node in delivery SOPs and agent CLIs in conversation workspaces + - Scheduled tasks keep an execution history with a session mode, keep conversations per job and gain row actions (#958). AI jobs run with the key of the user who saved them and fall back to the shared key (#966). - Requirements can be created directly and clarified in a chat (#965). Settled execution history can be force-deleted (#210). - Conversation workspaces open by sandbox with agent-owned Git (#947), run native agent CLIs on bound execution machines (#494), can be bound to project SOP workspaces through `workspaceRunId` (#974), and install a missing CLI from the failure message (#183). @@ -25,7 +34,7 @@ Platform releases use `vX.Y.Z` tags and publish `ghcr.io/tencent/loopforge`. Loo - Messages queued in a conversation are kept when switching to another conversation and back (#1004). - 「创建并去对话澄清」 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 get them from `migrations/033_generic_sop_mr_node.sql`, which `scripts/install-schema-extensions.sh` replays before `038_generic_sop_host_credentials.sql` on install and `./start.sh pull`. The second migration gives the MR role the current Git credential instructions. The first 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 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. - 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. @@ -42,13 +51,12 @@ Platform releases use `vX.Y.Z` tags and publish `ghcr.io/tencent/loopforge`. Loo - `docs/deployment.md` splits `migrations/` into scripts the installer already covers, scripts an upgrade must run once, and scripts that only backfill existing rows. - The 预览/源码 switch in the chat artifact preview now matches the 30px copy and download buttons beside it (36px on narrow screens) instead of using the 48px page-level tab size. - Requirement clarification, Bot replies, run evals and the SOP preview build list only CodeBuddy models, because they run on CodeBuddy. `POST /api/chat-clarify`, `POST /api/issues/{id}/chat-clarify` and `POST /api/runs/{id}/eval` answer 400 for a model of another CLI (such as `codex:…`) instead of switching it to the CodeBuddy default; a Codex model saved earlier in these pickers falls back to the CLI default (#228). -- The floating page-feedback button is gone. The page-feedback API goes with it. Existing `page_feedbacks` and `page_feedback_images` tables are left in place and are no longer created for new databases. - Repository clone URLs no longer carry credentials. Saving a `cloneUrl` with a user name or password, such as `https://user:token@github.com/acme/app.git`, is rejected with a pointer to the Git token in personal settings; the repositories API, bootstrap payload, run, task and requirement views, and the runner task management list strip credentials from `cloneUrl` and `webUrl` of rows saved earlier; a `webUrl` with credentials is rejected on save; runner clone errors and redacted Git output mask them. `ssh://git@host/...` and `git@host:path` remotes are still accepted. 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`, `033`, and `038` in that order. `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 `033` followed by `038` as described in `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`. `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. ## 0.3.8 — header sign-in hardening and a GHCR mirror option diff --git a/compose.yaml b/compose.yaml index 4710f3d2b..92f655c49 100644 --- a/compose.yaml +++ b/compose.yaml @@ -21,7 +21,7 @@ services: profiles: [platform] # Published release stack: never builds. Bump the pinned tag (here and in # AGENTFLOW_ISOLATED_IMAGE) with each release; source builds use compose.dev.yaml. - image: ${LOOPFORGE_IMAGE:-ghcr.io/tencent/loopforge:0.4.0} + image: ${LOOPFORGE_IMAGE:-ghcr.io/tencent/loopforge:0.4.1} ports: - "${LOOPFORGE_BIND:-0.0.0.0}:${AGENTFLOW_HTTP_PORT:-8090}:8080" environment: @@ -47,7 +47,7 @@ services: AGENTFLOW_PLATFORM_MCP_URL: ${AGENTFLOW_PLATFORM_MCP_URL:-http://platform:8080} AGENTFLOW_DOCKER_NETWORK: ${COMPOSE_PROJECT_NAME:-loopforge}_default AGENTFLOW_LOCAL_SANDBOX: docker - AGENTFLOW_ISOLATED_IMAGE: ${LOOPFORGE_IMAGE:-ghcr.io/tencent/loopforge:0.4.0} + AGENTFLOW_ISOLATED_IMAGE: ${LOOPFORGE_IMAGE:-ghcr.io/tencent/loopforge:0.4.1} HOME: ${LOOPFORGE_DATA_DIR:?Run scripts/configure.sh first}/home AGENTFLOW_RUNNER_BINARY: /app/bin/agentflow-runner-{os}-{arch} AGENTFLOW_GATE_MCP_BINARY: /app/bin/agentflow-gate-mcp-{os}-{arch} diff --git a/docs/deployment.md b/docs/deployment.md index 32df46887..e7a19902f 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -63,7 +63,7 @@ The installer checks Docker, Compose, Python 3 and curl. It offers to install mi Run it as the installation owner, including an ordinary Linux user. If that user cannot access Docker directly, the installer validates sudo and uses `sudo -n docker` consistently for Compose, schema installation and seeds. Before each operation it checks whether sudo credentials expired during a long build, prompting again in a terminal or failing with instructions in unattended mode. It does not require adding the user to the Docker group or logging out. For unattended installations run `sudo -v` first; `LOOPFORGE_YES=1` accepts installation prompts but does not bypass operating-system permissions. Without sudo or Docker access it fails immediately with instructions. Rootless Docker uses its active context's Unix socket; remote Docker contexts need a separately configured deployment because sandbox workspaces are local bind mounts. -`compose.yaml` is the published-image stack and never builds: `./start.sh`, `scripts/install.sh` and a plain `docker compose --profile platform up` all pull the GHCR release pinned there (currently `ghcr.io/tencent/loopforge:0.4.0`). The pin matches the checkout's migrations and seeds, so check out a release tag when you install. Set `LOOPFORGE_IMAGE` (for example to an `@sha256:` digest) only to override it; a value saved in `.env` takes precedence over later pin changes. +`compose.yaml` is the published-image stack and never builds: `./start.sh`, `scripts/install.sh` and a plain `docker compose --profile platform up` all pull the GHCR release pinned there (currently `ghcr.io/tencent/loopforge:0.4.1`). The pin matches the checkout's migrations and seeds, so check out a release tag when you install. Set `LOOPFORGE_IMAGE` (for example to an `@sha256:` digest) only to override it; a value saved in `.env` takes precedence over later pin changes. To upgrade, update the checkout first, then refresh the containers: