@foxden-app/foxclaw 0.5.24 → 0.5.25
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 +12 -0
- package/dist/controller/controller.d.ts +2 -0
- package/dist/controller/controller.js +76 -9
- package/dist/i18n.d.ts +2 -0
- package/dist/i18n.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable FoxClaw changes are listed here. Each release note is bilingual so GitHub Releases and the npm package are useful to both Chinese and English readers.
|
|
4
4
|
|
|
5
|
+
## 0.5.25 - 2026-06-09
|
|
6
|
+
|
|
7
|
+
### 中文
|
|
8
|
+
- FoxClaw 重启后会优先重新接管 Codex app-server 中仍在运行的 live turn,包括 turn id 已变化但线程仍有 live turn 的情况,避免误开第二个续跑任务。
|
|
9
|
+
- 如果重启前记录的活动 turn 已被 app-server 中断且没有完成结果,FoxClaw 会自动在同一线程启动一个“继续中断工作”的新 turn,并复用原 Telegram 状态卡继续更新,不再要求用户手动发送“继续”。
|
|
10
|
+
- 如果旧 turn 已经完成,FoxClaw 只收尾旧状态卡,不会误触发自动续跑。
|
|
11
|
+
|
|
12
|
+
### English
|
|
13
|
+
- After a FoxClaw restart, live Codex app-server turns are reattached first, including cases where the live turn id changed but the thread still has an active turn, avoiding a duplicate resume turn.
|
|
14
|
+
- If the previously tracked active turn was interrupted by the app-server restart and has no completed result, FoxClaw automatically starts a continuation turn in the same thread and reuses the existing Telegram status card.
|
|
15
|
+
- If the old turn already completed, FoxClaw only retires the old status card and does not auto-resume it.
|
|
16
|
+
|
|
5
17
|
## 0.5.24 - 2026-06-09
|
|
6
18
|
|
|
7
19
|
### 中文
|
|
@@ -419,6 +419,8 @@ export declare class BridgeSessionCore {
|
|
|
419
419
|
private syncTurnStream;
|
|
420
420
|
private cleanupStaleTurnPreviews;
|
|
421
421
|
private recoverLiveTurnPreview;
|
|
422
|
+
private attachRecoveredTurnPreview;
|
|
423
|
+
private resumeInterruptedTurnAfterRestart;
|
|
422
424
|
private interruptOrphanWaitingUserInput;
|
|
423
425
|
private cleanupFinishedPreview;
|
|
424
426
|
private cleanupStaleInterruptButton;
|
|
@@ -7229,16 +7229,35 @@ export class BridgeSessionCore {
|
|
|
7229
7229
|
return false;
|
|
7230
7230
|
}
|
|
7231
7231
|
const liveTurn = findLiveTurn(snapshot);
|
|
7232
|
-
if (
|
|
7233
|
-
|
|
7232
|
+
if (liveTurn) {
|
|
7233
|
+
if (liveTurn.turnId === preview.turnId
|
|
7234
|
+
&& snapshot.activeFlags.includes('waitingOnUserInput')
|
|
7235
|
+
&& !this.hasPendingUserInputForTurn(preview.scopeId, preview.turnId)) {
|
|
7236
|
+
return this.interruptOrphanWaitingUserInput(preview);
|
|
7237
|
+
}
|
|
7238
|
+
return this.attachRecoveredTurnPreview(preview, target, snapshot, liveTurn);
|
|
7234
7239
|
}
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7240
|
+
const previousTurn = snapshot.turns.find(turn => turn.turnId === preview.turnId) ?? null;
|
|
7241
|
+
if (previousTurn && previousTurn.status !== 'inProgress') {
|
|
7242
|
+
await this.retirePreviewMessage(preview.scopeId, preview.messageId, t(this.localeForChat(preview.scopeId), 'completed_see_reply_below'), preview.turnId);
|
|
7243
|
+
return true;
|
|
7244
|
+
}
|
|
7245
|
+
if (preview.isObserved) {
|
|
7246
|
+
return false;
|
|
7238
7247
|
}
|
|
7248
|
+
return this.resumeInterruptedTurnAfterRestart(preview, target);
|
|
7249
|
+
}
|
|
7250
|
+
async attachRecoveredTurnPreview(preview, target, snapshot, liveTurn) {
|
|
7239
7251
|
await this.stopWatchingScopeThread(preview.scopeId, preview.threadId);
|
|
7240
|
-
const active = this.createActiveTurnState(preview.scopeId, target.chatId, target.chatType, target.topicId, preview.threadId,
|
|
7241
|
-
this.setActiveTurn(preview.scopeId,
|
|
7252
|
+
const active = this.createActiveTurnState(preview.scopeId, target.chatId, target.chatType, target.topicId, preview.threadId, liveTurn.turnId, preview.messageId, preview.isObserved);
|
|
7253
|
+
this.setActiveTurn(preview.scopeId, liveTurn.turnId, active);
|
|
7254
|
+
this.store.saveActiveTurnPreview({
|
|
7255
|
+
turnId: liveTurn.turnId,
|
|
7256
|
+
scopeId: preview.scopeId,
|
|
7257
|
+
threadId: preview.threadId,
|
|
7258
|
+
messageId: preview.messageId,
|
|
7259
|
+
isObserved: preview.isObserved,
|
|
7260
|
+
});
|
|
7242
7261
|
const watcher = {
|
|
7243
7262
|
scopeId: preview.scopeId,
|
|
7244
7263
|
chatId: target.chatId,
|
|
@@ -7248,7 +7267,7 @@ export class BridgeSessionCore {
|
|
|
7248
7267
|
mode: 'app_snapshot',
|
|
7249
7268
|
timer: null,
|
|
7250
7269
|
cursor: seedObservedTurnCursor(liveTurn),
|
|
7251
|
-
activeTurnId:
|
|
7270
|
+
activeTurnId: liveTurn.turnId,
|
|
7252
7271
|
waitingOnApproval: snapshot.activeFlags.includes('waitingOnApproval'),
|
|
7253
7272
|
sessionPath: null,
|
|
7254
7273
|
sessionOffset: -1,
|
|
@@ -7263,11 +7282,59 @@ export class BridgeSessionCore {
|
|
|
7263
7282
|
this.logger.info('telegram.preview_recovered', {
|
|
7264
7283
|
scopeId: preview.scopeId,
|
|
7265
7284
|
threadId: preview.threadId,
|
|
7266
|
-
turnId:
|
|
7285
|
+
turnId: liveTurn.turnId,
|
|
7286
|
+
previousTurnId: preview.turnId,
|
|
7267
7287
|
isObserved: preview.isObserved,
|
|
7268
7288
|
});
|
|
7269
7289
|
return true;
|
|
7270
7290
|
}
|
|
7291
|
+
async resumeInterruptedTurnAfterRestart(preview, target) {
|
|
7292
|
+
const locale = this.localeForChat(preview.scopeId);
|
|
7293
|
+
const binding = {
|
|
7294
|
+
threadId: preview.threadId,
|
|
7295
|
+
cwd: this.store.getBinding(preview.scopeId)?.cwd ?? this.config.defaultCwd,
|
|
7296
|
+
};
|
|
7297
|
+
const input = [{
|
|
7298
|
+
type: 'text',
|
|
7299
|
+
text: t(locale, 'restart_auto_resume_prompt'),
|
|
7300
|
+
text_elements: [],
|
|
7301
|
+
}];
|
|
7302
|
+
try {
|
|
7303
|
+
await this.sendTyping(preview.scopeId);
|
|
7304
|
+
const turnState = await this.startTurnWithRecovery(preview.scopeId, binding, input, {
|
|
7305
|
+
recoverMissingThread: false,
|
|
7306
|
+
});
|
|
7307
|
+
if (turnState.collaborationMode === 'plan') {
|
|
7308
|
+
this.store.setChatCollaborationMode(preview.scopeId, DEFAULT_COLLABORATION_MODE);
|
|
7309
|
+
}
|
|
7310
|
+
await this.registerActiveTurn(preview.scopeId, target.chatId, target.chatType, target.topicId, turnState.threadId, turnState.turnId, preview.messageId, {
|
|
7311
|
+
input,
|
|
7312
|
+
threadId: turnState.threadId,
|
|
7313
|
+
cwd: binding.cwd,
|
|
7314
|
+
chatId: target.chatId,
|
|
7315
|
+
chatType: target.chatType,
|
|
7316
|
+
topicId: target.topicId,
|
|
7317
|
+
collaborationMode: turnState.collaborationMode,
|
|
7318
|
+
failedAuthTargets: new Set(),
|
|
7319
|
+
}, turnState.collaborationMode);
|
|
7320
|
+
this.logger.info('telegram.preview_auto_resumed_after_restart', {
|
|
7321
|
+
scopeId: preview.scopeId,
|
|
7322
|
+
threadId: preview.threadId,
|
|
7323
|
+
previousTurnId: preview.turnId,
|
|
7324
|
+
turnId: turnState.turnId,
|
|
7325
|
+
});
|
|
7326
|
+
return true;
|
|
7327
|
+
}
|
|
7328
|
+
catch (error) {
|
|
7329
|
+
this.logger.warn('telegram.preview_auto_resume_after_restart_failed', {
|
|
7330
|
+
scopeId: preview.scopeId,
|
|
7331
|
+
threadId: preview.threadId,
|
|
7332
|
+
turnId: preview.turnId,
|
|
7333
|
+
error: toErrorMeta(error),
|
|
7334
|
+
});
|
|
7335
|
+
return false;
|
|
7336
|
+
}
|
|
7337
|
+
}
|
|
7271
7338
|
async interruptOrphanWaitingUserInput(preview) {
|
|
7272
7339
|
try {
|
|
7273
7340
|
await this.app.interruptTurn(preview.threadId, preview.turnId);
|
package/dist/i18n.d.ts
CHANGED
|
@@ -418,6 +418,7 @@ declare const MESSAGES: {
|
|
|
418
418
|
readonly stale_preview_restarted: "The bridge restarted while turn {threadId} was still live. This status card is no longer live. Open the thread in Codex.app or send another message to continue.";
|
|
419
419
|
readonly stale_preview_expired: "This live preview expired after the bridge stopped tracking the turn. If a final reply arrived, see below. Otherwise send the message again.";
|
|
420
420
|
readonly stale_user_input_interrupted: "The bridge found a stale Codex input request for thread {threadId} with no recoverable Telegram question. It interrupted that stuck turn; send the message again to continue.";
|
|
421
|
+
readonly restart_auto_resume_prompt: "FoxClaw restarted while the previous turn was running. Continue the interrupted work from where it left off.";
|
|
421
422
|
readonly streaming_reply_below: "Streaming reply below...";
|
|
422
423
|
readonly interrupt_requested_preview: "Interrupt requested...";
|
|
423
424
|
readonly interrupt_requested_waiting: "Interrupt requested. Waiting for Codex to stop...";
|
|
@@ -1114,6 +1115,7 @@ declare const MESSAGES: {
|
|
|
1114
1115
|
readonly stale_preview_restarted: "桥接在该线程 {threadId} 仍处于活动状态时重启了。这张状态卡已经不再实时更新。你可以去 Codex.app 打开线程,或重新发一条消息继续。";
|
|
1115
1116
|
readonly stale_preview_expired: "之前的实时预览在桥接停止跟踪这轮回复后已经失效。如果下方已有最终回复,请以最终回复为准;否则请重新发送消息。";
|
|
1116
1117
|
readonly stale_user_input_interrupted: "桥接发现线程 {threadId} 有一条已经无法恢复到 Telegram 的 Codex 输入请求,已中断这条卡住的回复。请重新发送消息继续。";
|
|
1118
|
+
readonly restart_auto_resume_prompt: "FoxClaw 重启时上一轮回复仍在运行。请从中断处继续完成刚才的工作。";
|
|
1117
1119
|
readonly streaming_reply_below: "回复正在下方持续输出...";
|
|
1118
1120
|
readonly interrupt_requested_preview: "已请求中断...";
|
|
1119
1121
|
readonly interrupt_requested_waiting: "已请求中断,正在等待 Codex 停止...";
|
package/dist/i18n.js
CHANGED
|
@@ -416,6 +416,7 @@ const MESSAGES = {
|
|
|
416
416
|
stale_preview_restarted: 'The bridge restarted while turn {threadId} was still live. This status card is no longer live. Open the thread in Codex.app or send another message to continue.',
|
|
417
417
|
stale_preview_expired: 'This live preview expired after the bridge stopped tracking the turn. If a final reply arrived, see below. Otherwise send the message again.',
|
|
418
418
|
stale_user_input_interrupted: 'The bridge found a stale Codex input request for thread {threadId} with no recoverable Telegram question. It interrupted that stuck turn; send the message again to continue.',
|
|
419
|
+
restart_auto_resume_prompt: 'FoxClaw restarted while the previous turn was running. Continue the interrupted work from where it left off.',
|
|
419
420
|
streaming_reply_below: 'Streaming reply below...',
|
|
420
421
|
interrupt_requested_preview: 'Interrupt requested...',
|
|
421
422
|
interrupt_requested_waiting: 'Interrupt requested. Waiting for Codex to stop...',
|
|
@@ -1112,6 +1113,7 @@ const MESSAGES = {
|
|
|
1112
1113
|
stale_preview_restarted: '桥接在该线程 {threadId} 仍处于活动状态时重启了。这张状态卡已经不再实时更新。你可以去 Codex.app 打开线程,或重新发一条消息继续。',
|
|
1113
1114
|
stale_preview_expired: '之前的实时预览在桥接停止跟踪这轮回复后已经失效。如果下方已有最终回复,请以最终回复为准;否则请重新发送消息。',
|
|
1114
1115
|
stale_user_input_interrupted: '桥接发现线程 {threadId} 有一条已经无法恢复到 Telegram 的 Codex 输入请求,已中断这条卡住的回复。请重新发送消息继续。',
|
|
1116
|
+
restart_auto_resume_prompt: 'FoxClaw 重启时上一轮回复仍在运行。请从中断处继续完成刚才的工作。',
|
|
1115
1117
|
streaming_reply_below: '回复正在下方持续输出...',
|
|
1116
1118
|
interrupt_requested_preview: '已请求中断...',
|
|
1117
1119
|
interrupt_requested_waiting: '已请求中断,正在等待 Codex 停止...',
|