cortico-world-fish-sing 0.4.14 → 0.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);版本号遵循语义化。
4
4
 
5
+ ## [0.4.15] - 2026-11-03
6
+
7
+ ### 修复
8
+ - **「停止训练」触发假警报"训练中断:查不到任务"**:0.4.8 复盘找到了根因——停止生效的那一瞬间机器有一次网络/响应抖动(连 snowluma 都短暂 fetch failed),而任务的轮询循环把**任何响应残缺都当成"任务不存在"**直接抛错,于是弹了条假"训练中断"还发了通知。现在:
9
+ - 只有 worker **明确**回答"没有这个任务"(HTTP 404,比如 worker 重启过)才算真没了;
10
+ - 网络抖动/响应残缺容忍 30 秒(每 0.7 秒重试),持续不了才报"worker 连不上/响应异常已持续 30 秒";
11
+ - **手动停止(已取消/已手动停止)不再发"训练中断"通知**,只记一条 info 日志。
12
+ - 顺带确认:这次的「停止训练」完全正常——日志显示"取消请求已送达",训练日志停在 18:07(第 38 轮 24% 处),0.4.8 的修复有效。
13
+
5
14
  ## [0.4.14] - 2026-11-03
6
15
 
7
16
  ### 改进(训练页第二轮,全部来自用户实测反馈)
package/package.json CHANGED
@@ -1,45 +1,45 @@
1
- {
2
- "name": "cortico-world-fish-sing",
3
- "version": "0.4.14",
4
- "description": "让她真的开口唱:B 站点歌或本地文件 → 分离 → 换声 → 混音,本机出声或发 QQ 语音条",
5
- "type": "module",
6
- "main": "./src/index.ts",
7
- "license": "MIT",
8
- "author": "FXYXL",
9
- "keywords": [
10
- "cortico-world",
11
- "cortico",
12
- "coo",
13
- "sing",
14
- "rvc",
15
- "music",
16
- "qq"
17
- ],
18
- "engines": {
19
- "node": ">=22.6"
20
- },
21
- "homepage": "https://github.com/FXYXL/cortico-world-fish-sing#readme",
22
- "repository": {
23
- "type": "git",
24
- "url": "git+https://github.com/FXYXL/cortico-world-fish-sing.git"
25
- },
26
- "bugs": {
27
- "url": "https://github.com/FXYXL/cortico-world-fish-sing/issues"
28
- },
29
- "cortico": {
30
- "kind": "world",
31
- "api": 6,
32
- "label": "大肥鱼唱歌",
33
- "tags": [
34
- "music",
35
- "qq",
36
- "local"
37
- ],
38
- "describe": "describe.json",
39
- "webUiClient": "dist/webui-ba6b0f93.js"
40
- },
41
- "scripts": {
42
- "doctor": "node tools/doctor.mjs"
43
- },
44
- "dependencies": {}
45
- }
1
+ {
2
+ "name": "cortico-world-fish-sing",
3
+ "version": "0.4.15",
4
+ "description": "让她真的开口唱:B 站点歌或本地文件 → 分离 → 换声 → 混音,本机出声或发 QQ 语音条",
5
+ "type": "module",
6
+ "main": "./src/index.ts",
7
+ "license": "MIT",
8
+ "author": "FXYXL",
9
+ "keywords": [
10
+ "cortico-world",
11
+ "cortico",
12
+ "coo",
13
+ "sing",
14
+ "rvc",
15
+ "music",
16
+ "qq"
17
+ ],
18
+ "engines": {
19
+ "node": ">=22.6"
20
+ },
21
+ "homepage": "https://github.com/FXYXL/cortico-world-fish-sing#readme",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/FXYXL/cortico-world-fish-sing.git"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/FXYXL/cortico-world-fish-sing/issues"
28
+ },
29
+ "cortico": {
30
+ "kind": "world",
31
+ "api": 6,
32
+ "label": "大肥鱼唱歌",
33
+ "tags": [
34
+ "music",
35
+ "qq",
36
+ "local"
37
+ ],
38
+ "describe": "describe.json",
39
+ "webUiClient": "dist/webui-ba6b0f93.js"
40
+ },
41
+ "scripts": {
42
+ "doctor": "node tools/doctor.mjs"
43
+ },
44
+ "dependencies": {}
45
+ }
package/src/worker.ts CHANGED
@@ -272,12 +272,38 @@ export class WorkerClient {
272
272
  let lastChange = Date.now();
273
273
  let lastMsg = '';
274
274
  let lastPct = -1;
275
+ let badSince = 0;
275
276
 
276
277
  for (;;) {
277
- const res = await fetch(`${this.baseUrl}/job/${id}`, { signal: AbortSignal.timeout(10_000) });
278
- const body = (await res.json().catch(() => ({}))) as { ok?: boolean; job?: JobState };
279
- const job = body.job;
280
- if (!job) throw new Error(`查不到任务 ${id}`);
278
+ let job: JobState | undefined;
279
+ try {
280
+ const res = await fetch(`${this.baseUrl}/job/${id}`, { signal: AbortSignal.timeout(10_000) });
281
+ if (res.status === 404) {
282
+ // 只有 worker 明确说"没有这个任务"才算真没了(比如 worker 重启过、内存记录清空)。
283
+ // 网络抖动/响应残缺不能算——0.4.14 实测:停止训练的那一瞬间机器卡了一下,
284
+ // 拿到残缺响应就报"训练中断:查不到任务",其实任务好好地在。
285
+ throw new Error(`查不到任务 ${id}`);
286
+ }
287
+ const body = (await res.json().catch(() => null)) as { ok?: boolean; job?: JobState } | null;
288
+ job = body?.job;
289
+ } catch (e) {
290
+ if (e instanceof Error && e.message.startsWith('查不到任务')) throw e; // worker 明确说没有,才是真没有
291
+ if (!badSince) badSince = Date.now();
292
+ if (Date.now() - badSince > 30_000) {
293
+ throw new Error(`worker 连不上/响应异常已持续 30 秒:${e instanceof Error ? e.message : String(e)}`);
294
+ }
295
+ await new Promise((r) => setTimeout(r, 700));
296
+ continue;
297
+ }
298
+ badSince = 0;
299
+ if (!job) {
300
+ if (!badSince) badSince = Date.now();
301
+ if (Date.now() - badSince > 30_000) {
302
+ throw new Error('worker 响应异常(任务字段缺失)已持续 30 秒');
303
+ }
304
+ await new Promise((r) => setTimeout(r, 700));
305
+ continue;
306
+ }
281
307
 
282
308
  const pct = job.progress ?? 0;
283
309
  if ((job.message && job.message !== lastMsg) || Math.abs(pct - lastPct) > 1e-6) {
package/src/world.ts CHANGED
@@ -1120,6 +1120,12 @@ export class FishSingWorld implements World {
1120
1120
  job.state = 'error';
1121
1121
  job.error = e instanceof Error ? e.message : String(e);
1122
1122
  job.msg = job.error;
1123
+ if (job.error === '已取消' || job.error === '已手动停止') {
1124
+ // 用户自己点的停止不算"中断",也用不着通知(0.4.14 之前点停止也会收到
1125
+ // 一条"训练中断"推送,纯属噪音)
1126
+ this.host?.log.info(`[fish-sing] 训练已停止(${job.error})`);
1127
+ return;
1128
+ }
1123
1129
  this.host?.log.warn(`[fish-sing] 训练中断:${job.error}`);
1124
1130
  void this.notifyEvent(`训练中断:${exp}`, job.error);
1125
1131
  });