crewly 1.20.425 → 1.20.426
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/backend/backend/src/index.d.ts +9 -0
- package/dist/backend/backend/src/index.d.ts.map +1 -1
- package/dist/backend/backend/src/index.js +27 -2
- package/dist/backend/backend/src/index.js.map +1 -1
- package/dist/backend/backend/src/services/agent/agent-registration.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/agent/agent-registration.service.js +3 -0
- package/dist/backend/backend/src/services/agent/agent-registration.service.js.map +1 -1
- package/dist/backend/backend/src/services/agent/idle-detection.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/agent/idle-detection.service.js +5 -0
- package/dist/backend/backend/src/services/agent/idle-detection.service.js.map +1 -1
- package/dist/backend/backend/src/services/agent/memory-stop-hold.d.ts +65 -0
- package/dist/backend/backend/src/services/agent/memory-stop-hold.d.ts.map +1 -0
- package/dist/backend/backend/src/services/agent/memory-stop-hold.js +82 -0
- package/dist/backend/backend/src/services/agent/memory-stop-hold.js.map +1 -0
- package/dist/backend/backend/src/services/reconciler/reconciler-data-provider.d.ts.map +1 -1
- package/dist/backend/backend/src/services/reconciler/reconciler-data-provider.js +18 -0
- package/dist/backend/backend/src/services/reconciler/reconciler-data-provider.js.map +1 -1
- package/dist/backend/backend/src/services/slack/slack-team-channel.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/slack/slack-team-channel.service.js +24 -13
- package/dist/backend/backend/src/services/slack/slack-team-channel.service.js.map +1 -1
- package/dist/backend/build-info.json +2 -2
- package/dist/cli/backend/src/services/agent/agent-registration.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/agent/agent-registration.service.js +3 -0
- package/dist/cli/backend/src/services/agent/agent-registration.service.js.map +1 -1
- package/dist/cli/backend/src/services/agent/memory-stop-hold.d.ts +65 -0
- package/dist/cli/backend/src/services/agent/memory-stop-hold.d.ts.map +1 -0
- package/dist/cli/backend/src/services/agent/memory-stop-hold.js +82 -0
- package/dist/cli/backend/src/services/agent/memory-stop-hold.js.map +1 -0
- package/dist/cli/backend/src/services/slack/slack-team-channel.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/slack/slack-team-channel.service.js +24 -13
- package/dist/cli/backend/src/services/slack/slack-team-channel.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -462,6 +462,15 @@ export declare class CrewlyServer {
|
|
|
462
462
|
* @param sessionName - The agent that stopped
|
|
463
463
|
*/
|
|
464
464
|
private closeBrowserTabForStoppedAgent;
|
|
465
|
+
/**
|
|
466
|
+
* Why an agent the machine stopped for memory must not be started yet
|
|
467
|
+
* (memory-stop-hold.ts), or null. Every wake path for queued work and
|
|
468
|
+
* queued messages asks; an owner start does not.
|
|
469
|
+
*
|
|
470
|
+
* @param sessionName - Agent a wake path wants to start
|
|
471
|
+
* @returns Reason text while held, null otherwise
|
|
472
|
+
*/
|
|
473
|
+
private memoryStopHold;
|
|
465
474
|
/**
|
|
466
475
|
* The one hook every stop path runs: what the stopped agent owes goes back
|
|
467
476
|
* in the queue and the agent is brought back with a reminder.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../backend/src/index.ts"],"names":[],"mappings":";AA4CA,OAAO,EAAE,aAAa,EAAa,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../backend/src/index.ts"],"names":[],"mappings":";AA4CA,OAAO,EAAE,aAAa,EAAa,MAAM,kBAAkB,CAAC;AAiW5D,qBAAa,YAAY;IACxB,OAAO,CAAC,GAAG,CAAsB;IACjC,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,EAAE,CAAiB;IAC3B,iFAAiF;IACjF,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,MAAM,CAAqE;IACnF,gFAAgF;IAChF,OAAO,CAAC,iBAAiB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AAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA6X1H,SAAS,IAAI,aAAa;CAG1B;AAyDD,eAAe,YAAY,CAAC"}
|
|
@@ -201,6 +201,7 @@ import { ProjectTicketWorkflowService } from './services/project-tickets/project
|
|
|
201
201
|
import { WorkItemWorktreeService } from './services/worktree/workitem-worktree.service.js';
|
|
202
202
|
import { WorkItemWorktreeSubscriber, createTerminalNotifier } from './services/worktree/workitem-worktree.subscriber.js';
|
|
203
203
|
import { ResourceModeService, RESOURCE_MODE_CONSTANTS } from './services/agent/resource-mode.service.js';
|
|
204
|
+
import { memoryStopHold } from './services/agent/memory-stop-hold.js';
|
|
204
205
|
import { getStallWatcher } from './services/stall/stall-watcher.service.js';
|
|
205
206
|
import { getRestoreQueue, RESTORE_TIER } from './services/agent/restore-queue.js';
|
|
206
207
|
import { bootLaunchHoldReason, getBootLaunchPacer, readBootPressureSnapshot, scheduleHeldBackNotice, waitForBootQuiet, } from './services/agent/boot-pressure.js';
|
|
@@ -7378,6 +7379,17 @@ export class CrewlyServer {
|
|
|
7378
7379
|
});
|
|
7379
7380
|
}
|
|
7380
7381
|
}
|
|
7382
|
+
/**
|
|
7383
|
+
* Why an agent the machine stopped for memory must not be started yet
|
|
7384
|
+
* (memory-stop-hold.ts), or null. Every wake path for queued work and
|
|
7385
|
+
* queued messages asks; an owner start does not.
|
|
7386
|
+
*
|
|
7387
|
+
* @param sessionName - Agent a wake path wants to start
|
|
7388
|
+
* @returns Reason text while held, null otherwise
|
|
7389
|
+
*/
|
|
7390
|
+
memoryStopHold(sessionName) {
|
|
7391
|
+
return memoryStopHold(sessionName, ResourceModeService.getInstance().getMode());
|
|
7392
|
+
}
|
|
7381
7393
|
/**
|
|
7382
7394
|
* The one hook every stop path runs: what the stopped agent owes goes back
|
|
7383
7395
|
* in the queue and the agent is brought back with a reminder.
|
|
@@ -7403,6 +7415,8 @@ export class CrewlyServer {
|
|
|
7403
7415
|
void scheduleDeferredStartRetry(name, {
|
|
7404
7416
|
activate: (n) => activateAgentBySession(this.apiController, n),
|
|
7405
7417
|
hasPending: (n) => SubAgentMessageQueue.getInstance().hasPending(n),
|
|
7418
|
+
// Stopped for memory: wait for pressure to clear instead of taking back the slot it just freed.
|
|
7419
|
+
hold: () => this.memoryStopHold(name),
|
|
7406
7420
|
firstPauseMs: 60_000,
|
|
7407
7421
|
});
|
|
7408
7422
|
},
|
|
@@ -7428,6 +7442,14 @@ export class CrewlyServer {
|
|
|
7428
7442
|
this.logger.info('Holding queued messages for an agent that was stopped on purpose (not waking it)', { sessionName });
|
|
7429
7443
|
return;
|
|
7430
7444
|
}
|
|
7445
|
+
// The machine itself stopped it for memory: waking it 5 s later would take
|
|
7446
|
+
// back the memory the stop freed. The retry starts it once pressure clears.
|
|
7447
|
+
const memoryHold = this.memoryStopHold(sessionName);
|
|
7448
|
+
if (memoryHold) {
|
|
7449
|
+
this.logger.info('Holding queued messages for an agent stopped for memory until pressure clears', { sessionName, reason: memoryHold });
|
|
7450
|
+
this.retryStartWhileQueued(sessionName);
|
|
7451
|
+
return;
|
|
7452
|
+
}
|
|
7431
7453
|
const last = this.queuedWakeAt.get(sessionName) ?? 0;
|
|
7432
7454
|
if (Date.now() - last < SUB_AGENT_QUEUE_CONSTANTS.QUEUED_WAKE_COOLDOWN_MS)
|
|
7433
7455
|
return;
|
|
@@ -7475,8 +7497,9 @@ export class CrewlyServer {
|
|
|
7475
7497
|
return activateAgentBySession(this.apiController, n);
|
|
7476
7498
|
},
|
|
7477
7499
|
hasPending: (n) => SubAgentMessageQueue.getInstance().hasPending(n),
|
|
7478
|
-
// Boot launches outside the restore queue keep its spacing and its memory gate (crewly#1353)
|
|
7479
|
-
|
|
7500
|
+
// Boot launches outside the restore queue keep its spacing and its memory gate (crewly#1353);
|
|
7501
|
+
// an agent the machine stopped for memory waits for pressure to clear (memory-stop-hold.ts).
|
|
7502
|
+
hold: () => (opts.boot ? this.bootLaunchHold() : null) ?? this.memoryStopHold(sessionName),
|
|
7480
7503
|
...(firstPauseMs !== undefined ? { firstPauseMs } : {}),
|
|
7481
7504
|
});
|
|
7482
7505
|
})().catch((err) => {
|
|
@@ -7526,6 +7549,8 @@ export class CrewlyServer {
|
|
|
7526
7549
|
!restoreQueue.isRestoring(name) &&
|
|
7527
7550
|
!isOwnerStopped(name) &&
|
|
7528
7551
|
!pausedTeamOfSession(name) &&
|
|
7552
|
+
// Stopped for memory and the machine is still under pressure
|
|
7553
|
+
!this.memoryStopHold(name) &&
|
|
7529
7554
|
!backend?.sessionExists(name) &&
|
|
7530
7555
|
!registration.getInProcessRuntime(name));
|
|
7531
7556
|
if (opts.boot) {
|