@yu_robotics/remote-cli 1.6.237 → 1.6.238
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/dist/client/MessageHandler.d.ts +9 -2
- package/dist/client/MessageHandler.d.ts.map +1 -1
- package/dist/client/MessageHandler.js +202 -21
- package/dist/client/MessageHandler.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +1 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/executor/AcpExecutor.d.ts +2 -0
- package/dist/executor/AcpExecutor.d.ts.map +1 -1
- package/dist/executor/AcpExecutor.js +9 -0
- package/dist/executor/AcpExecutor.js.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.d.ts +17 -7
- package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.js +362 -58
- package/dist/executor/ClaudePersistentExecutor.js.map +1 -1
- package/dist/executor/DshExecutor.d.ts +13 -1
- package/dist/executor/DshExecutor.d.ts.map +1 -1
- package/dist/executor/DshExecutor.js +39 -1
- package/dist/executor/DshExecutor.js.map +1 -1
- package/dist/executor/IExecutor.d.ts +6 -0
- package/dist/executor/IExecutor.d.ts.map +1 -1
- package/dist/maintenance/release-notes.json +1 -1
- package/dist/scheduling/ScheduleCapabilities.d.ts +1 -1
- package/dist/scheduling/ScheduleCapabilities.d.ts.map +1 -1
- package/dist/scheduling/ScheduleCapabilities.js +3 -2
- package/dist/scheduling/ScheduleCapabilities.js.map +1 -1
- package/dist/scheduling/ScheduleService.d.ts +26 -0
- package/dist/scheduling/ScheduleService.d.ts.map +1 -1
- package/dist/scheduling/ScheduleService.js +549 -17
- package/dist/scheduling/ScheduleService.js.map +1 -1
- package/dist/scheduling/claude/ClaudeSessionSchedules.d.ts +25 -2
- package/dist/scheduling/claude/ClaudeSessionSchedules.d.ts.map +1 -1
- package/dist/scheduling/claude/ClaudeSessionSchedules.js +126 -17
- package/dist/scheduling/claude/ClaudeSessionSchedules.js.map +1 -1
- package/dist/scheduling/dsh/SessionScheduleBridge.d.ts.map +1 -1
- package/dist/scheduling/dsh/SessionScheduleBridge.js +21 -0
- package/dist/scheduling/dsh/SessionScheduleBridge.js.map +1 -1
- package/dist/scheduling/dsh/SessionScheduleClient.d.ts.map +1 -1
- package/dist/scheduling/dsh/SessionScheduleClient.js +8 -0
- package/dist/scheduling/dsh/SessionScheduleClient.js.map +1 -1
- package/dist/scheduling/types.d.ts +84 -0
- package/dist/scheduling/types.d.ts.map +1 -1
- package/dist/scheduling/types.js.map +1 -1
- package/dist/settings/SettingsService.d.ts +1 -1
- package/dist/settings/SettingsService.d.ts.map +1 -1
- package/dist/settings/SettingsService.js +3 -3
- package/dist/settings/SettingsService.js.map +1 -1
- package/dist/thread/ThreadExecutorPool.d.ts +1 -1
- package/dist/thread/ThreadExecutorPool.d.ts.map +1 -1
- package/dist/thread/ThreadExecutorPool.js +5 -3
- package/dist/thread/ThreadExecutorPool.js.map +1 -1
- package/dist/update/AutomaticUpdater.d.ts +2 -1
- package/dist/update/AutomaticUpdater.d.ts.map +1 -1
- package/dist/update/AutomaticUpdater.js +11 -3
- package/dist/update/AutomaticUpdater.js.map +1 -1
- package/native/prebuilds/darwin-arm64/managed_native.node +0 -0
- package/native/prebuilds/darwin-arm64/manifest.json +1 -1
- package/native/prebuilds/darwin-x64/managed_native.node +0 -0
- package/native/prebuilds/darwin-x64/manifest.json +1 -1
- package/native/prebuilds/win32-arm64/managed_native.node +0 -0
- package/native/prebuilds/win32-arm64/manifest.json +1 -1
- package/native/prebuilds/win32-x64/managed_native.node +0 -0
- package/native/prebuilds/win32-x64/manifest.json +1 -1
- package/package.json +1 -1
|
@@ -39,6 +39,8 @@ export declare class MessageHandler {
|
|
|
39
39
|
private readonly abortOperations;
|
|
40
40
|
private readonly pendingGoalActivations;
|
|
41
41
|
private automaticUpdateInProgress;
|
|
42
|
+
private automaticUpdateRecovering;
|
|
43
|
+
private automaticUpdateRecoveryPending;
|
|
42
44
|
private approvalCardsSupported;
|
|
43
45
|
private streamingContextSupported;
|
|
44
46
|
private delegationProgressSupported;
|
|
@@ -72,6 +74,8 @@ export declare class MessageHandler {
|
|
|
72
74
|
private readonly scheduleCards;
|
|
73
75
|
private schedules?;
|
|
74
76
|
private scheduleInitialization?;
|
|
77
|
+
private scheduleRecoveryPending;
|
|
78
|
+
private scheduleRecoveryThreads;
|
|
75
79
|
private scheduleDelivery?;
|
|
76
80
|
private readonly scheduleOwners;
|
|
77
81
|
private readonly scheduleManagement;
|
|
@@ -82,7 +86,8 @@ export declare class MessageHandler {
|
|
|
82
86
|
*/
|
|
83
87
|
handleMessage(message: Message | IncomingMessage): Promise<void>;
|
|
84
88
|
tryBeginAutomaticUpdate(): boolean;
|
|
85
|
-
|
|
89
|
+
prepareAutomaticUpdate(): Promise<void>;
|
|
90
|
+
endAutomaticUpdate(): Promise<void>;
|
|
86
91
|
/**
|
|
87
92
|
* Handle command message — route to the correct thread executor.
|
|
88
93
|
*/
|
|
@@ -217,7 +222,9 @@ export declare class MessageHandler {
|
|
|
217
222
|
private executorConfiguration;
|
|
218
223
|
private scheduleGeneration;
|
|
219
224
|
private scheduleDirectory;
|
|
220
|
-
/**
|
|
225
|
+
/** Fence the updater before connection/version callbacks can race catalog recovery. */
|
|
226
|
+
prepareScheduleStartup(): Promise<void>;
|
|
227
|
+
/** Binding recovery waits for transport readiness and never creates an absent catalog. */
|
|
221
228
|
private recoverSchedules;
|
|
222
229
|
private initializeSchedules;
|
|
223
230
|
private activeSchedules;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageHandler.d.ts","sourceRoot":"","sources":["../../src/client/MessageHandler.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAQpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAgK,MAAM,UAAU,CAAC;AACzM,OAA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AI,OAAO,CAAC,IAAI,CAAC;CA0C/B"}
|
|
@@ -163,7 +163,7 @@ class MessageHandler {
|
|
|
163
163
|
threadName: threadId => this.threadManager.getThread(threadId)?.name,
|
|
164
164
|
// Queued or pending work counts as busy: a confirmation must never redirect it into another session.
|
|
165
165
|
isBusy: threadId => this.threadPool.isThreadBusy(threadId) || this.hasThreadQueueState(threadId)
|
|
166
|
-
|| this.abortOperations.has(threadId) || this.isDestroyed || this.automaticUpdateInProgress
|
|
166
|
+
|| this.abortOperations.has(threadId) || this.scheduleRecoveryThreads.has(threadId) || this.isDestroyed || this.automaticUpdateInProgress
|
|
167
167
|
|| this.delegation.hasActiveTasks(threadId) || this.settingsAdmission.hasCommand(threadId),
|
|
168
168
|
setBusy: (threadId, busy) => {
|
|
169
169
|
if (busy) {
|
|
@@ -189,6 +189,8 @@ class MessageHandler {
|
|
|
189
189
|
abortOperations = new Map();
|
|
190
190
|
pendingGoalActivations = new Map();
|
|
191
191
|
automaticUpdateInProgress = false;
|
|
192
|
+
automaticUpdateRecovering = false;
|
|
193
|
+
automaticUpdateRecoveryPending = false;
|
|
192
194
|
approvalCardsSupported = false;
|
|
193
195
|
streamingContextSupported = false;
|
|
194
196
|
delegationProgressSupported = false;
|
|
@@ -222,6 +224,8 @@ class MessageHandler {
|
|
|
222
224
|
scheduleCards;
|
|
223
225
|
schedules;
|
|
224
226
|
scheduleInitialization;
|
|
227
|
+
scheduleRecoveryPending = false;
|
|
228
|
+
scheduleRecoveryThreads = new Set();
|
|
225
229
|
scheduleDelivery;
|
|
226
230
|
scheduleOwners = new Map();
|
|
227
231
|
scheduleManagement = new Set();
|
|
@@ -247,7 +251,7 @@ class MessageHandler {
|
|
|
247
251
|
cancel: (owner, id) => this.schedules.cancel(owner, id),
|
|
248
252
|
exclusive: async (owner, body) => {
|
|
249
253
|
if (!this.schedules || this.isDestroyed || this.automaticUpdateInProgress
|
|
250
|
-
|| this.scheduleManagement.has(owner.threadId))
|
|
254
|
+
|| this.scheduleRecoveryThreads.has(owner.threadId) || this.scheduleManagement.has(owner.threadId))
|
|
251
255
|
throw new Error('Schedule controls are busy.');
|
|
252
256
|
this.scheduleManagement.add(owner.threadId);
|
|
253
257
|
try {
|
|
@@ -306,7 +310,7 @@ class MessageHandler {
|
|
|
306
310
|
const config = this.executorConfiguration();
|
|
307
311
|
return this.settingsCatalogReader.read(config, thread, this.threadPool.getBackendKey(id), target, kind, this.modelSpeedSettingsSupported);
|
|
308
312
|
},
|
|
309
|
-
busy: (id, except, queue = true) => this.settingsBusy(id, except, queue),
|
|
313
|
+
busy: (id, except, queue = true, setting) => this.settingsBusy(id, except, queue, setting),
|
|
310
314
|
threads: () => this.threadManager.listThreads().map(thread => thread.id),
|
|
311
315
|
exclusive: async (target, body) => {
|
|
312
316
|
try {
|
|
@@ -529,6 +533,8 @@ class MessageHandler {
|
|
|
529
533
|
const hasQueuedCommands = Array.from(this.threadQueues.values()).some((queue) => queue.length > 0);
|
|
530
534
|
const hasRunningThread = this.threadPool.getSummaries().some((thread) => thread.status === 'running');
|
|
531
535
|
if (this.automaticUpdateInProgress
|
|
536
|
+
|| this.isDestroyed
|
|
537
|
+
|| this.scheduleRecoveryPending
|
|
532
538
|
|| this.wsClient.hasPendingTaskResults()
|
|
533
539
|
|| hasRunningThread
|
|
534
540
|
|| hasQueuedCommands
|
|
@@ -536,15 +542,59 @@ class MessageHandler {
|
|
|
536
542
|
|| this.pendingReplaces.size > 0
|
|
537
543
|
|| this.activeThreadOperations.size > 0
|
|
538
544
|
|| this.abortOperations.size > 0
|
|
539
|
-
|| this.scheduleManagement.size > 0 || this.schedules?.hasActiveSchedules()
|
|
545
|
+
|| this.scheduleManagement.size > 0 || this.schedules?.hasActiveSchedules() && !this.schedules.canSuspendForRestart()
|
|
540
546
|
|| this.threadManager.listThreads().some(thread => this.settingsAdmission.isBlocked(thread.id))) {
|
|
541
547
|
return false;
|
|
542
548
|
}
|
|
543
549
|
this.automaticUpdateInProgress = true;
|
|
544
550
|
return true;
|
|
545
551
|
}
|
|
546
|
-
|
|
547
|
-
this.automaticUpdateInProgress
|
|
552
|
+
async prepareAutomaticUpdate() {
|
|
553
|
+
if (!this.automaticUpdateInProgress || this.isDestroyed)
|
|
554
|
+
throw new Error('Automatic update admission expired.');
|
|
555
|
+
if (this.schedules?.hasActiveSchedules())
|
|
556
|
+
await this.schedules.suspendForRestart();
|
|
557
|
+
if (this.wsClient.hasPendingTaskResults())
|
|
558
|
+
throw new Error('Result delivery remains pending.');
|
|
559
|
+
}
|
|
560
|
+
async endAutomaticUpdate() {
|
|
561
|
+
if (this.schedules?.hasUnresolvedHandoff())
|
|
562
|
+
throw new Error('Native restart handoff remains unresolved; update admission is retained.');
|
|
563
|
+
if (!this.schedules?.hasPendingRecovery()) {
|
|
564
|
+
if (this.schedules?.hasUnresolvedRecovery())
|
|
565
|
+
throw new Error('Native recovery remains blocked; update admission is retained.');
|
|
566
|
+
// Terminal-only handoffs still own the predecessor's local admission fence.
|
|
567
|
+
// No job needs recreation, but the shared recovery finalizer must release it.
|
|
568
|
+
if (this.schedules) {
|
|
569
|
+
this.automaticUpdateRecovering = true;
|
|
570
|
+
try {
|
|
571
|
+
await this.schedules.recover();
|
|
572
|
+
}
|
|
573
|
+
finally {
|
|
574
|
+
this.automaticUpdateRecovering = false;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
this.automaticUpdateInProgress = false;
|
|
578
|
+
this.automaticUpdateRecoveryPending = false;
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
if (this.isDestroyed)
|
|
582
|
+
throw new Error('Shutdown already began; native schedules require startup recovery.');
|
|
583
|
+
// Only finalization authorizes restoration. Reconnect during installation must
|
|
584
|
+
// never restart native timing under the still-active installer.
|
|
585
|
+
this.automaticUpdateRecoveryPending = true;
|
|
586
|
+
this.automaticUpdateRecovering = true;
|
|
587
|
+
try {
|
|
588
|
+
await this.schedules.recover();
|
|
589
|
+
if (this.schedules.hasUnresolvedRecovery()) {
|
|
590
|
+
throw new Error('Native schedule restoration remains unresolved; update admission is retained.');
|
|
591
|
+
}
|
|
592
|
+
this.automaticUpdateInProgress = false;
|
|
593
|
+
this.automaticUpdateRecoveryPending = false;
|
|
594
|
+
}
|
|
595
|
+
finally {
|
|
596
|
+
this.automaticUpdateRecovering = false;
|
|
597
|
+
}
|
|
548
598
|
}
|
|
549
599
|
/**
|
|
550
600
|
* Handle command message — route to the correct thread executor.
|
|
@@ -552,6 +602,21 @@ class MessageHandler {
|
|
|
552
602
|
async handleCommandMessage(message, fileOrder) {
|
|
553
603
|
const threadId = message.threadId ?? this.threadManager.getDefaultThread().id;
|
|
554
604
|
const content = message.content?.trim() ?? '';
|
|
605
|
+
if (this.automaticUpdateInProgress && content === '/schedule list') {
|
|
606
|
+
this.messageOpenIds.set(message.messageId, message.openId);
|
|
607
|
+
await this.handleScheduleCommand(message, threadId);
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
if (this.scheduleRecoveryThreads.has(threadId)
|
|
611
|
+
|| this.scheduleRecoveryThreads.size > 0 && /^\/backend\s/.test(content) && !/\s@$/.test(content)) {
|
|
612
|
+
this.sendResponse(message.messageId, threadId, { success: false,
|
|
613
|
+
error: 'Native schedule recovery is in progress. Retry after reconciliation finishes.' });
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
if (this.scheduleRecoveryPending && /^\/(?:clear|new|backend|cd|thread\s+delete)(?:\s|$)/.test(content)) {
|
|
617
|
+
this.sendResponse(message.messageId, threadId, { success: false, error: 'Schedule catalog readiness is unresolved. Retry context changes after recovery or inspect /schedule list.' });
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
555
620
|
const clearing = content === '/clear' || content === '/new';
|
|
556
621
|
const management = content === '/abort' || /^\/thread(?:\s+list)?$/.test(content) || /^\/thread\s+new(?:\s|$)/.test(content);
|
|
557
622
|
let admissionCurrent = () => true;
|
|
@@ -573,6 +638,10 @@ class MessageHandler {
|
|
|
573
638
|
return this.handleAdmittedCommandMessage(message, fileOrder, () => admissionCurrent());
|
|
574
639
|
};
|
|
575
640
|
this.messageOpenIds.set(message.messageId, message.openId);
|
|
641
|
+
if ((0, SessionResumeService_1.isSessionControl)(content) && this.automaticUpdateInProgress) {
|
|
642
|
+
this.sendResponse(message.messageId, threadId, { success: false, error: 'Automatic update handoff is in progress. Retry after it finishes.' });
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
576
645
|
if ((0, SessionResumeService_1.isSessionControl)(content)) {
|
|
577
646
|
if (!this.threadManager.getThread(threadId)) {
|
|
578
647
|
this.sendResponse(message.messageId, undefined, { success: false, error: 'The selected thread no longer exists.' });
|
|
@@ -666,6 +735,11 @@ class MessageHandler {
|
|
|
666
735
|
return;
|
|
667
736
|
}
|
|
668
737
|
const resolvedThreadId = thread.id;
|
|
738
|
+
if (this.scheduleRecoveryThreads.has(resolvedThreadId)) {
|
|
739
|
+
this.sendResponse(messageId, resolvedThreadId, { success: false,
|
|
740
|
+
error: 'Native schedule recovery is in progress for this thread. Retry after reconciliation finishes.' });
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
669
743
|
if (this.automaticUpdateInProgress) {
|
|
670
744
|
this.sendResponse(messageId, resolvedThreadId, {
|
|
671
745
|
success: false,
|
|
@@ -877,7 +951,8 @@ class MessageHandler {
|
|
|
877
951
|
}
|
|
878
952
|
if (!admissionCurrent())
|
|
879
953
|
return;
|
|
880
|
-
const threadBusy =
|
|
954
|
+
const threadBusy = /^\/model\s+\S/.test(settingsCommand)
|
|
955
|
+
? this.threadPool.isThreadBusy(resolvedThreadId, 'model') : this.threadPool.isThreadBusy(resolvedThreadId);
|
|
881
956
|
const queuedCount = this.threadQueues.get(resolvedThreadId)?.length ?? 0;
|
|
882
957
|
if (!threadBusy && !this.hasThreadQueueState(resolvedThreadId))
|
|
883
958
|
this.pausedQueues.delete(resolvedThreadId);
|
|
@@ -1001,6 +1076,11 @@ class MessageHandler {
|
|
|
1001
1076
|
* Handle /abort command for a specific thread executor
|
|
1002
1077
|
*/
|
|
1003
1078
|
async handleAbortCommand(messageId, threadId, executor) {
|
|
1079
|
+
if (executor?.hasPendingSettingsChange?.()) {
|
|
1080
|
+
this.sendResponse(messageId, threadId, { success: false,
|
|
1081
|
+
error: 'Native settings change is pending or unconfirmed. Wait for its reply or retry the setting after a terminal error. /clear is destructive recovery and loses session-only schedules.' });
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1004
1084
|
this.conversationRevisions.set(threadId, (this.conversationRevisions.get(threadId) ?? 0) + 1);
|
|
1005
1085
|
this.settingsAdmission.cancelRecoverable(threadId);
|
|
1006
1086
|
this.fileInbox?.cancelThread(threadId);
|
|
@@ -1159,7 +1239,8 @@ class MessageHandler {
|
|
|
1159
1239
|
async clearThreadConversation(messageId, threadId) {
|
|
1160
1240
|
if (this.abortOperations.has(threadId))
|
|
1161
1241
|
throw new Error('Direct backend abort is still pending; retry /clear after it settles.');
|
|
1162
|
-
const
|
|
1242
|
+
const existing = this.threadPool.getExistingExecutor(threadId);
|
|
1243
|
+
const destructiveRecovery = existing?.hasPendingCancellation?.() === true || existing?.hasPendingSettingsChange?.() === true;
|
|
1163
1244
|
if (!destructiveRecovery)
|
|
1164
1245
|
await this.assertSchedulesIdle(threadId);
|
|
1165
1246
|
this.conversationRevisions.set(threadId, (this.conversationRevisions.get(threadId) ?? 0) + 1);
|
|
@@ -1733,7 +1814,7 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
1733
1814
|
async startNextQueuedCommand(threadId) {
|
|
1734
1815
|
if (this.settingsAdmission.isBlocked(threadId))
|
|
1735
1816
|
return;
|
|
1736
|
-
if (this.threadPool.isThreadBusy(threadId) || this.pausedQueues.has(threadId) || this.abortOperations.has(threadId))
|
|
1817
|
+
if (this.scheduleRecoveryThreads.has(threadId) || this.threadPool.isThreadBusy(threadId) || this.pausedQueues.has(threadId) || this.abortOperations.has(threadId))
|
|
1737
1818
|
return;
|
|
1738
1819
|
const queue = this.threadQueues.get(threadId);
|
|
1739
1820
|
const command = queue?.shift();
|
|
@@ -3344,7 +3425,24 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3344
3425
|
})).digest('hex');
|
|
3345
3426
|
return path_1.default.join(directory, 'schedules', namespace);
|
|
3346
3427
|
}
|
|
3347
|
-
/**
|
|
3428
|
+
/** Fence the updater before connection/version callbacks can race catalog recovery. */
|
|
3429
|
+
async prepareScheduleStartup() {
|
|
3430
|
+
const directory = this.scheduleDirectory();
|
|
3431
|
+
if (!directory)
|
|
3432
|
+
return;
|
|
3433
|
+
this.scheduleRecoveryPending = true;
|
|
3434
|
+
try {
|
|
3435
|
+
await fs_1.default.promises.lstat(path_1.default.join(directory, ScheduleService_1.SCHEDULE_CATALOG_FILE));
|
|
3436
|
+
}
|
|
3437
|
+
catch (error) {
|
|
3438
|
+
if (['ENOENT', 'ENOTDIR'].includes(error.code ?? '')) {
|
|
3439
|
+
this.scheduleRecoveryPending = false;
|
|
3440
|
+
return;
|
|
3441
|
+
}
|
|
3442
|
+
throw error;
|
|
3443
|
+
}
|
|
3444
|
+
}
|
|
3445
|
+
/** Binding recovery waits for transport readiness and never creates an absent catalog. */
|
|
3348
3446
|
async recoverSchedules() {
|
|
3349
3447
|
if (this.isDestroyed || !this.scheduleResultsSupported)
|
|
3350
3448
|
return;
|
|
@@ -3365,9 +3463,17 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3365
3463
|
// create a late service/subscription after shutdown has collected its work.
|
|
3366
3464
|
if (this.isDestroyed || !this.scheduleResultsSupported)
|
|
3367
3465
|
return;
|
|
3466
|
+
this.scheduleRecoveryPending = true;
|
|
3368
3467
|
const service = await this.initializeSchedules();
|
|
3369
|
-
if (!this.isDestroyed && this.scheduleResultsSupported)
|
|
3468
|
+
if (!this.isDestroyed && this.scheduleResultsSupported) {
|
|
3469
|
+
if (this.automaticUpdateRecoveryPending && !this.automaticUpdateRecovering) {
|
|
3470
|
+
await this.endAutomaticUpdate();
|
|
3471
|
+
}
|
|
3472
|
+
else
|
|
3473
|
+
await service.recover();
|
|
3370
3474
|
await service.retryDeliveries();
|
|
3475
|
+
this.scheduleRecoveryPending = false;
|
|
3476
|
+
}
|
|
3371
3477
|
}
|
|
3372
3478
|
initializeSchedules() {
|
|
3373
3479
|
if (this.scheduleInitialization)
|
|
@@ -3380,7 +3486,67 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3380
3486
|
throw new Error('Local schedule storage is unavailable.');
|
|
3381
3487
|
const service = new ScheduleService_1.ScheduleService({
|
|
3382
3488
|
directory,
|
|
3383
|
-
|
|
3489
|
+
acquireRecovery: record => {
|
|
3490
|
+
if (this.scheduleRecoveryThreads.has(record.threadId))
|
|
3491
|
+
throw new Error('Recovery thread admission unavailable.');
|
|
3492
|
+
this.scheduleRecoveryThreads.add(record.threadId);
|
|
3493
|
+
return () => { this.scheduleRecoveryThreads.delete(record.threadId); };
|
|
3494
|
+
},
|
|
3495
|
+
canRecover: record => {
|
|
3496
|
+
try {
|
|
3497
|
+
if (this.isDestroyed || this.automaticUpdateInProgress && !this.automaticUpdateRecovering || !this.scheduleResultsSupported || !this.wsClient.isConnected()
|
|
3498
|
+
|| this.scheduleGeneration(record.threadId) !== record.generation
|
|
3499
|
+
|| this.threadPool.getBackendKey(record.threadId) !== record.backend)
|
|
3500
|
+
return false;
|
|
3501
|
+
const thread = this.threadManager.getThread(record.threadId);
|
|
3502
|
+
const configuration = this.executorConfiguration();
|
|
3503
|
+
if (record.execution?.command !== configuration[record.backend]?.command)
|
|
3504
|
+
return false;
|
|
3505
|
+
const cwd = this.directoryGuard.resolveWorkingDirectory(thread.workingDirectory);
|
|
3506
|
+
(0, WorkingDirectory_1.assertWorkingDirectoryExists)(cwd);
|
|
3507
|
+
if (cwd !== record.cwd || this.threadPool.isThreadBusy(record.threadId) && !this.scheduleRecoveryThreads.has(record.threadId)
|
|
3508
|
+
|| this.activeThreadOperations.has(record.threadId) || this.scheduleManagement.has(record.threadId)
|
|
3509
|
+
|| this.abortOperations.has(record.threadId) || this.coordinatorPreparations.has(record.threadId)
|
|
3510
|
+
|| this.settingsAdmission.isBlocked(record.threadId) || this.settingsAdmission.hasCommand(record.threadId)
|
|
3511
|
+
|| this.hasThreadQueueState(record.threadId) || this.delegation.hasActiveTasks(record.threadId))
|
|
3512
|
+
return false;
|
|
3513
|
+
this.scheduleOwners.set(record.threadId, { threadId: record.threadId, openId: record.openId, generation: record.generation });
|
|
3514
|
+
return true;
|
|
3515
|
+
}
|
|
3516
|
+
catch {
|
|
3517
|
+
return false;
|
|
3518
|
+
}
|
|
3519
|
+
},
|
|
3520
|
+
provider: { recoveryFor: input => {
|
|
3521
|
+
if (!input.threadId || this.threadPool.getBackendKey(input.threadId) !== input.backend)
|
|
3522
|
+
return undefined;
|
|
3523
|
+
// Capability lookup never starts native work. Native adapters opt in only
|
|
3524
|
+
// when they implement inventory reconciliation and original-session ownership.
|
|
3525
|
+
const executor = this.threadPool.getExecutor(input.threadId);
|
|
3526
|
+
const capability = executor.nativeScheduleRecovery;
|
|
3527
|
+
if (!capability)
|
|
3528
|
+
return undefined;
|
|
3529
|
+
return { ...capability, reconcile: async (record, context, emit) => {
|
|
3530
|
+
if (!context.isCurrent())
|
|
3531
|
+
throw new Error('Schedule recovery context changed.');
|
|
3532
|
+
if (executor.configureManagedTools) {
|
|
3533
|
+
const bridge = this.delegationBridges.get(record.threadId) ?? new DelegationBridge_1.DelegationBridge();
|
|
3534
|
+
this.delegationBridges.set(record.threadId, bridge);
|
|
3535
|
+
const thread = this.threadManager.getThread(record.threadId);
|
|
3536
|
+
const connection = await bridge.start((0, DelegationSettings_1.isDelegationEnabled)(thread) ? ['delegation', 'scheduling'] : ['scheduling']);
|
|
3537
|
+
if (!context.isCurrent())
|
|
3538
|
+
throw new Error('Schedule recovery context changed.');
|
|
3539
|
+
await executor.configureManagedTools(connection);
|
|
3540
|
+
}
|
|
3541
|
+
if (!context.isCurrent())
|
|
3542
|
+
throw new Error('Schedule recovery context changed.');
|
|
3543
|
+
return capability.reconcile(record, context, event => {
|
|
3544
|
+
emit(event);
|
|
3545
|
+
if (event.type === 'completed')
|
|
3546
|
+
queueMicrotask(() => { void this.startNextQueuedCommand(record.threadId); });
|
|
3547
|
+
});
|
|
3548
|
+
} };
|
|
3549
|
+
}, create: (input, onEvent) => {
|
|
3384
3550
|
const backend = input.backend === undefined ? 'claude' : input.backend;
|
|
3385
3551
|
(0, ScheduleCapabilities_1.assertNativeScheduleBackend)(backend);
|
|
3386
3552
|
if (!input.threadId)
|
|
@@ -3487,8 +3653,8 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3487
3653
|
return false;
|
|
3488
3654
|
}
|
|
3489
3655
|
};
|
|
3490
|
-
const check = () => { if (!current() || this.automaticUpdateInProgress)
|
|
3491
|
-
throw new Error('Scheduling context changed or client is shutting down/updating.'); };
|
|
3656
|
+
const check = () => { if (!current() || this.automaticUpdateInProgress || this.scheduleRecoveryThreads.has(owner.threadId))
|
|
3657
|
+
throw new Error('Scheduling context changed or client is shutting down/updating/recovering.'); };
|
|
3492
3658
|
check();
|
|
3493
3659
|
if (command.kind === 'list' && this.threadPool.getExistingExecutor(owner.threadId)?.hasPendingCancellation?.()) {
|
|
3494
3660
|
const service = await this.initializeSchedules();
|
|
@@ -3634,7 +3800,9 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3634
3800
|
}
|
|
3635
3801
|
const owner = { threadId, openId: message.openId, generation: this.scheduleGeneration(threadId) };
|
|
3636
3802
|
const storedOnly = command.kind === 'list' && this.threadPool.getExistingExecutor(threadId)?.hasPendingCancellation?.();
|
|
3637
|
-
const
|
|
3803
|
+
const updateSnapshot = this.automaticUpdateInProgress && command.kind === 'list';
|
|
3804
|
+
const records = updateSnapshot ? await this.schedules?.list(owner) ?? []
|
|
3805
|
+
: await this.runScheduleOperation(owner, command.kind === 'list' ? { kind: 'list' } : command);
|
|
3638
3806
|
const record = records[0];
|
|
3639
3807
|
let output;
|
|
3640
3808
|
if (command.kind === 'list')
|
|
@@ -3642,14 +3810,18 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3642
3810
|
else if (command.kind === 'cancel')
|
|
3643
3811
|
output = `Schedule ${record.id}: ${record.state}.`;
|
|
3644
3812
|
else {
|
|
3645
|
-
const lifecycle = record.
|
|
3646
|
-
?
|
|
3647
|
-
|
|
3813
|
+
const lifecycle = record.recovery
|
|
3814
|
+
? `Managed jobs recover automatically after a confirmed orderly restart. Dirty shutdowns remain blocked. ${record.recovery.handoffPolicy === 'skip-unadmitted'
|
|
3815
|
+
? 'Fired occurrences not yet admitted to execution may be skipped without replay; admitted work must finish.'
|
|
3816
|
+
: 'Queued and executing occurrences must finish before handoff.'}`
|
|
3817
|
+
: 'This host does not support automatic schedule recovery after process exit.';
|
|
3648
3818
|
output = `Schedule ${record.id}: ${record.state}.\n${record.rule.kind === 'once' ? record.rule.at : `${record.rule.expression} (${record.rule.timezone})`}\n\nRuns in this thread's foreground ${ScheduleCapabilities_1.NATIVE_SCHEDULE_CAPABILITIES[record.backend].label} conversation and returns results here. Keep the CLI running; native timing is approximate. ${lifecycle}\nUse /schedule list or /schedule cancel ${record.id}.`;
|
|
3649
3819
|
}
|
|
3650
3820
|
if (storedOnly)
|
|
3651
3821
|
output = `Native cancellation cleanup is pending. This is the stored catalog, not a fresh native inventory. Retry /abort; /clear stops the host and loses session-only schedules.\n\n${output}`;
|
|
3652
|
-
|
|
3822
|
+
if (updateSnapshot)
|
|
3823
|
+
output = `Automatic update handoff: stored catalog only, not fresh native inventory. Unconfirmed work remains fenced; inspect the CLI diagnostic before an explicit service stop/restart.\n\n${output}`;
|
|
3824
|
+
respond({ success: true, scheduleMenu: updateSnapshot ? undefined : menuFor(owner, records), output });
|
|
3653
3825
|
}
|
|
3654
3826
|
catch (error) {
|
|
3655
3827
|
respond({ success: false, error: error instanceof Error ? error.message : 'Schedule operation failed.' });
|
|
@@ -3686,8 +3858,8 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3686
3858
|
followsGlobal: !thread.backend, configuredModels, configuredEfforts: { ...thread.efforts }, delegationEnabled: (0, DelegationSettings_1.isDelegationEnabled)(thread),
|
|
3687
3859
|
revision: (0, crypto_1.createHash)('sha256').update(JSON.stringify({ thread: projection(thread), all, config: this.executorConfiguration() })).digest('hex') };
|
|
3688
3860
|
}
|
|
3689
|
-
settingsBusy(threadId, exceptRequest, includeQueue = true) {
|
|
3690
|
-
return this.isDestroyed || this.automaticUpdateInProgress || this.threadPool.isThreadBusy(threadId)
|
|
3861
|
+
settingsBusy(threadId, exceptRequest, includeQueue = true, setting) {
|
|
3862
|
+
return this.isDestroyed || this.automaticUpdateInProgress || this.scheduleRecoveryThreads.has(threadId) || (setting === 'model' ? this.threadPool.isThreadBusy(threadId, 'model') : this.threadPool.isThreadBusy(threadId))
|
|
3691
3863
|
|| this.delegation.hasActiveTasks(threadId) || this.abortOperations.has(threadId)
|
|
3692
3864
|
|| this.coordinatorPreparations.has(threadId) || this.settingsAdmission.hasCommand(threadId, exceptRequest) || (includeQueue && this.hasThreadQueueState(threadId));
|
|
3693
3865
|
}
|
|
@@ -3970,6 +4142,12 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3970
4142
|
* Destroy handler and all executors
|
|
3971
4143
|
*/
|
|
3972
4144
|
async destroy() {
|
|
4145
|
+
// Fence new commands first, but keep result acknowledgements alive while a
|
|
4146
|
+
// waiting schedule races the orderly drain. No foreground work is killed here.
|
|
4147
|
+
if (!this.isDestroyed && this.schedules?.hasActiveSchedules() && this.schedules.canSuspendForRestart()) {
|
|
4148
|
+
this.automaticUpdateInProgress = true;
|
|
4149
|
+
await this.schedules.suspendForRestart();
|
|
4150
|
+
}
|
|
3973
4151
|
this.directoryBrowser.destroy();
|
|
3974
4152
|
this.settingsService.destroy();
|
|
3975
4153
|
this.scheduleCards.destroy();
|
|
@@ -3988,6 +4166,9 @@ You can also use natural language commands to control Claude Code CLI.`,
|
|
|
3988
4166
|
await this.outputFiles?.destroy();
|
|
3989
4167
|
this.notificationAdapter.unregister();
|
|
3990
4168
|
try {
|
|
4169
|
+
// Native recovery handoff must finish before executor destruction can stop
|
|
4170
|
+
// its original host. An uncertain handoff keeps that host owned for retry.
|
|
4171
|
+
await this.scheduleInitialization?.then(service => service.requiresShutdownHandoff() ? service.destroy() : undefined, () => undefined);
|
|
3991
4172
|
const results = await Promise.allSettled([
|
|
3992
4173
|
this.scheduleInitialization?.then(service => service.destroy(), () => undefined),
|
|
3993
4174
|
this.delegation.destroy(),
|