Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ jobs:
cache-to: type=gha,mode=max,scope=funbi-${{ matrix.target }}

deploy:
if: github.event_name == 'workflow_dispatch' && inputs.deploy && github.ref == 'refs/heads/main'
if: >-
github.ref == 'refs/heads/main' &&
(github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.deploy))
needs: publish
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
6 changes: 4 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ docker compose logs --tail 100 api ai worker
| 操作 | 工作流行为 |
| --- | --- |
| 创建或更新 PR | 检查数据库迁移、类型、测试、两个 Linux 镜像构建及 server 运行工具;不发布镜像 |
| 合并到 main | 检查通过后,将 server / web 镜像推送到 GHCR;不更新服务器 |
| 合并或推送到 main | 检查通过后,将 server / web 镜像推送到 GHCR,再自动备份、迁移并更新服务器 |
| 手动运行 Release,deploy 不勾选 | 检查并发布镜像 |
| 手动运行 Release,选择 main 并勾选 deploy | 检查、发布镜像、备份数据库、迁移并更新服务器 |

Expand All @@ -64,7 +64,9 @@ docker compose logs --tail 100 api ai worker

`deploy-registry.sh` 只拉取 server / web 镜像,使用服务器已有的 PostgreSQL、Redis 和 MinIO。更新前在 `backups/<时间>-<tag>/` 保存 PostgreSQL 自定义格式备份、原 `.env` 和 Compose 文件。迁移失败时保持旧应用;应用或 HTTP 健康检查失败时恢复原配置并重建旧版应用。**数据库不会自动回滚**,不兼容的迁移需要根据备份人工恢复。MinIO 数据和 AI 工作区继续保留在原命名卷。

首次使用时,先把工作流合并到 main,再打开 GitHub **Actions → Release → Run workflow**,选择 main,勾选 deploy 后运行。后续仍采用这个手动发布步骤。
将工作流合并到 main 后,本次合并以及后续 main 更新都会自动执行检查、发布镜像并部署。检查或任一镜像发布失败时,部署不会开始。同一分支的发布串行执行,避免并发更新服务器。

需要手动重发时,打开 GitHub **Actions → Release → Run workflow**,选择 main,勾选 deploy 后运行。不勾选时仅检查并发布镜像。

手动备份可以在服务器部署目录运行对应版本中的脚本:

Expand Down
28 changes: 26 additions & 2 deletions patches/@mastra__core.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/dist/agent-BMi0F5ou.cjs b/dist/agent-BMi0F5ou.cjs
index fadfaa7621f4f5bcdd6bed34f974b8d1bdf7e246..b523e9d523c97497adee0d1e35d4ad83a7b06a73 100644
index fadfaa7621f4f5bcdd6bed34f974b8d1bdf7e246..7ba76e0ed3bd967f28af3973d3f7813f199b7cca 100644
--- a/dist/agent-BMi0F5ou.cjs
+++ b/dist/agent-BMi0F5ou.cjs
@@ -31393,10 +31393,15 @@ var SaveQueueManager = class SaveQueueManager {
Expand Down Expand Up @@ -111,8 +111,20 @@ index fadfaa7621f4f5bcdd6bed34f974b8d1bdf7e246..b523e9d523c97497adee0d1e35d4ad83
const terminalKey = taskId && TERMINAL_BG_CHUNKS.has(chunk.type) ? `${taskId}:${chunk.type}` : void 0;
if (terminalKey && processedTerminalKeys.has(terminalKey)) continue;
updateIdleTimer();
@@ -31753,7 +31809,10 @@ async function runIdleLoop(agent, streamOptions, deps, firstTurn, streamForConti
if (!taskId) continue;
if (chunk.type === "background-task-running" || chunk.type === "background-task-resumed") runningTaskIds.add(taskId);
else if (TERMINAL_BG_CHUNKS.has(chunk.type)) {
- runningTaskIds.delete(taskId);
+ // A suspended background task still awaits resume and a final result.
+ // Keep its subscription alive regardless of when the foreground finishes.
+ if (chunk.type === "background-task-suspended") runningTaskIds.add(taskId);
+ else runningTaskIds.delete(taskId);
pendingCompletions.push(chunk);
processIfIdle();
}
diff --git a/dist/agent-CEHR0Wd8.js b/dist/agent-CEHR0Wd8.js
index 3a27f1c85b2639362979195cb0ca6fd81f5ce227..69126aa9c04946774241c0060671709d8075b35f 100644
index 3a27f1c85b2639362979195cb0ca6fd81f5ce227..a2aed40cc9a74b3d61525c8067e0f934a8a45d95 100644
--- a/dist/agent-CEHR0Wd8.js
+++ b/dist/agent-CEHR0Wd8.js
@@ -31391,10 +31391,15 @@ var SaveQueueManager = class SaveQueueManager {
Expand Down Expand Up @@ -224,3 +236,15 @@ index 3a27f1c85b2639362979195cb0ca6fd81f5ce227..69126aa9c04946774241c0060671709d
const terminalKey = taskId && TERMINAL_BG_CHUNKS.has(chunk.type) ? `${taskId}:${chunk.type}` : void 0;
if (terminalKey && processedTerminalKeys.has(terminalKey)) continue;
updateIdleTimer();
@@ -31751,7 +31807,10 @@ async function runIdleLoop(agent, streamOptions, deps, firstTurn, streamForConti
if (!taskId) continue;
if (chunk.type === "background-task-running" || chunk.type === "background-task-resumed") runningTaskIds.add(taskId);
else if (TERMINAL_BG_CHUNKS.has(chunk.type)) {
- runningTaskIds.delete(taskId);
+ // A suspended background task still awaits resume and a final result.
+ // Keep its subscription alive regardless of when the foreground finishes.
+ if (chunk.type === "background-task-suspended") runningTaskIds.add(taskId);
+ else runningTaskIds.delete(taskId);
pendingCompletions.push(chunk);
processIfIdle();
}
Loading
Loading