Skip to content

Commit a675ecd

Browse files
roberttwangclaude
andcommitted
Merge main into walkthrough/thr-b04ebdb20b8c
Resolve conflicts with the latest main; keep both sides' additions (i18n dictionaries, runner/A2A rows, review-mode run header, user turn actions) without dropping either branch's behaviour. Co-Authored-By: Claude Code <noreply@anthropic.com>
2 parents cdba90a + f3c1fcd commit a675ecd

424 files changed

Lines changed: 69095 additions & 3628 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.env.example‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ AGENTFLOW_HTTP_PORT=8090
88
AGENTFLOW_MYSQL_DSN=loopforge:REPLACE_ME@tcp(127.0.0.1:33315)/loopforge
99
AGENTFLOW_SESSION_SECRET=REPLACE_WITH_64_RANDOM_HEX_CHARACTERS
1010
AGENTFLOW_AUTH_REQUIRED=true
11-
# Enable only on a Docker host that trusts every user who can run on it.
12-
AGENTFLOW_ALLOW_PRIVILEGED_SANDBOX=false
1311
LOOPFORGE_DB_PASSWORD=REPLACE_ME
1412
LOOPFORGE_DB_ROOT_PASSWORD=REPLACE_ME
1513
LOOPFORGE_MYSQL_PORT=33315
@@ -25,6 +23,8 @@ AGENTFLOW_ASSISTANT_MODELS=
2523
AGENTFLOW_ASSISTANT_MODEL=
2624
# Optional comma-separated CIDRs allowed for control-plane approval review / model probe gateways (e.g. 10.0.0.0/8):
2725
AGENTFLOW_APPROVAL_EGRESS_ALLOW_CIDRS=
26+
# Optional L3 asset evolution; keep disabled for the first rollout. See docs/api/evolution.md.
27+
AGENTFLOW_EVOLUTION_AUTO_ENABLED=false
2828
# Optional platform path to administrator-verified SSH host keys. See docs/deployment.md.
2929
AGENTFLOW_GIT_SSH_KNOWN_HOSTS=
3030
# Worker separation, installed runners and preview settings retain AGENTFLOW_ names.

‎.github/workflows/platform.yml‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,18 @@ jobs:
9797
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
9898
- name: Install bubblewrap for the native sandbox
9999
run: sudo apt-get update && sudo apt-get install -y bubblewrap
100-
# The welcome LOOP runs in generic-docker. As in a Compose installation, it
101-
# uses the pinned platform image instead of building one during the tests.
102-
- name: Pull the pinned platform image for the generic-docker sandbox
100+
# The release checks run before the new platform image is published.
101+
- name: Prepare the platform image for the generic-docker sandbox
103102
run: |
104103
pinned=$(sed -n 's/^ *image: \${LOOPFORGE_IMAGE:-\(.*\)}$/\1/p' compose.yaml)
105-
docker pull --quiet "$pinned"
106-
echo "AGENTFLOW_ISOLATED_IMAGE=$pinned" >> "$GITHUB_ENV"
104+
if docker manifest inspect "$pinned" > /dev/null 2>&1; then
105+
docker pull --quiet "$pinned"
106+
sandbox_image="$pinned"
107+
else
108+
sandbox_image="loopforge-browser-ci:$GITHUB_SHA"
109+
docker build --build-arg LOOPFORGE_COMMIT="$GITHUB_SHA" -t "$sandbox_image" .
110+
fi
111+
echo "AGENTFLOW_ISOLATED_IMAGE=$sandbox_image" >> "$GITHUB_ENV"
107112
- name: Start clean local installation
108113
run: |
109114
bash scripts/dev.sh > /tmp/loopforge.log 2>&1 &

‎AGENTS.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Preserve the platform architecture; keep deployment-specific adapters isolated.
2626
| `AnalyticsRepo` | 只读运营分析视图 |
2727
| `PreviewsRepo` | run previews |
2828
| `EngineInstancesRepo` | engine instances |
29+
| `EvolutionRepo` | 资产进化:evo policies/findings/proposals/replays/signals/samples、asset versions、run asset pins |
2930

