cortico-world-fish-sing 0.4.7 → 0.4.8
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 +6 -0
- package/dist/{webui-a1576ab5.js → webui-efe43ccf.js} +3 -1
- package/dist/webui.js +3 -1
- package/package.json +2 -2
- package/src/worker.ts +16 -4
- package/src/world.ts +18 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);版本号遵循语义化。
|
|
4
4
|
|
|
5
|
+
## [0.4.8] - 2026-11-02
|
|
6
|
+
|
|
7
|
+
### 修复
|
|
8
|
+
- **「停止训练」点了没停住,面板却显示已停止**:取消请求发出后不再无条件宣布成功——现在会轮询 worker 的 `/current` 实测 12 秒,真停了才说"已停止",没停住会明确告诉你("worker 还有任务在跑,可能是重启前留下的孤儿")并写 warn 日志。面板也会把这句话显示出来。
|
|
9
|
+
- `worker.cancel()` 的返回值(HTTP 状态 / worker 的答复 / 网络错误)全部带出来并记日志,不再静默吞掉。
|
|
10
|
+
|
|
5
11
|
## [0.4.7] - 2026-11-02
|
|
6
12
|
|
|
7
13
|
### 新增
|
|
@@ -1461,7 +1461,9 @@ function mountTrain(ctx) {
|
|
|
1461
1461
|
stopT.addEventListener('click', async () => {
|
|
1462
1462
|
stopT.disabled = true;
|
|
1463
1463
|
try {
|
|
1464
|
-
await call('trainStop', []);
|
|
1464
|
+
const r = await call('trainStop', []);
|
|
1465
|
+
// 把 world 的实话显示出来:真停了 / 没停住 都要看得见
|
|
1466
|
+
if (r && r.text) say(r.text, !/^已停止/.test(String(r.text)));
|
|
1465
1467
|
} catch {
|
|
1466
1468
|
/* 已显示 */
|
|
1467
1469
|
}
|
package/dist/webui.js
CHANGED
|
@@ -1461,7 +1461,9 @@ function mountTrain(ctx) {
|
|
|
1461
1461
|
stopT.addEventListener('click', async () => {
|
|
1462
1462
|
stopT.disabled = true;
|
|
1463
1463
|
try {
|
|
1464
|
-
await call('trainStop', []);
|
|
1464
|
+
const r = await call('trainStop', []);
|
|
1465
|
+
// 把 world 的实话显示出来:真停了 / 没停住 都要看得见
|
|
1466
|
+
if (r && r.text) say(r.text, !/^已停止/.test(String(r.text)));
|
|
1465
1467
|
} catch {
|
|
1466
1468
|
/* 已显示 */
|
|
1467
1469
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortico-world-fish-sing",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "让她真的开口唱:B 站点歌或本地文件 → 分离 → 换声 → 混音,本机出声或发 QQ 语音条",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"local"
|
|
37
37
|
],
|
|
38
38
|
"describe": "describe.json",
|
|
39
|
-
"webUiClient": "dist/webui-
|
|
39
|
+
"webUiClient": "dist/webui-efe43ccf.js"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"doctor": "node tools/doctor.mjs"
|
package/src/worker.ts
CHANGED
|
@@ -313,16 +313,28 @@ export class WorkerClient {
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
async cancel(): Promise<
|
|
316
|
+
async cancel(): Promise<{ ok: boolean; message: string }> {
|
|
317
|
+
// 返回值要带出去:以前这里吞掉一切,面板点「停止训练」失败也显示"已停止",
|
|
318
|
+
// 结果训练继续跑(0.4.7 那次真实事故),排查时完全看不到线索。
|
|
317
319
|
try {
|
|
318
|
-
await fetch(`${this.baseUrl}/stop`, {
|
|
320
|
+
const res = await fetch(`${this.baseUrl}/stop`, {
|
|
319
321
|
method: 'POST',
|
|
320
322
|
headers: this.authHeaders(),
|
|
321
323
|
body: '{}',
|
|
322
324
|
signal: AbortSignal.timeout(5000),
|
|
323
325
|
});
|
|
324
|
-
|
|
325
|
-
|
|
326
|
+
const body = (await res.json().catch(() => ({}))) as { ok?: boolean; message?: string };
|
|
327
|
+
const message = String(body.message ?? `HTTP ${res.status}`);
|
|
328
|
+
if (!res.ok || body.ok === false) {
|
|
329
|
+
this.log.warn(`取消请求没被接受:HTTP ${res.status} ${message}`);
|
|
330
|
+
return { ok: false, message };
|
|
331
|
+
}
|
|
332
|
+
this.log.info(`取消请求已送达:${message}`);
|
|
333
|
+
return { ok: true, message };
|
|
334
|
+
} catch (e) {
|
|
335
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
336
|
+
this.log.warn(`取消请求发不出去(worker 没响应):${message}`);
|
|
337
|
+
return { ok: false, message: `连不上 worker:${message}` };
|
|
326
338
|
}
|
|
327
339
|
}
|
|
328
340
|
|
package/src/world.ts
CHANGED
|
@@ -1181,14 +1181,30 @@ export class FishSingWorld implements World {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
|
|
1183
1183
|
if (method === 'trainStop') {
|
|
1184
|
-
await this.worker.cancel();
|
|
1184
|
+
const cres = await this.worker.cancel();
|
|
1185
|
+
// 送达 ≠ 停住:取消请求成功,也可能因为训练是"重启前留下的孤儿"而落空
|
|
1186
|
+
// (worker 当前任务为 null,它只会回"当前没有任务")。所以实测 worker 还在不在跑。
|
|
1187
|
+
let left: { kind?: string } | null = null;
|
|
1188
|
+
for (let i = 0; i < 5; i += 1) {
|
|
1189
|
+
await new Promise((r) => setTimeout(r, 2500));
|
|
1190
|
+
left = await this.worker.currentJob().catch(() => null);
|
|
1191
|
+
if (!left) break;
|
|
1192
|
+
}
|
|
1193
|
+
if (left) {
|
|
1194
|
+
this.host?.log.warn(
|
|
1195
|
+
`[fish-sing] 停止训练:取消请求已发(${cres.message}),但 worker 还有任务在跑(${left.kind ?? '?'})`,
|
|
1196
|
+
);
|
|
1197
|
+
return {
|
|
1198
|
+
text: `取消请求发出去了(${cres.message}),但 worker 那边还有任务在跑——这个训练可能是重启前启动的、worker 管不到它。重启 Coo 后再试。`,
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1185
1201
|
if (this.trainJob?.state === 'running') {
|
|
1186
1202
|
// 立刻落状态:子进程可能还在收尾,面板会一直显示"训练中",用户以为没停
|
|
1187
1203
|
this.trainJob.state = 'error';
|
|
1188
1204
|
this.trainJob.error = '已手动停止';
|
|
1189
1205
|
this.trainJob.msg = '已手动停止';
|
|
1190
1206
|
}
|
|
1191
|
-
return { text:
|
|
1207
|
+
return { text: `已停止训练(${cres.message})。最近的存档还在 logs 里,可以勾「从上次存档继续」接着练。` };
|
|
1192
1208
|
}
|
|
1193
1209
|
|
|
1194
1210
|
if (method === 'cancel') {
|