@yu_robotics/remote-cli 1.6.239 → 1.6.241
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 +4 -0
- package/dist/client/MessageHandler.d.ts.map +1 -1
- package/dist/client/MessageHandler.js +127 -15
- package/dist/client/MessageHandler.js.map +1 -1
- package/dist/delegation/ArtifactCloseoutContinuation.d.ts +14 -0
- package/dist/delegation/ArtifactCloseoutContinuation.d.ts.map +1 -0
- package/dist/delegation/ArtifactCloseoutContinuation.js +37 -0
- package/dist/delegation/ArtifactCloseoutContinuation.js.map +1 -0
- package/dist/delegation/DelegationManager.d.ts +0 -1
- package/dist/delegation/DelegationManager.d.ts.map +1 -1
- package/dist/delegation/DelegationManager.js +1 -1
- package/dist/delegation/DelegationManager.js.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.d.ts +6 -1
- package/dist/executor/ClaudePersistentExecutor.d.ts.map +1 -1
- package/dist/executor/ClaudePersistentExecutor.js +127 -34
- package/dist/executor/ClaudePersistentExecutor.js.map +1 -1
- package/dist/executor/DshExecutor.d.ts +1 -0
- package/dist/executor/DshExecutor.d.ts.map +1 -1
- package/dist/executor/IExecutor.d.ts +3 -1
- package/dist/executor/IExecutor.d.ts.map +1 -1
- package/dist/maintenance/release-notes.json +1 -1
- package/dist/managed/tools.d.ts +18 -0
- package/dist/managed/tools.d.ts.map +1 -1
- package/dist/scheduling/ReviewedNativeCleanup.d.ts +44 -0
- package/dist/scheduling/ReviewedNativeCleanup.d.ts.map +1 -0
- package/dist/scheduling/ReviewedNativeCleanup.js +165 -0
- package/dist/scheduling/ReviewedNativeCleanup.js.map +1 -0
- package/dist/scheduling/ScheduleCommand.d.ts +8 -0
- package/dist/scheduling/ScheduleCommand.d.ts.map +1 -1
- package/dist/scheduling/ScheduleCommand.js +15 -0
- package/dist/scheduling/ScheduleCommand.js.map +1 -1
- package/dist/scheduling/ScheduleService.d.ts +6 -0
- package/dist/scheduling/ScheduleService.d.ts.map +1 -1
- package/dist/scheduling/ScheduleService.js +84 -8
- package/dist/scheduling/ScheduleService.js.map +1 -1
- package/dist/scheduling/ScheduleToolScope.d.ts +3 -0
- package/dist/scheduling/ScheduleToolScope.d.ts.map +1 -1
- package/dist/scheduling/ScheduleToolScope.js +10 -0
- package/dist/scheduling/ScheduleToolScope.js.map +1 -1
- package/dist/scheduling/claude/ClaudeScheduleOwnership.d.ts +9 -0
- package/dist/scheduling/claude/ClaudeScheduleOwnership.d.ts.map +1 -1
- package/dist/scheduling/claude/ClaudeScheduleOwnership.js +39 -0
- package/dist/scheduling/claude/ClaudeScheduleOwnership.js.map +1 -1
- package/dist/scheduling/claude/ClaudeSessionSchedules.d.ts +14 -1
- package/dist/scheduling/claude/ClaudeSessionSchedules.d.ts.map +1 -1
- package/dist/scheduling/claude/ClaudeSessionSchedules.js +111 -7
- package/dist/scheduling/claude/ClaudeSessionSchedules.js.map +1 -1
- package/dist/scheduling/toolContract.d.ts +9 -0
- package/dist/scheduling/toolContract.d.ts.map +1 -1
- package/dist/scheduling/toolContract.js +1 -0
- package/dist/scheduling/toolContract.js.map +1 -1
- package/dist/scheduling/types.d.ts +15 -1
- package/dist/scheduling/types.d.ts.map +1 -1
- package/dist/scheduling/types.js +5 -1
- package/dist/scheduling/types.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
|
@@ -339,6 +339,33 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
339
339
|
return {
|
|
340
340
|
provider: 'claude-session-skip-unadmitted-v1', strategy: 'reconstruct', orderlyOnly: true, futureOnly: true,
|
|
341
341
|
handoffPolicy: 'skip-unadmitted',
|
|
342
|
+
cancelRetained: async (record, context) => {
|
|
343
|
+
const identity = JSON.parse(record.recovery.identity);
|
|
344
|
+
const child = this.claudeProcess, epoch = this.stopEpoch;
|
|
345
|
+
const current = () => context.isCurrent() && !this.isDestroyed && !this.isStopping
|
|
346
|
+
&& !!child && this.claudeProcess === child && this.stopEpoch === epoch && this.sessionId === identity.sessionId
|
|
347
|
+
&& record.cwd === this.currentWorkingDirectory && record.threadId === this.threadId
|
|
348
|
+
&& identity.cwd === this.currentWorkingDirectory && identity.threadId === this.threadId
|
|
349
|
+
&& identity.model === this.model && identity.effort === this.effort
|
|
350
|
+
&& !!identity.effectiveModel && identity.effectiveModel === (this.acknowledgedModel || this.reportedModel || this.model)
|
|
351
|
+
&& this.scheduleHooksReady && this.turnLedger.supported(child.pid) && !this.modelChange
|
|
352
|
+
&& !this.retainedAbort && !this.abortOperation && !this.hasUncertainShutdown();
|
|
353
|
+
if (!record.nativeId || !identity.sessionId || !current()) {
|
|
354
|
+
throw new Error('Native cancellation requires the matching original session, model and supported current host. Open that thread and retry the full managed schedule ID; no replacement was created.');
|
|
355
|
+
}
|
|
356
|
+
const ownership = this.scheduleHostOwnership();
|
|
357
|
+
const predecessorConfirmed = ownership.cancellationProof();
|
|
358
|
+
const timezone = await this.readNativeScheduleTimezone();
|
|
359
|
+
if (!current())
|
|
360
|
+
throw new Error('Native cancellation host changed.');
|
|
361
|
+
await this.schedules().cancelRetained({ id: record.id, threadId: record.threadId, backend: 'claude',
|
|
362
|
+
cwd: record.cwd, prompt: record.prompt, rule: record.rule, recovery: record.recovery }, record.nativeId, current, timezone);
|
|
363
|
+
if (!current())
|
|
364
|
+
throw new Error('Native cancellation host changed after deletion.');
|
|
365
|
+
if (!predecessorConfirmed || !ownership.cancellationProof()) {
|
|
366
|
+
throw new Error('Owned future definition is absent on the current host, but predecessor work remains unconfirmed in this boot. Cancellation intent is retained; do not recreate the job. Review predecessor ownership before claiming complete cleanup.');
|
|
367
|
+
}
|
|
368
|
+
},
|
|
342
369
|
describe: input => JSON.stringify({ marker: (0, crypto_1.randomUUID)(), sessionId: this.sessionId,
|
|
343
370
|
cwd: input.cwd, threadId: this.threadId, model: this.model, effort: this.effort,
|
|
344
371
|
effectiveModel: this.acknowledgedModel || this.reportedModel || this.model }),
|
|
@@ -350,22 +377,31 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
350
377
|
this.scheduleRestart = undefined;
|
|
351
378
|
},
|
|
352
379
|
reconcile: async (record, context, emit) => {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
380
|
+
let identity;
|
|
381
|
+
let clean;
|
|
382
|
+
// Only this synchronous preflight can certify that no native admission
|
|
383
|
+
// began. Failures after host startup retain the ordinary uncertainty fence.
|
|
384
|
+
try {
|
|
385
|
+
identity = JSON.parse(record.recovery.identity);
|
|
386
|
+
clean = record.recovery?.handoff === 'clean' && record.recovery.nativeDefinitionAbsent;
|
|
387
|
+
if ((!clean && (!record.recovery?.futureOnly || record.rule.kind !== 'cron'))
|
|
388
|
+
|| record.recovery?.handoffPolicy !== 'skip-unadmitted' || !context.isCurrent()
|
|
389
|
+
|| context.signal.aborted || !identity.sessionId || identity.sessionId !== this.sessionId
|
|
390
|
+
|| identity.cwd !== this.currentWorkingDirectory || identity.threadId !== this.threadId
|
|
391
|
+
|| identity.model !== this.model || identity.effort !== this.effort) {
|
|
392
|
+
throw new Error('Original Claude context or recovery evidence changed.');
|
|
393
|
+
}
|
|
394
|
+
if (this.scheduleRestart && !this.scheduleRestart.exit)
|
|
395
|
+
throw new Error('Claude predecessor exit is unconfirmed.');
|
|
396
|
+
this.scheduleRestart = undefined;
|
|
397
|
+
const ownership = this.scheduleHostOwnership();
|
|
398
|
+
ownership.reserve(!!clean);
|
|
399
|
+
if (!clean)
|
|
400
|
+
ownership.assertRebootRecovery();
|
|
401
|
+
}
|
|
402
|
+
catch (error) {
|
|
403
|
+
throw new types_1.NativeScheduleNotAdmittedError(error instanceof Error ? error.message : 'Native recovery preflight refused admission.');
|
|
361
404
|
}
|
|
362
|
-
if (this.scheduleRestart && !this.scheduleRestart.exit)
|
|
363
|
-
throw new Error('Claude predecessor exit is unconfirmed.');
|
|
364
|
-
this.scheduleRestart = undefined;
|
|
365
|
-
const ownership = this.scheduleHostOwnership();
|
|
366
|
-
ownership.reserve(!!clean);
|
|
367
|
-
if (!clean)
|
|
368
|
-
ownership.assertRebootRecovery();
|
|
369
405
|
const restoration = {};
|
|
370
406
|
this.scheduleRestoring = restoration;
|
|
371
407
|
const epoch = this.stopEpoch;
|
|
@@ -396,7 +432,7 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
396
432
|
const timezone = await this.readNativeScheduleTimezone();
|
|
397
433
|
if (!current() || this.claudeProcess !== child)
|
|
398
434
|
throw new Error('Claude recovery host changed.');
|
|
399
|
-
handle = await adapter.inToolOperation(`restore-${record.id}`, current, () => adapter.create(input, emit, context.isOwnerCurrent ?? context.isCurrent, timezone, clean ? 'adopt' : 'adopt-existing', record.nativeId), false);
|
|
435
|
+
handle = await adapter.inToolOperation(`restore-${record.id}`, current, () => adapter.create(input, emit, context.isOwnerCurrent ?? context.isCurrent, timezone, clean ? 'adopt' : 'adopt-existing', record.nativeId, context.canAdmitOccurrence), false);
|
|
400
436
|
if (!current() || this.claudeProcess !== child || !this.turnLedger.supported(child?.pid))
|
|
401
437
|
throw new types_1.NativeScheduleCleanupError('Claude recovery host or protocol changed.', handle);
|
|
402
438
|
const recovered = this.recoverableScheduleHandle(handle, input, restoration);
|
|
@@ -421,6 +457,7 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
421
457
|
const executor = this;
|
|
422
458
|
return { ...handle,
|
|
423
459
|
get nativeId() { return handle.nativeId; },
|
|
460
|
+
get nativeDefinitionAbsent() { return handle.nativeDefinitionAbsent; },
|
|
424
461
|
get recoveryIdentity() {
|
|
425
462
|
return JSON.stringify({ ...identity, sessionId: executor.sessionId,
|
|
426
463
|
model: executor.model, effort: executor.effort,
|
|
@@ -504,6 +541,7 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
504
541
|
}
|
|
505
542
|
sessionSchedules;
|
|
506
543
|
scheduleHooksReady = false;
|
|
544
|
+
scheduleGuardRequired = false;
|
|
507
545
|
currentScheduleManagement = false;
|
|
508
546
|
nativeScheduleTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
509
547
|
schedules() {
|
|
@@ -526,6 +564,54 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
526
564
|
wake: () => { this.turnLedger.changed(); void this.processQueue(); },
|
|
527
565
|
});
|
|
528
566
|
}
|
|
567
|
+
reviewedCleanupActive = false;
|
|
568
|
+
cleanupHosts = new WeakMap();
|
|
569
|
+
async withReviewedNativeCleanup(id, current, run, inTurn = false) {
|
|
570
|
+
if (!this.sessionId)
|
|
571
|
+
throw new Error('No bound Claude session. Select the original thread/session; cleanup never searches or creates another session.');
|
|
572
|
+
if (!current() || this.reviewedCleanupActive || this.modelChange || this.retainedAbort || this.abortOperation
|
|
573
|
+
|| this.hasUncertainShutdown() || this.delegationWorker || this.isDestroyed || this.isStopping
|
|
574
|
+
|| this.sandbox.isRestricted() || this.scheduleRestart || this.scheduleRestoring || (!inTurn && this.isBusy())
|
|
575
|
+
|| !this.delegation?.groups?.includes('scheduling'))
|
|
576
|
+
throw new Error('Bound native cleanup is unavailable or busy. Retry when this thread is idle.');
|
|
577
|
+
this.reviewedCleanupActive = true;
|
|
578
|
+
const sessionId = this.sessionId, cwd = this.currentWorkingDirectory;
|
|
579
|
+
let lease;
|
|
580
|
+
try {
|
|
581
|
+
lease = this.scheduleHostOwnership().reviewedRemovalLease();
|
|
582
|
+
if (!inTurn)
|
|
583
|
+
await this.listModels();
|
|
584
|
+
const child = this.claudeProcess, epoch = this.stopEpoch;
|
|
585
|
+
if (!child || !this.scheduleHooksReady || this.sessionId !== sessionId)
|
|
586
|
+
throw new Error('Bound native session changed during cleanup startup.');
|
|
587
|
+
if (!this.cleanupHosts.has(child))
|
|
588
|
+
this.cleanupHosts.set(child, (0, crypto_1.randomUUID)());
|
|
589
|
+
const settings = JSON.stringify([this.model, this.effort, this.delegation]);
|
|
590
|
+
const valid = () => {
|
|
591
|
+
try {
|
|
592
|
+
lease.verify();
|
|
593
|
+
return current() && !this.isDestroyed && !this.isStopping && !this.abortOperation
|
|
594
|
+
&& !this.modelChange && this.claudeProcess === child && this.stopEpoch === epoch && this.sessionId === sessionId
|
|
595
|
+
&& this.currentWorkingDirectory === cwd && settings === JSON.stringify([this.model, this.effort, this.delegation]);
|
|
596
|
+
}
|
|
597
|
+
catch {
|
|
598
|
+
return false;
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
this.scheduleCleanupHost = child;
|
|
602
|
+
const adapter = this.schedules();
|
|
603
|
+
return await adapter.inToolOperation(id, valid, () => run({
|
|
604
|
+
binding: (0, crypto_1.createHash)('sha256').update(JSON.stringify([this.cleanupHosts.get(child), sessionId, cwd, epoch, settings])).digest('hex'),
|
|
605
|
+
sessionId, current: valid,
|
|
606
|
+
inventory: () => adapter.reviewedInventory(valid), remove: target => adapter.reviewedDelete(target, valid),
|
|
607
|
+
}), inTurn);
|
|
608
|
+
}
|
|
609
|
+
finally {
|
|
610
|
+
lease?.close();
|
|
611
|
+
this.scheduleCleanupHost = undefined;
|
|
612
|
+
this.reviewedCleanupActive = false;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
529
615
|
async withNativeScheduleOperation(id, current, run, inTurn) {
|
|
530
616
|
if (this.modelChange || this.retainedAbort || this.delegationWorker || this.isDestroyed || this.isStopping || this.sandbox.isRestricted())
|
|
531
617
|
throw new Error('Native schedule owner or sandbox is unavailable.');
|
|
@@ -557,7 +643,7 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
557
643
|
}
|
|
558
644
|
}
|
|
559
645
|
nativeScheduleAction(id) { return this.sessionSchedules?.action(id); }
|
|
560
|
-
async createNativeSchedule(input, onEvent, isOwnerCurrent) {
|
|
646
|
+
async createNativeSchedule(input, onEvent, isOwnerCurrent, canAdmitOccurrence) {
|
|
561
647
|
if (this.scheduleRestart || this.modelChange || this.delegationWorker || this.isDestroyed || this.isStopping || this.sandbox.isRestricted()
|
|
562
648
|
|| input.cwd !== this.currentWorkingDirectory)
|
|
563
649
|
throw new Error('Native schedule context or sandbox is unavailable.');
|
|
@@ -570,7 +656,7 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
570
656
|
throw new Error('Claude recovery protocol is unsupported.');
|
|
571
657
|
if (input.recovery)
|
|
572
658
|
this.scheduleHostOwnership().reserve(true);
|
|
573
|
-
return this.recoverableScheduleHandle(await this.schedules().create(input, onEvent, isOwnerCurrent, timezone), input);
|
|
659
|
+
return this.recoverableScheduleHandle(await this.schedules().create(input, onEvent, isOwnerCurrent, timezone, false, undefined, canAdmitOccurrence), input);
|
|
574
660
|
}
|
|
575
661
|
/** Inspect only the effective TZ; never log, retain, or expose settings to a model. */
|
|
576
662
|
readNativeScheduleTimezone() {
|
|
@@ -651,7 +737,7 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
651
737
|
hasUncertainShutdown() { return this.shutdownUncertain || this.isStopping || !!this.stopOperation; }
|
|
652
738
|
isBusy() { return !!this.modelChange || this.isWorkBusy(); }
|
|
653
739
|
isWorkBusy() {
|
|
654
|
-
if (this.scheduleRestoring || this.retainedAbort || this.abortOperation || this.hasUncertainShutdown() || this.scheduleCleanupHost
|
|
740
|
+
if (this.reviewedCleanupActive || this.scheduleRestoring || this.retainedAbort || this.abortOperation || this.hasUncertainShutdown() || this.scheduleCleanupHost
|
|
655
741
|
|| this.scheduleRestart && this.claudeProcess === this.scheduleRestart.child)
|
|
656
742
|
return true;
|
|
657
743
|
if (this.sessionSchedules?.busy)
|
|
@@ -715,13 +801,15 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
715
801
|
// Note: --output-format=stream-json requires --verbose
|
|
716
802
|
const restricted = this.sandbox.isRestricted();
|
|
717
803
|
// Claude restores session-only cron jobs from the resumed transcript, even
|
|
718
|
-
// when the original CronCreate used durable:false.
|
|
719
|
-
//
|
|
720
|
-
//
|
|
721
|
-
// restart or in a restricted/worker process.
|
|
804
|
+
// when the original CronCreate used durable:false. Scheduling hosts need
|
|
805
|
+
// bootstrap admission hooks; every other launch disables the native Cron
|
|
806
|
+
// feature itself rather than relying on a scheduler preference setting.
|
|
722
807
|
const managedScheduling = !this.delegationWorker && !restricted
|
|
723
808
|
&& this.delegation?.groups?.includes('scheduling') === true;
|
|
724
|
-
|
|
809
|
+
this.scheduleGuardRequired = !this.delegationWorker && (!!this.sessionId || managedScheduling);
|
|
810
|
+
// Non-owning hosts must not start the native scheduler or expose Cron tools.
|
|
811
|
+
// The settings flag does not suppress transcript-restored definitions.
|
|
812
|
+
const disableNativeSchedules = !managedScheduling;
|
|
725
813
|
const mcpServers = {};
|
|
726
814
|
const args = [
|
|
727
815
|
'--input-format=stream-json',
|
|
@@ -729,6 +817,12 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
729
817
|
'--include-partial-messages',
|
|
730
818
|
'--verbose',
|
|
731
819
|
];
|
|
820
|
+
// Native startup holds before loading the resumed session until our first
|
|
821
|
+
// initialize frame (including admission hooks) is available. Unsupported
|
|
822
|
+
// binaries must fail startup; never retry without this barrier. Restricted
|
|
823
|
+
// hosts use the Cron kill switch instead, preserving SessionStart ordering.
|
|
824
|
+
if (managedScheduling)
|
|
825
|
+
args.push('--await-initialize');
|
|
732
826
|
if (restricted) {
|
|
733
827
|
// Sandboxed mode: OS-enforced Bash isolation; widening requests surface
|
|
734
828
|
// through the permission-prompt MCP tool as approval cards. Skipping
|
|
@@ -753,8 +847,6 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
753
847
|
permissions.allow = [...(permissions.allow ?? []),
|
|
754
848
|
...(0, tools_1.managedTools)(this.delegation).map(tool => `mcp__remote-cli-delegation__${tool.name}`)];
|
|
755
849
|
}
|
|
756
|
-
if (disableResumedSchedules)
|
|
757
|
-
settings = { ...(settings ?? {}), scheduledTasksEnabled: false };
|
|
758
850
|
if (settings)
|
|
759
851
|
args.push('--settings', JSON.stringify(settings));
|
|
760
852
|
mcpServers['remote-cli-approval'] = {
|
|
@@ -767,8 +859,6 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
767
859
|
}
|
|
768
860
|
else {
|
|
769
861
|
args.push('--dangerously-skip-permissions');
|
|
770
|
-
if (disableResumedSchedules)
|
|
771
|
-
args.push('--settings', JSON.stringify({ scheduledTasksEnabled: false }));
|
|
772
862
|
}
|
|
773
863
|
if (this.delegation) {
|
|
774
864
|
mcpServers['remote-cli-delegation'] = (0, contract_1.delegationMcpConfig)(this.delegation);
|
|
@@ -851,6 +941,7 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
851
941
|
env: {
|
|
852
942
|
...process.env,
|
|
853
943
|
FORCE_COLOR: '0',
|
|
944
|
+
...(disableNativeSchedules ? { CLAUDE_CODE_DISABLE_CRON: '1' } : {}),
|
|
854
945
|
// Prevent nested session error
|
|
855
946
|
CLAUDECODE: '',
|
|
856
947
|
CLAUDE_CODE: '',
|
|
@@ -866,7 +957,9 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
866
957
|
this.turnLedger.changed();
|
|
867
958
|
});
|
|
868
959
|
this.nativeScheduleTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
869
|
-
|
|
960
|
+
// Observe restored lifecycle frames even before managed tools/catalogs exist.
|
|
961
|
+
// Installing the adapter does not adopt or authorize any native definition.
|
|
962
|
+
if (!this.delegationWorker)
|
|
870
963
|
this.schedules();
|
|
871
964
|
if (this.delegationWorker)
|
|
872
965
|
this.workerGroups.track(child);
|
|
@@ -2156,7 +2249,7 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
2156
2249
|
}
|
|
2157
2250
|
return;
|
|
2158
2251
|
}
|
|
2159
|
-
if (this.
|
|
2252
|
+
if (this.scheduleGuardRequired && !this.scheduleHooksReady && !this.delegationWorker) {
|
|
2160
2253
|
// Initialize callback hooks once per native process before its first model turn.
|
|
2161
2254
|
this.isStarting = true;
|
|
2162
2255
|
try {
|
|
@@ -2296,7 +2389,7 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
2296
2389
|
if (this.modelChange)
|
|
2297
2390
|
return { success: false, error: 'Native model change is pending or unconfirmed. Retry /model after its reply, or use /clear (session-only schedules will be lost).' };
|
|
2298
2391
|
if (((this.abortOperation || this.retainedAbort) && !(this.cleanupAdmission() && options.nativeScheduleManagement && options.nativeScheduleCurrent?.()))
|
|
2299
|
-
|| this.hasUncertainShutdown() || (this.scheduleCleanupHost && !options.nativeScheduleManagement)) {
|
|
2392
|
+
|| this.hasUncertainShutdown() || ((this.scheduleCleanupHost || this.reviewedCleanupActive) && !options.nativeScheduleManagement)) {
|
|
2300
2393
|
return { success: false, error: 'Native cleanup is still pending. Retry after cleanup.' };
|
|
2301
2394
|
}
|
|
2302
2395
|
try {
|
|
@@ -2775,7 +2868,7 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
2775
2868
|
this.turnLedger.version = typeof rawResponse.claude_code_version === 'string' ? rawResponse.claude_code_version : undefined;
|
|
2776
2869
|
this.turnLedger.pid = typeof rawResponse.pid === 'number' ? rawResponse.pid : undefined;
|
|
2777
2870
|
const { models, rawEntries } = (0, ClaudeSettings_1.parseClaudeModelsCatalog)(rawResponse.models, this.reportedModel || this.acknowledgedModel || this.model);
|
|
2778
|
-
if (scheduleHooks && this.
|
|
2871
|
+
if (scheduleHooks && this.scheduleGuardRequired) {
|
|
2779
2872
|
await this.readNativeScheduleTimezone();
|
|
2780
2873
|
}
|
|
2781
2874
|
if (scheduleHooks) {
|
|
@@ -2969,10 +3062,10 @@ class ClaudePersistentExecutor extends events_1.EventEmitter {
|
|
|
2969
3062
|
await this.stopProcess();
|
|
2970
3063
|
// Step 2: Run compact as a one-shot process outside the full context
|
|
2971
3064
|
const compactResult = await new Promise((resolve) => {
|
|
2972
|
-
const child = (0, OwnershipRuntime_1.ownedSpawn)(this.claudeCommand, ['--resume', sessionIdBeforeCompact, '--
|
|
3065
|
+
const child = (0, OwnershipRuntime_1.ownedSpawn)(this.claudeCommand, ['--resume', sessionIdBeforeCompact, '--print', '/compact'], {
|
|
2973
3066
|
cwd: this.currentWorkingDirectory,
|
|
2974
3067
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
2975
|
-
env: { ...process.env, FORCE_COLOR: '0', CLAUDECODE: '', CLAUDE_CODE: '' },
|
|
3068
|
+
env: { ...process.env, FORCE_COLOR: '0', CLAUDECODE: '', CLAUDE_CODE: '', CLAUDE_CODE_DISABLE_CRON: '1' },
|
|
2976
3069
|
});
|
|
2977
3070
|
let output = '';
|
|
2978
3071
|
child.stdout?.on('data', (data) => {
|