3031
规则:
3132

@@ -65,7 +66,7 @@ Preserve the platform architecture; keep deployment-specific adapters isolated.
6566
`previewsHandlers`、`streamHandlers`、`runnersHandlers`、
6667
`scheduleHandlers`、`tokenHandlers`、`syncHandlers`、
6768
`assistantHandlers`、`mcpHandlers`、
68-
`marketHandlers`…),在 `server.go` 的 `Server` 中以指针装配。
69+
`marketHandlers`、`evolutionHandlers`…),在 `server.go` 的 `Server` 中以指针装配。
6970
2. **新领域必须新建自己的 handler struct**,不要把方法挂到现有领域 handler
7071
或 `Server` 上。
7172
3. 同一领域的多个文件允许(`run_eval.go`/`run_workspace.go` 属

‎CHANGELOG.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22

33
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.
44

5-
## Unreleased
5+
## 0.4.3 — LOOP orchestration, execution machines and asset evolution
66

77
### Platform
88

99
- Authorization boundaries for Runners, accounts and MCP servers are stricter. Runner re-registration renews a machine only for its current owner; a platform bootstrap token registers a new machine instead of adopting a user's. Browser setup and self-registration are limited to password installations, and login names listed in `AGENTFLOW_PLATFORM_ADMINS` must be created with the operator account command. Personal MCP writes are bound to the signed-in user. An MCP import is saved as a whole or not at all, so a payload with a forbidden entry or a repeated ID now fails, and a platform administrator can no longer import other users' personal MCPs. Cloning a role copies MCP servers only from projects the caller can write; market MCPs are installed from the catalog instead.
10-
- **Upgrade action for personal execution machines.** Existing project conversations bound to a personal machine require a project grant before the next message can run. The machine owner can grant access in **Settings → Execution machines → Shared projects**, then resume the conversation on the same machine. [Upgrade instructions](docs/deployment.md#upgrading-existing-project-conversations)
10+
- Machine owners with project write access can select their own execution machine in new project conversations and continue existing conversations bound to it. Other members with project write access can use the machine through its project share. [Execution machine settings](docs/deployment.md#upgrading-existing-project-conversations)
1111
- Reusable delivery workflows now appear as **LOOPs** in the product, agent guidance and documentation. Existing API routes, workflow IDs and stored execution types stay compatible. The installer and `./start.sh pull` update the built-in template names and demo project copy.
1212
- **Breaking:** the `local` sandbox type is removed and native sandboxes only carry environment variables. A native sandbox runs on whichever machine executes the work (a user's execution machine, a cloud runner or the platform host) with that machine's own toolchains; environment install scripts, `$PREFIX` and install PATH entries are gone, and settings such as `JAVA_HOME` go into the sandbox's environment variables. LOOPs and conversation workspaces can use Docker or native sandboxes; the default sandbox is `generic-docker`, and `AGENTFLOW_LOCAL_SANDBOX` is removed. A local row that was not migrated reads as native; a run frozen with a local sandbox asks to be started again with a native one.
1313
- Native LOOP checkouts use a private repository cache on each execution machine. The platform or Runner refreshes the bare repository with the checkout's Git credentials and copies Git objects into the worktree. This reuses the network fetch and leaves each worktree and checkpoint independent. Docker sandboxes keep direct clones. Conversation workspaces start empty and the agent clones using the current speaker's credentials. Runner 0.12.0 supports cached LOOP checkouts.
1414
- LOOPs dispatched from project conversations can reuse the conversation's Git checkouts, including repositories nested inside another checkout, and keep local commits and edits. Upgrade the platform and its execution machines together. Reusing a conversation checkout on an execution machine requires Runner 0.12.3 or later.
1515
- Users can choose a preferred sandbox kind in 设置 → AI 助手 → 对话工作区. The preference (`workspaceDriver` in `/api/assistant/preferences`) prioritizes that kind among compatible environments. A task can require another toolchain, and a fixed conversation environment takes precedence. The workbench groups sandboxes by kind, and the header displays the current workspace's sandbox type icon and ID beside the execution machine. Startup AutoMigrate and migration 041 both add the preference column.
1616
- **Breaking:** a docker sandbox now carries its own Dockerfile, and the 环境资产 page becomes 「沙箱管理」 without type tabs: the sandbox editor holds the Dockerfile and its build-context files for docker, and only environment variables for native. Dockerfiles and install scripts are no longer separate assets. `/api/dockerfiles`, `/api/environments`, the `dockerfiles_*` / `environments_*` assistant and MCP tools and the `dockerfiles` / `environments` bootstrap fields are removed; `PUT /api/sandboxes` takes `dockerfile {content, files}` in place of `dockerfileId`, and rejects `driver: local`. For an existing Compose database, `./start.sh pull` backs up the database and applies `migrations/041_native_sandbox_inline_assets.sql` with the platform stopped when the target image supports inline Dockerfiles and legacy asset tables still exist. For a manual Compose upgrade, use `./start.sh migrate-sandboxes`. Apply the SQL directly for external MySQL. It copies each referenced Dockerfile into its sandbox, turns one that no sandbox used into a sandbox of its own, turns local sandboxes into native ones, copies ordinary variables from referenced environments, drops install scripts and `PATH` from native sandbox variables, and moves LOOPs that used the old default to `generic-docker`, and drops the `dockerfiles` and `environments` tables. Docker images are reused.
1717

18+
- The RSI workbench lets project teams review asset proposals, replay real runs, try changes in a canary, and publish or roll back asset versions (#1314).
19+
1820
### enterprise IM channels (Feishu and DingTalk chats, proactive notifications, data retention)
1921

2022
- Runs started from a Feishu or DingTalk chat (confirm and start, dispatch, or save-and-start after a chat clarification) report back to that conversation without any LOOP notification binding: a failed or waiting node arrives as an action card, the end of the run as a short message. Group runs report to the group, where any bound project member can use the card buttons as themselves; the card then names who acted and locks. Feishu sends group messages by `chat_id`, DingTalk through the robot group message API and `IM_GROUP` cards. The starting conversation is stored with the run when it is created; a later run of the same requirement started on the platform is not sent to the chat.
@@ -40,6 +42,8 @@ Platform releases use `vX.Y.Z` tags and publish `ghcr.io/tencent/loopforge`. Loo
4042
- Receiving leases, send windows and retries are judged on the database clock with an epoch per owner, so a replica that lost its lease can no longer overwrite a reply or send it twice. Notification deliveries gain the state `send_unknown`.
4143
- Upgrading needs a maintenance window: stop every old replica, start the new version once with `AGENTFLOW_BOT_WORKERS_ENABLED=false`, run `migrations/036_enterprise_im_channels.sql` and `migrations/037_bot_binding_ownership.sql`, run `-credential-action reencrypt`, then restart with workers enabled. Bots not backfilled by 036 do not receive messages.
4244

45+
**Upgrading from v0.4.2.** Check out `v0.4.3` and run `./start.sh pull` for a Compose installation. Review the sandbox migration above before upgrading an external MySQL deployment. Follow the [Runner update instructions](docs/conversation-native-cli.md) for remote execution machines.
46+
4347
## 0.4.2 — Conversation recovery and assisted approvals
4448

4549
- Existing conversations can resume after a skill installation leaves an unsupported symbolic link in their managed skill directory. The platform and Runner remove these links during asset preparation, record the cleanup in the turn activity, and report filesystem failures separately from session locks (#1261).

‎chatbot/src/ActivityTrace.jsx‎

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,18 @@ function ActivityGroup({ block, live, interrupted, expandAll, badges }) {
328328
</div>
329329
);
330330
}
331-
function Narration({ blocks, live, interrupted, expandAll = false, badges }) {
331+
function Narration({
332+
blocks,
333+
live,
334+
interrupted,
335+
expandAll = false,
336+
badges,
337+
citationProps = null,
338+
}) {
332339
return blocks.map((block) =>
333340
block.type === "text" ? (
334341
<div key={block.id} className="reply-trace-text">
335-
<RichContent message={block.text} />
342+
<RichContent message={block.text} {...citationProps} />
336343
</div>
337344
) : (
338345
<ActivityGroup
@@ -346,12 +353,38 @@ function Narration({ blocks, live, interrupted, expandAll = false, badges }) {
346353
),
347354
);
348355
}
356+
// The history response already contains the visible answer. Fetch the trace
357+
// when the reader opens it, or follows a dispatch into a subagent's process.
358+
export function DeferredActivity({ sessionId, index, activityRef, loadActivity }) {
359+
const [error, setError] = useState("");
360+
const [attempt, setAttempt] = useState(0);
361+
useEffect(() => {
362+
let current = true;
363+
setError("");
364+
loadActivity(sessionId, index, activityRef).catch((e) => {
365+
if (current) setError(e.message || "执行过程加载失败");
366+
});
367+
return () => { current = false; };
368+
}, [sessionId, index, activityRef, loadActivity, attempt]);
369+
return error ? (
370+
<p role="alert" className="execution-empty">
371+
{error} <button type="button" onClick={() => setAttempt(n => n + 1)}>重试</button>
372+
</p>
373+
) : <p role="status" className="execution-empty">正在读取执行过程…</p>;
374+
}
375+
349376
export function ReplyTimeline({
377+
deferredActivity = null,
350378
steps = [],
351379
startedAt,
352380
finishedAt,
353381
live = false,
354382
interrupted = false,
383+
knowledgeReads = null,
384+
knowledgeSummary = null,
385+
citationsEnabled = false,
386+
streaming = false,
387+
onCitationClick = null,
355388
approvals = [],
356389
}) {
357390
return (
@@ -363,7 +396,15 @@ export function ReplyTimeline({
363396
live={live}
364397
interrupted={interrupted}
365398
approvals={approvals}
399+
deferredActivity={deferredActivity}
366400
narration={traceBlocks(steps, { live })}
401+
citationProps={{
402+
knowledgeReads,
403+
knowledgeSummary,
404+
citationsEnabled,
405+
streaming,
406+
onCitationClick,
407+
}}
367408
/>
368409
</div>
369410
);
@@ -374,13 +415,15 @@ export function ReplyTimeline({
374415
// the whole process into its elapsed-time line; opening it shows every note,
375416
// thought and step between the line and the answer.
376417
export default function ActivityTrace({
418+
deferredActivity = null,
377419
steps = [],
378420
startedAt,
379421
finishedAt,
380422
live = false,
381423
interrupted = false,
382424
approvals = [],
383425
narration = null,
426+
citationProps = null,
384427
}) {
385428
const [expanded, setExpanded] = useState(false);
386429
const [now, setNow] = useState(Date.now);
@@ -424,7 +467,13 @@ export default function ActivityTrace({
424467
<div className="execution-body" aria-label="执行过程">
425468
{blocks.length ? (
426469
<>
427-
<Narration blocks={blocks} live interrupted={interrupted} badges={badges} />
470+
<Narration
471+
blocks={blocks}
472+
live
473+
interrupted={interrupted}
474+
badges={badges}
475+
citationProps={citationProps}
476+
/>
428477
{/* A CLI that names the tool differently still shows what waits. */}
429478
{unmatched.map((item) => (
430479
<div className="execution-waiting" data-approval="waiting" key={item.id}>
@@ -479,12 +528,13 @@ export default function ActivityTrace({
479528
</summary>
480529
{expanded ? (
481530
<div className="execution-body" aria-label="执行过程">
482-
{blocks.length ? (
531+
{deferredActivity ? <DeferredActivity {...deferredActivity} /> : blocks.length ? (
483532
<Narration
484533
blocks={blocks}
485534
live={false}
486535
interrupted={interrupted}
487536
expandAll
537+
citationProps={citationProps}
488538
/>
489539
) : (
490540
<p className="execution-empty">这条历史回复未保存执行过程。</p>

0 commit comments

Comments
 (0)