Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

decider.settled.test.ts

649 lines24.2 KB

1import {
2 CommandId,
3 EventId,
4 MessageId,
5 ProjectId,
6 ProviderInstanceId,
7 ThreadId,
8 type OrchestrationReadModel,
9 type OrchestrationSession,
10 type OrchestrationThread,
11} from "@t3tools/contracts";
12import * as NodeServices from "@effect/platform-node/NodeServices";
13import { expect, it } from "@effect/vitest";
14import * as Effect from "effect/Effect";
15​
16import { decideOrchestrationCommand } from "./decider.ts";
17​
18const NOW = "2026-01-01T00:00:00.000Z";
19const SETTLED_AT = "2025-12-30T00:00:00.000Z";
20​
21function makeReadModel(
22 settledOverride: OrchestrationThread["settledOverride"],
23 archivedAt: string | null = null,
24 session: OrchestrationSession | null = null,
25 activities: OrchestrationThread["activities"] = [],
26 messages: OrchestrationThread["messages"] = [],
27 lifecycle: {
28 readonly pinnedAt?: string | null;
29 readonly snoozedUntil?: string | null;
30 readonly snoozedAt?: string | null;
31 } = {},
32): OrchestrationReadModel {
33 return {
34 snapshotSequence: 0,
35 projects: [],
36 threads: [
37 {
38 id: ThreadId.make("thread-1"),
39 projectId: ProjectId.make("project-1"),
40 title: "Thread",
41 modelSelection: { instanceId: ProviderInstanceId.make("codex"), model: "gpt-5.4" },
42 runtimeMode: "full-access",
43 interactionMode: "default",
44 branch: null,
45 worktreePath: null,
46 latestTurn: null,
47 createdAt: NOW,
48 updatedAt: NOW,
49 archivedAt,
50 settledOverride,
51 settledAt: settledOverride === "settled" ? SETTLED_AT : null,
52 snoozedUntil: lifecycle.snoozedUntil ?? null,
53 snoozedAt: lifecycle.snoozedAt ?? (lifecycle.snoozedUntil != null ? SETTLED_AT : null),
54 pinnedAt: lifecycle.pinnedAt ?? null,
55 deletedAt: null,
56 messages,
57 proposedPlans: [],
58 activities,
59 checkpoints: [],
60 session,
61 },
62 ],
63 updatedAt: NOW,
64 };
66​
67function makeSession(status: OrchestrationSession["status"]): OrchestrationSession {
68 return {
69 threadId: ThreadId.make("thread-1"),
70 status,
71 providerName: "Codex",
72 runtimeMode: "full-access",
73 activeTurnId: null,
74 lastError: null,
75 updatedAt: NOW,
76 };
78​
79it.layer(NodeServices.layer)("settled thread decider", (it) => {
80 it.effect("settles awake threads without a redundant wake and re-emits idempotently", () =>
81 Effect.gen(function* () {
82 const event = yield* decideOrchestrationCommand({
83 command: {
84 type: "thread.settle",
85 commandId: CommandId.make("cmd-settle"),
86 threadId: ThreadId.make("thread-1"),
87 },
88 readModel: makeReadModel(null),
89 });
90 const events = Array.isArray(event) ? event : [event];
91 expect(events).toHaveLength(1);
92 expect(events[0]?.type).toBe("thread.settled");
93 if (events[0]?.type === "thread.settled") {
94 expect(events[0].payload.settledAt).toBe(events[0].payload.updatedAt);
95 }
96​
97 // Already settled: the engine rejects zero-event commands, so idempotency
98 // is by re-emission — preserving the original settledAt.
99 const reEmit = yield* decideOrchestrationCommand({
100 command: {
101 type: "thread.settle",
102 commandId: CommandId.make("cmd-settle-again"),
103 threadId: ThreadId.make("thread-1"),
104 },
105 readModel: makeReadModel("settled"),
106 });
107 const reEmitEvents = Array.isArray(reEmit) ? reEmit : [reEmit];
108 expect(reEmitEvents).toHaveLength(1);
109 expect(reEmitEvents[0]?.type).toBe("thread.settled");
110 if (reEmitEvents[0]?.type === "thread.settled") {
111 expect(reEmitEvents[0].payload.settledAt).toBe(SETTLED_AT);
112 // updatedAt must NOT rewind to the historical settledAt: sorting and
113 // relative-time labels key on it.
114 expect(reEmitEvents[0].payload.updatedAt).not.toBe(SETTLED_AT);
115 }
116 }),
117 );
118​
119 it.effect("settling a snoozed thread also wakes it", () =>
120 Effect.gen(function* () {
121 const result = yield* decideOrchestrationCommand({
122 command: {
123 type: "thread.settle",
124 commandId: CommandId.make("cmd-settle-snoozed"),
125 threadId: ThreadId.make("thread-1"),
126 },
127 readModel: makeReadModel(null, null, null, [], [], {
128 snoozedUntil: "1970-01-02T09:00:00.000Z",
129 }),
130 });
131 const events = Array.isArray(result) ? result : [result];
132 expect(events.map((entry) => entry.type)).toEqual(["thread.settled", "thread.unsnoozed"]);
133 const settled = events.find((entry) => entry.type === "thread.settled");
134 const unsnoozed = events.find((entry) => entry.type === "thread.unsnoozed");
135 if (settled?.type === "thread.settled" && unsnoozed?.type === "thread.unsnoozed") {
136 expect(unsnoozed.payload.reason).toBe("user");
137 expect(unsnoozed.payload.updatedAt).toBe(settled.payload.updatedAt);
138 }
139 }),
140 );
141​
142 it.effect("repeated settle repairs legacy settled and snoozed state", () =>
143 Effect.gen(function* () {
144 const result = yield* decideOrchestrationCommand({
145 command: {
146 type: "thread.settle",
147 commandId: CommandId.make("cmd-settle-snoozed-again"),
148 threadId: ThreadId.make("thread-1"),
149 },
150 readModel: makeReadModel("settled", null, null, [], [], {
151 snoozedUntil: "1970-01-02T09:00:00.000Z",
152 }),
153 });
154 const events = Array.isArray(result) ? result : [result];
155 expect(events.map((entry) => entry.type)).toEqual(["thread.settled", "thread.unsnoozed"]);
156 const settled = events.find((entry) => entry.type === "thread.settled");
157 const unsnoozed = events.find((entry) => entry.type === "thread.unsnoozed");
158 if (settled?.type === "thread.settled" && unsnoozed?.type === "thread.unsnoozed") {
159 expect(settled.payload.settledAt).toBe(SETTLED_AT);
160 expect(settled.payload.updatedAt).toBe(NOW);
161 expect(unsnoozed.payload.updatedAt).not.toBe(NOW);
162 }
163 }),
164 );
165​
166 it.effect("settling a pinned and snoozed thread clears the pin and snooze", () =>
167 Effect.gen(function* () {
168 const result = yield* decideOrchestrationCommand({
169 command: {
170 type: "thread.settle",
171 commandId: CommandId.make("cmd-settle-pinned-snoozed"),
172 threadId: ThreadId.make("thread-1"),
173 },
174 readModel: makeReadModel(null, null, null, [], [], {
175 pinnedAt: SETTLED_AT,
176 snoozedUntil: "1970-01-02T09:00:00.000Z",
177 }),
178 });
179 const events = Array.isArray(result) ? result : [result];
180 expect(events.map((entry) => entry.type)).toEqual([
181 "thread.settled",
182 "thread.unpinned",
183 "thread.unsnoozed",
184 ]);
185 }),
186 );
187​
188 it.effect("rejects settling a thread with a live session", () =>
189 Effect.gen(function* () {
190 for (const status of ["starting", "running"] as const) {
191 const error = yield* decideOrchestrationCommand({
192 command: {
193 type: "thread.settle",
194 commandId: CommandId.make(`cmd-settle-live-${status}`),
195 threadId: ThreadId.make("thread-1"),
196 },
197 readModel: makeReadModel(null, null, makeSession(status)),
198 }).pipe(Effect.flip);
199 expect(error._tag).toBe("OrchestrationCommandInvariantError");
200 }
201 // Stopped/error sessions are settleable — only live work is protected.
202 const settled = yield* decideOrchestrationCommand({
203 command: {
204 type: "thread.settle",
205 commandId: CommandId.make("cmd-settle-stopped"),
206 threadId: ThreadId.make("thread-1"),
207 },
208 readModel: makeReadModel(null, null, makeSession("stopped")),
209 });
210 const settledEvents = Array.isArray(settled) ? settled : [settled];
211 expect(settledEvents[0]?.type).toBe("thread.settled");
212 }),
213 );
214​
215 it.effect("rejects settling a thread with an open approval or user-input request", () =>
216 Effect.gen(function* () {
217 const requestActivity = (kind: string, requestId: string, at: string) =>
218 ({
219 id: EventId.make(`activity-${requestId}-${kind}`),
220 tone: "approval" as const,
221 kind,
222 summary: kind,
223 payload: { requestId },
224 turnId: null,
225 createdAt: at,
226 }) as OrchestrationThread["activities"][number];
227​
228 // Open approval request: settle rejected.
229 const openError = yield* decideOrchestrationCommand({
230 command: {
231 type: "thread.settle",
232 commandId: CommandId.make("cmd-settle-pending"),
233 threadId: ThreadId.make("thread-1"),
234 },
235 readModel: makeReadModel(null, null, null, [
236 requestActivity("approval.requested", "req-1", NOW),
237 ]),
238 }).pipe(Effect.flip);
239 expect(openError._tag).toBe("OrchestrationCommandInvariantError");
240​
241 // Same request later resolved: settleable again.
242 const settled = yield* decideOrchestrationCommand({
243 command: {
244 type: "thread.settle",
245 commandId: CommandId.make("cmd-settle-resolved"),
246 threadId: ThreadId.make("thread-1"),
247 },
248 readModel: makeReadModel(null, null, null, [
249 requestActivity("approval.requested", "req-1", NOW),
250 requestActivity("approval.resolved", "req-1", NOW),
251 ]),
252 });
253 const settledEvents = Array.isArray(settled) ? settled : [settled];
254 expect(settledEvents[0]?.type).toBe("thread.settled");
255​
256 // Open user-input request: also rejected.
257 const inputError = yield* decideOrchestrationCommand({
258 command: {
259 type: "thread.settle",
260 commandId: CommandId.make("cmd-settle-pending-input"),
261 threadId: ThreadId.make("thread-1"),
262 },
263 readModel: makeReadModel(null, null, null, [
264 requestActivity("user-input.requested", "req-2", NOW),
265 ]),
266 }).pipe(Effect.flip);
267 expect(inputError._tag).toBe("OrchestrationCommandInvariantError");
268 }),
269 );
270​
271 it.effect("clears an open request when its respond failure marks it stale", () =>
272 Effect.gen(function* () {
273 const activity = (
274 kind: string,
275 requestId: string,
276 payload: Record<string, unknown>,
277 ): OrchestrationThread["activities"][number] =>
278 ({
279 id: EventId.make(`activity-${requestId}-${kind}`),
280 tone: "approval" as const,
281 kind,
282 summary: kind,
283 payload: { requestId, ...payload },
284 turnId: null,
285 createdAt: NOW,
286 }) as OrchestrationThread["activities"][number];
287​
288 // Stale-failure detail clears the request — mirrors the projection's
289 // pending accounting, which is what the client's canSettle sees.
290 const settled = yield* decideOrchestrationCommand({
291 command: {
292 type: "thread.settle",
293 commandId: CommandId.make("cmd-settle-stale-failed"),
294 threadId: ThreadId.make("thread-1"),
295 },
296 readModel: makeReadModel(null, null, null, [
297 activity("approval.requested", "req-1", {}),
298 activity("provider.approval.respond.failed", "req-1", {
299 detail: "Unknown pending approval request req-1",
300 }),
301 activity("user-input.requested", "req-2", {}),
302 activity("provider.user-input.respond.failed", "req-2", {
303 detail: "stale pending user-input request req-2",
304 }),
305 ]),
306 });
307 const settledEvents = Array.isArray(settled) ? settled : [settled];
308 expect(settledEvents[0]?.type).toBe("thread.settled");
309​
310 // A non-stale respond failure (transient provider error) keeps the
311 // request open: the user can retry, so it is still blocked-on-you.
312 const stillOpen = yield* decideOrchestrationCommand({
313 command: {
314 type: "thread.settle",
315 commandId: CommandId.make("cmd-settle-transient-failed"),
316 threadId: ThreadId.make("thread-1"),
317 },
318 readModel: makeReadModel(null, null, null, [
319 activity("approval.requested", "req-3", {}),
320 activity("provider.approval.respond.failed", "req-3", {
321 detail: "provider connection reset",
322 }),
323 ]),
324 }).pipe(Effect.flip);
325 expect(stillOpen._tag).toBe("OrchestrationCommandInvariantError");
326 }),
327 );
328​
329 it.effect("bounds the queued-turn grace window against client clock skew", () =>
330 Effect.gen(function* () {
331 const userMessage = (createdAt: string): OrchestrationThread["messages"][number] => ({
332 id: MessageId.make("message-queued"),
333 role: "user",
334 text: "Continue",
335 turnId: null,
336 streaming: false,
337 createdAt,
338 updatedAt: createdAt,
339 });
340​
341 // The decider's clock is the Effect test clock, pinned to the epoch:
342 // timestamps here are relative to 1970-01-01T00:00:00.000Z.
343​
344 // Within the grace window: genuinely queued, settle rejected.
345 const queuedError = yield* decideOrchestrationCommand({
346 command: {
347 type: "thread.settle",
348 commandId: CommandId.make("cmd-settle-queued"),
349 threadId: ThreadId.make("thread-1"),
350 },
351 readModel: makeReadModel(null, null, null, [], [userMessage("1969-12-31T23:59:30.000Z")]),
352 }).pipe(Effect.flip);
353 expect(queuedError._tag).toBe("OrchestrationCommandInvariantError");
354​
355 // Message timestamp far in the FUTURE (client clock ahead of server):
356 // a negative age must not read as queued forever — past the grace
357 // bound in either direction the thread is settleable.
358 const skewed = yield* decideOrchestrationCommand({
359 command: {
360 type: "thread.settle",
361 commandId: CommandId.make("cmd-settle-skewed"),
362 threadId: ThreadId.make("thread-1"),
363 },
364 readModel: makeReadModel(null, null, null, [], [userMessage("1970-01-01T01:00:00.000Z")]),
365 });
366 const skewedEvents = Array.isArray(skewed) ? skewed : [skewed];
367 expect(skewedEvents[0]?.type).toBe("thread.settled");
368 }),
369 );
370​
371 it.effect("rejects settling and unsettling archived threads", () =>
372 Effect.gen(function* () {
373 const settleError = yield* decideOrchestrationCommand({
374 command: {
375 type: "thread.settle",
376 commandId: CommandId.make("cmd-settle-archived"),
377 threadId: ThreadId.make("thread-1"),
378 },
379 readModel: makeReadModel(null, NOW),
380 }).pipe(Effect.flip);
381 expect(settleError._tag).toBe("OrchestrationCommandInvariantError");
382​
383 const unsettleError = yield* decideOrchestrationCommand({
384 command: {
385 type: "thread.unsettle",
386 commandId: CommandId.make("cmd-unsettle-archived"),
387 threadId: ThreadId.make("thread-1"),
388 reason: "user",
389 },
390 readModel: makeReadModel("settled", NOW),
391 }).pipe(Effect.flip);
392 expect(unsettleError._tag).toBe("OrchestrationCommandInvariantError");
393 }),
394 );
395​
396 it.effect("maps unsettle reasons to overrides and re-emits idempotently", () =>
397 Effect.gen(function* () {
398 const userEvent = yield* decideOrchestrationCommand({
399 command: {
400 type: "thread.unsettle",
401 commandId: CommandId.make("cmd-unsettle-user"),
402 threadId: ThreadId.make("thread-1"),
403 reason: "user",
404 },
405 readModel: makeReadModel("settled"),
406 });
407 const userEvents = Array.isArray(userEvent) ? userEvent : [userEvent];
408 expect(userEvents).toHaveLength(1);
409 expect(userEvents[0]?.type).toBe("thread.unsettled");
410 if (userEvents[0]?.type === "thread.unsettled") {
411 expect(userEvents[0].payload.reason).toBe("user");
412 }
413​
414 // Re-dispatching against the already-reached state re-emits rather than
415 // producing zero events (the engine rejects empty commands).
416 const userAgain = yield* decideOrchestrationCommand({
417 command: {
418 type: "thread.unsettle",
419 commandId: CommandId.make("cmd-unsettle-user-again"),
420 threadId: ThreadId.make("thread-1"),
421 reason: "user",
422 },
423 readModel: makeReadModel("active"),
424 });
425 const userAgainEvents = Array.isArray(userAgain) ? userAgain : [userAgain];
426 expect(userAgainEvents).toHaveLength(1);
427 expect(userAgainEvents[0]?.type).toBe("thread.unsettled");
428 }),
429 );
430​
431 it.effect("prepends activity unsets for turn starts and live session updates", () =>
432 Effect.gen(function* () {
433 const turnResult = yield* decideOrchestrationCommand({
434 command: {
435 type: "thread.turn.start",
436 commandId: CommandId.make("cmd-turn-start"),
437 threadId: ThreadId.make("thread-1"),
438 message: {
439 messageId: MessageId.make("message-1"),
440 role: "user",
441 text: "Continue",
442 attachments: [],
443 },
444 runtimeMode: "full-access",
445 interactionMode: "default",
446 createdAt: NOW,
447 },
448 readModel: makeReadModel("settled"),
449 });
450 const turnEvents = Array.isArray(turnResult) ? turnResult : [turnResult];
451 expect(turnEvents.map((event) => event.type)).toEqual([
452 "thread.unsettled",
453 "thread.message-sent",
454 "thread.turn-start-requested",
455 ]);
456​
457 const sessionResult = yield* decideOrchestrationCommand({
458 command: {
459 type: "thread.session.set",
460 commandId: CommandId.make("cmd-session-set"),
461 threadId: ThreadId.make("thread-1"),
462 session: makeSession("running"),
463 createdAt: NOW,
464 },
465 // A keep-active pin is also an override: real activity clears it
466 // back to neutral so auto-settle can apply again later.
467 readModel: makeReadModel("active"),
468 });
469 const sessionEvents = Array.isArray(sessionResult) ? sessionResult : [sessionResult];
470 expect(sessionEvents.map((event) => event.type)).toEqual([
471 "thread.unsettled",
472 "thread.session-set",
473 ]);
474 }),
475 );
476​
477 it.effect("clears a keep-active pin on real activity", () =>
478 Effect.gen(function* () {
479 const turnResult = yield* decideOrchestrationCommand({
480 command: {
481 type: "thread.turn.start",
482 commandId: CommandId.make("cmd-active-turn-start"),
483 threadId: ThreadId.make("thread-1"),
484 message: {
485 messageId: MessageId.make("message-active"),
486 role: "user",
487 text: "Continue",
488 attachments: [],
489 },
490 runtimeMode: "full-access",
491 interactionMode: "default",
492 createdAt: NOW,
493 },
494 readModel: makeReadModel("active"),
495 });
496 const turnEvents = Array.isArray(turnResult) ? turnResult : [turnResult];
497 // The pin exists to suppress AUTO-settle, not to survive real work:
498 // activity resets it to neutral, restoring the default lifecycle.
499 expect(turnEvents.map((event) => event.type)).toEqual([
500 "thread.unsettled",
501 "thread.message-sent",
502 "thread.turn-start-requested",
503 ]);
504​
505 const activityResult = yield* decideOrchestrationCommand({
506 command: {
507 type: "thread.activity.append",
508 commandId: CommandId.make("cmd-active-approval"),
509 threadId: ThreadId.make("thread-1"),
510 activity: {
511 id: EventId.make("activity-active"),
512 tone: "approval",
513 kind: "approval.requested",
514 summary: "Command approval requested",
515 payload: null,
516 turnId: null,
517 createdAt: NOW,
518 },
519 createdAt: NOW,
520 },
521 readModel: makeReadModel("active"),
522 });
523 const activityEvents = Array.isArray(activityResult) ? activityResult : [activityResult];
524 expect(activityEvents.map((event) => event.type)).toEqual([
525 "thread.unsettled",
526 "thread.activity-appended",
527 ]);
528 }),
529 );
530​
531 it.effect("does not unsettle for session stop/error status writes", () =>
532 Effect.gen(function* () {
533 for (const status of ["stopped", "error", "ready", "idle"] as const) {
534 const result = yield* decideOrchestrationCommand({
535 command: {
536 type: "thread.session.set",
537 commandId: CommandId.make(`cmd-session-${status}`),
538 threadId: ThreadId.make("thread-1"),
539 session: makeSession(status),
540 createdAt: NOW,
541 },
542 readModel: makeReadModel("settled"),
543 });
544 const events = Array.isArray(result) ? result : [result];
545 expect(events.map((event) => event.type)).toEqual(["thread.session-set"]);
546 }
547 }),
548 );
549​
550 it.effect("unsettles for approval and user-input activities but not others", () =>
551 Effect.gen(function* () {
552 const approvalResult = yield* decideOrchestrationCommand({
553 command: {
554 type: "thread.activity.append",
555 commandId: CommandId.make("cmd-activity-approval"),
556 threadId: ThreadId.make("thread-1"),
557 activity: {
558 id: EventId.make("activity-1"),
559 tone: "approval",
560 kind: "approval.requested",
561 summary: "Command approval requested",
562 payload: null,
563 turnId: null,
564 createdAt: NOW,
565 },
566 createdAt: NOW,
567 },
568 readModel: makeReadModel("settled"),
569 });
570 const approvalEvents = Array.isArray(approvalResult) ? approvalResult : [approvalResult];
571 expect(approvalEvents.map((event) => event.type)).toEqual([
572 "thread.unsettled",
573 "thread.activity-appended",
574 ]);
575​
576 const routineResult = yield* decideOrchestrationCommand({
577 command: {
578 type: "thread.activity.append",
579 commandId: CommandId.make("cmd-activity-routine"),
580 threadId: ThreadId.make("thread-1"),
581 activity: {
582 id: EventId.make("activity-2"),
583 tone: "info",
584 kind: "tool.completed",
585 summary: "Tool completed",
586 payload: null,
587 turnId: null,
588 createdAt: NOW,
589 },
590 createdAt: NOW,
591 },
592 readModel: makeReadModel("settled"),
593 });
594 const routineEvents = Array.isArray(routineResult) ? routineResult : [routineResult];
595 expect(routineEvents.map((event) => event.type)).toEqual(["thread.activity-appended"]);
596 }),
597 );
598​
599 it.effect("drops an onlyIfSettled session stop when the thread was re-engaged", () =>
600 Effect.gen(function* () {
601 const stopCommand = (commandId: string) =>
602 ({
603 type: "thread.session.stop",
604 commandId: CommandId.make(commandId),
605 threadId: ThreadId.make("thread-1"),
606 createdAt: NOW,
607 onlyIfSettled: true,
608 }) as const;
609​
610 // Still settled with an idle session: the cleanup stop goes through.
611 const stopped = yield* decideOrchestrationCommand({
612 command: stopCommand("cmd-stop-settled-idle"),
613 readModel: makeReadModel("settled", null, makeSession("ready")),
614 });
615 const stoppedEvents = Array.isArray(stopped) ? stopped : [stopped];
616 expect(stoppedEvents.map((event) => event.type)).toEqual(["thread.session-stop-requested"]);
617​
618 // Re-engaged before the stop was decided (a turn start unsettles the
619 // thread): the stale cleanup stop must not kill the new session.
620 const unsettledError = yield* decideOrchestrationCommand({
621 command: stopCommand("cmd-stop-unsettled"),
622 readModel: makeReadModel(null, null, makeSession("starting")),
623 }).pipe(Effect.flip);
624 expect(unsettledError._tag).toBe("OrchestrationCommandInvariantError");
625​
626 // Still settled but the session is already coming alive: same drop.
627 const aliveError = yield* decideOrchestrationCommand({
628 command: stopCommand("cmd-stop-session-alive"),
629 readModel: makeReadModel("settled", null, makeSession("starting")),
630 }).pipe(Effect.flip);
631 expect(aliveError._tag).toBe("OrchestrationCommandInvariantError");
632​
633 // Without the flag the stop stays unconditional (archive, stop button).
634 const unconditional = yield* decideOrchestrationCommand({
635 command: {
636 type: "thread.session.stop",
637 commandId: CommandId.make("cmd-stop-unconditional"),
638 threadId: ThreadId.make("thread-1"),
639 createdAt: NOW,
640 },
641 readModel: makeReadModel(null, null, makeSession("starting")),
642 });
643 const unconditionalEvents = Array.isArray(unconditional) ? unconditional : [unconditional];
644 expect(unconditionalEvents.map((event) => event.type)).toEqual([
645 "thread.session-stop-requested",
646 ]);
647 }),
648 );
649});