github-issue-tower-defence-management 1.122.9 → 1.122.10

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/bin/adapter/entry-points/console/ui-dist/assets/{index-D0RwhyOM.css → index-N9M1qhkw.css} +1 -1
  3. package/bin/adapter/entry-points/console/ui-dist/index.html +2 -2
  4. package/bin/adapter/entry-points/handlers/notifySilentTmuxSessions.js +3 -2
  5. package/bin/adapter/entry-points/handlers/notifySilentTmuxSessions.js.map +1 -1
  6. package/bin/adapter/repositories/ConfigurableSilentSessionMessageComposer.js +3 -4
  7. package/bin/adapter/repositories/ConfigurableSilentSessionMessageComposer.js.map +1 -1
  8. package/bin/adapter/repositories/TranscriptRefusalTailStatusProvider.js +110 -0
  9. package/bin/adapter/repositories/TranscriptRefusalTailStatusProvider.js.map +1 -0
  10. package/bin/domain/usecases/DefaultSilentSessionMessageComposer.js +9 -13
  11. package/bin/domain/usecases/DefaultSilentSessionMessageComposer.js.map +1 -1
  12. package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js.map +1 -1
  13. package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js +20 -2
  14. package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js.map +1 -1
  15. package/bin/domain/usecases/adapter-interfaces/RefusalTailStatusProvider.js +3 -0
  16. package/bin/domain/usecases/adapter-interfaces/RefusalTailStatusProvider.js.map +1 -0
  17. package/package.json +5 -3
  18. package/src/adapter/entry-points/console/ui-dist/assets/{index-D0RwhyOM.css → index-N9M1qhkw.css} +1 -1
  19. package/src/adapter/entry-points/console/ui-dist/index.html +2 -2
  20. package/src/adapter/entry-points/handlers/notifySilentTmuxSessions.test.ts +1 -1
  21. package/src/adapter/entry-points/handlers/notifySilentTmuxSessions.ts +3 -2
  22. package/src/adapter/repositories/ConfigurableSilentSessionMessageComposer.test.ts +12 -5
  23. package/src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts +2 -3
  24. package/src/adapter/repositories/TranscriptRefusalTailStatusProvider.test.ts +208 -0
  25. package/src/adapter/repositories/TranscriptRefusalTailStatusProvider.ts +80 -0
  26. package/src/domain/entities/Project.ts +1 -8
  27. package/src/domain/usecases/AssignNoAssigneeIssueToManagerUseCase.test.ts +2 -2
  28. package/src/domain/usecases/DefaultSilentSessionMessageComposer.test.ts +54 -34
  29. package/src/domain/usecases/DefaultSilentSessionMessageComposer.ts +6 -23
  30. package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.ts +1 -3
  31. package/src/domain/usecases/NotifySilentLiveSessionsUseCase.test.ts +147 -0
  32. package/src/domain/usecases/NotifySilentLiveSessionsUseCase.ts +26 -1
  33. package/src/domain/usecases/adapter-interfaces/RefusalTailStatusProvider.ts +5 -0
  34. package/types/adapter/entry-points/handlers/notifySilentTmuxSessions.d.ts.map +1 -1
  35. package/types/adapter/repositories/ConfigurableSilentSessionMessageComposer.d.ts +1 -2
  36. package/types/adapter/repositories/ConfigurableSilentSessionMessageComposer.d.ts.map +1 -1
  37. package/types/adapter/repositories/TranscriptRefusalTailStatusProvider.d.ts +6 -0
  38. package/types/adapter/repositories/TranscriptRefusalTailStatusProvider.d.ts.map +1 -0
  39. package/types/domain/entities/Project.d.ts.map +1 -1
  40. package/types/domain/usecases/DefaultSilentSessionMessageComposer.d.ts +1 -3
  41. package/types/domain/usecases/DefaultSilentSessionMessageComposer.d.ts.map +1 -1
  42. package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts.map +1 -1
  43. package/types/domain/usecases/NotifySilentLiveSessionsUseCase.d.ts +3 -1
  44. package/types/domain/usecases/NotifySilentLiveSessionsUseCase.d.ts.map +1 -1
  45. package/types/domain/usecases/adapter-interfaces/RefusalTailStatusProvider.d.ts +4 -0
  46. package/types/domain/usecases/adapter-interfaces/RefusalTailStatusProvider.d.ts.map +1 -0
  47. /package/bin/adapter/entry-points/console/ui-dist/assets/{index-CC-RYye2.js → index-8H0HejYa.js} +0 -0
  48. /package/src/adapter/entry-points/console/ui-dist/assets/{index-CC-RYye2.js → index-8H0HejYa.js} +0 -0
@@ -48,7 +48,9 @@ describe('DefaultSilentSessionMessageComposer', () => {
48
48
  'Keep a monitor in place that notices when a sub-agent has produced no output for about 5 minutes.',
49
49
  ),
50
50
  ).toBe(1);
51
- expect(occurrences('share it through a new owner-call')).toBe(1);
51
+ expect(
52
+ occurrences('work the owner asked for has been completed or answered'),
53
+ ).toBe(1);
52
54
  });
53
55
 
54
56
  it('requests a remaining-minutes estimate in the next output', () => {
@@ -63,40 +65,38 @@ describe('DefaultSilentSessionMessageComposer', () => {
63
65
  expect(section).toContain('No output has been observed for 10 minutes.');
64
66
  });
65
67
 
66
- it('states the owner-call tag format exactly once: complete pair on one line, content starting with the red-circle emoji, self-contained', () => {
68
+ it('states the owner-call format guidance exactly once, deferring to the session-documented format', () => {
67
69
  const section = composer.composeMainStalledSection(600);
68
70
  const formatOccurrences =
69
- section.split('complete opening and closing pair on one line').length - 1;
71
+ section.split('in the format documented for this session').length - 1;
70
72
  expect(formatOccurrences).toBe(1);
71
- expect(section).toContain('🔴');
73
+ expect(section).toContain('written to be self-contained');
72
74
  expect(section).toContain(
73
- 'with the content starting immediately with the 🔴 emoji',
75
+ 'so the owner can understand the situation from that single message',
74
76
  );
75
- expect(section).toContain('written to be self-contained');
76
77
  });
77
78
 
78
79
  it('explains that the owner is notified only when an owner-call is raised', () => {
79
80
  const section = composer.composeMainStalledSection(600);
80
- expect(section).toContain('the owner is notified only when one is raised');
81
- });
82
-
83
- it('interpolates the configured owner-call marker into the format guidance when provided', () => {
84
- const markedComposer = new DefaultSilentSessionMessageComposer(
85
- '<<OWNER_CALL>>',
86
- );
87
- const section = markedComposer.composeMainStalledSection(600);
88
81
  expect(section).toContain(
89
- 'owner-call marker tag "<<OWNER_CALL>>" as a complete opening and closing pair on one line',
82
+ 'The owner is notified only when an owner-call is raised.',
90
83
  );
91
- expect(section).toContain('🔴');
92
84
  });
93
85
 
94
- it('falls back to generic owner-call format guidance when no marker is configured', () => {
86
+ it('frames a completed owner request as awaiting acknowledgment rather than a no-action case', () => {
95
87
  const section = composer.composeMainStalledSection(600);
96
88
  expect(section).toContain(
97
- 'owner-call marker tag as a complete opening and closing pair on one line',
89
+ "a completion still awaits the owner's acknowledgment",
98
90
  );
99
- expect(section).not.toContain('""');
91
+ expect(section).toContain('so it is not a no-action case');
92
+ });
93
+
94
+ it('contains no marker-tag example, tag name, or angle bracket in the format guidance', () => {
95
+ const section = composer.composeMainStalledSection(600);
96
+ expect(section).not.toContain('marker tag');
97
+ expect(section).not.toContain('opening and closing pair');
98
+ expect(section).not.toContain('<');
99
+ expect(section).not.toContain('>');
100
100
  });
101
101
 
102
102
  it('embeds the reminder sentinel in the stale-owner-call main-stalled section', () => {
@@ -166,22 +166,19 @@ describe('DefaultSilentSessionMessageComposer', () => {
166
166
  3600,
167
167
  );
168
168
  const formatOccurrences =
169
- section.split('complete opening and closing pair on one line').length - 1;
169
+ section.split('in the format documented for this session').length - 1;
170
170
  expect(formatOccurrences).toBe(1);
171
171
  });
172
172
 
173
- it('interpolates the configured owner-call marker into the stale-owner-call format guidance', () => {
174
- const markedComposer = new DefaultSilentSessionMessageComposer(
175
- '<<OWNER_CALL>>',
176
- );
177
- const section = markedComposer.composeMainStalledWithStaleOwnerCallSection(
173
+ it('contains no marker-tag example, tag name, or angle bracket in the stale-owner-call section', () => {
174
+ const section = composer.composeMainStalledWithStaleOwnerCallSection(
178
175
  600,
179
176
  3600,
180
177
  );
181
- expect(section).toContain(
182
- 'owner-call marker tag "<<OWNER_CALL>>" as a complete opening and closing pair on one line',
183
- );
184
- expect(section).toContain('🔴');
178
+ expect(section).not.toContain('marker tag');
179
+ expect(section).not.toContain('opening and closing pair');
180
+ expect(section).not.toContain('<');
181
+ expect(section).not.toContain('>');
185
182
  });
186
183
 
187
184
  it('composes the stale-owner-call section distinctly from the plain main-stalled section', () => {
@@ -350,9 +347,6 @@ describe('DefaultSilentSessionMessageComposer', () => {
350
347
  /do not wait passively/i,
351
348
  /is prohibited/i,
352
349
  ];
353
- const markedComposer = new DefaultSilentSessionMessageComposer(
354
- '<<OWNER_CALL>>',
355
- );
356
350
  const subAgent = {
357
351
  label: 'sub-process-1',
358
352
  silentSeconds: 360,
@@ -361,9 +355,7 @@ describe('DefaultSilentSessionMessageComposer', () => {
361
355
  };
362
356
  const composedDefaultTexts = [
363
357
  composer.composeMainStalledSection(600),
364
- markedComposer.composeMainStalledSection(600),
365
358
  composer.composeMainStalledWithStaleOwnerCallSection(600, 3600),
366
- markedComposer.composeMainStalledWithStaleOwnerCallSection(600, 3600),
367
359
  composer.composeSubAgentSection({
368
360
  idleSubAgents: [subAgent],
369
361
  longRunningSubAgents: [subAgent],
@@ -376,6 +368,34 @@ describe('DefaultSilentSessionMessageComposer', () => {
376
368
  }
377
369
  });
378
370
 
371
+ it('composes default texts free of angle-bracket tag examples and emoji characters', () => {
372
+ const emojiPattern =
373
+ /[\u{1F000}-\u{1FAFF}\u{2190}-\u{21FF}\u{2300}-\u{23FF}\u{2600}-\u{27BF}\u{2B00}-\u{2BFF}]/u;
374
+ const subAgent = {
375
+ label: 'sub-process-1',
376
+ silentSeconds: 360,
377
+ runningSeconds: 1200,
378
+ waitingOnExternalProcess: false,
379
+ };
380
+ const composedDefaultTexts = [
381
+ composer.composeMainStalledSection(600),
382
+ composer.composeMainStalledWithStaleOwnerCallSection(600, 3600),
383
+ composer.composeSubAgentSection({
384
+ idleSubAgents: [subAgent],
385
+ longRunningSubAgents: [subAgent],
386
+ }),
387
+ ];
388
+ for (const text of composedDefaultTexts) {
389
+ expect(text).not.toContain('<');
390
+ expect(text).not.toContain('>');
391
+ expect(text).not.toMatch(emojiPattern);
392
+ expect(text).not.toContain('\u{FE0F}');
393
+ expect(text).not.toContain('\u{200D}');
394
+ // The bracketed reminder sentinel remains allowed.
395
+ expect(text).toContain(SILENT_SESSION_REMINDER_SENTINEL);
396
+ }
397
+ });
398
+
379
399
  it('does not contain any host-specific or internal identifiers', () => {
380
400
  const mainSection = composer.composeMainStalledSection(600);
381
401
  const subAgent = {
@@ -42,29 +42,18 @@ const composeLongRunningSubAgentSection = (
42
42
  ].join('\n');
43
43
  };
44
44
 
45
- export const composeOwnerCallFormatGuidance = (
46
- ownerCallMarker: string | null,
47
- ): string => {
48
- const tagLabel =
49
- ownerCallMarker !== null && ownerCallMarker.length > 0
50
- ? ` "${ownerCallMarker}"`
51
- : '';
52
- return `Format reminder: write the owner-call marker tag${tagLabel} as a complete opening and closing pair on one line, with the content starting immediately with the 🔴 emoji and written to be self-contained, so the owner can understand the situation, the ask, and any decision needed from that single message.`;
45
+ export const composeOwnerCallFormatGuidance = (): string => {
46
+ return 'Please share it through a new owner-call in the format documented for this session, written to be self-contained so the owner can understand the situation from that single message.';
53
47
  };
54
48
 
55
- const composeMainStalledMessage = (
56
- mainSilentSeconds: number,
57
- ownerCallMarker: string | null,
58
- ): string => {
49
+ const composeMainStalledMessage = (mainSilentSeconds: number): string => {
59
50
  const minutes = Math.floor(mainSilentSeconds / 60);
60
51
  return [
61
52
  `${SILENT_SESSION_REMINDER_SENTINEL} This is an automated status check. No output has been observed for ${minutes} minutes. If you are waiting on an external process, no action is needed — please log one line explaining the wait. Otherwise please continue with the next step, with these points in mind:`,
62
53
  `1. Keep the session task list current, marking finished items as done.`,
63
54
  `2. Run independent pieces of work in parallel across sub-agents.`,
64
55
  `3. Keep a monitor in place that notices when a sub-agent has produced no output for about 5 minutes.`,
65
- `4. When an owner decision is needed, or when an owner request has been completed or answered, please share it through a new owner-call — the owner is notified only when one is raised. ${composeOwnerCallFormatGuidance(
66
- ownerCallMarker,
67
- )}`,
56
+ `4. When an owner decision is needed, or when work the owner asked for has been completed or answered, please share it through a new owner-call — a completion still awaits the owner's acknowledgment, so it is not a no-action case. The owner is notified only when an owner-call is raised. ${composeOwnerCallFormatGuidance()}`,
68
57
  `Please also include in your next output an estimate of the remaining minutes to finish all tasks.`,
69
58
  ].join('\n');
70
59
  };
@@ -72,24 +61,19 @@ const composeMainStalledMessage = (
72
61
  const composeMainStalledWithStaleOwnerCallMessage = (
73
62
  mainSilentSeconds: number,
74
63
  unansweredOwnerCallAgeSeconds: number,
75
- ownerCallMarker: string | null,
76
64
  ): string => {
77
65
  const silentMinutes = Math.floor(mainSilentSeconds / 60);
78
66
  const ownerCallAgeMinutes = Math.floor(unansweredOwnerCallAgeSeconds / 60);
79
67
  return [
80
68
  `${SILENT_SESSION_REMINDER_SENTINEL} This is an automated status check. No output has been observed for ${silentMinutes} minutes, and the owner call raised ${ownerCallAgeMinutes} minutes ago has not yet been acknowledged by the owner.`,
81
- `An owner call without an acknowledgment — whether it carried a completion report, a question, or a decision request — is still awaiting the owner's acknowledgment, and the earlier message may have been missed. Please re-raise its content as a fresh, self-contained owner call. ${composeOwnerCallFormatGuidance(
82
- ownerCallMarker,
83
- )}`,
69
+ `An owner call without an acknowledgment — whether it carried a completion report, a question, or a decision request — is still awaiting the owner's acknowledgment, and the earlier message may have been missed. Please re-raise its content as a fresh, self-contained owner call. ${composeOwnerCallFormatGuidance()}`,
84
70
  `Please also include in your next output an estimate of the remaining minutes to finish all tasks.`,
85
71
  ].join('\n');
86
72
  };
87
73
 
88
74
  export class DefaultSilentSessionMessageComposer implements SilentSessionMessageComposer {
89
- constructor(private readonly ownerCallMarker: string | null = null) {}
90
-
91
75
  composeMainStalledSection = (mainSilentSeconds: number): string => {
92
- return composeMainStalledMessage(mainSilentSeconds, this.ownerCallMarker);
76
+ return composeMainStalledMessage(mainSilentSeconds);
93
77
  };
94
78
 
95
79
  composeMainStalledWithStaleOwnerCallSection = (
@@ -99,7 +83,6 @@ export class DefaultSilentSessionMessageComposer implements SilentSessionMessage
99
83
  return composeMainStalledWithStaleOwnerCallMessage(
100
84
  mainSilentSeconds,
101
85
  unansweredOwnerCallAgeSeconds,
102
- this.ownerCallMarker,
103
86
  );
104
87
  };
105
88
 
@@ -33,9 +33,7 @@ export class IllegalIssueStatusError extends Error {
33
33
  }
34
34
  }
35
35
  type RejectedReasonType =
36
- | 'NO_REPORT_FROM_AGENT_BOT'
37
- | 'REPORT_HAS_NEXT_STEP'
38
- | PrRejectedReasonType;
36
+ 'NO_REPORT_FROM_AGENT_BOT' | 'REPORT_HAS_NEXT_STEP' | PrRejectedReasonType;
39
37
 
40
38
  export class NotifyFinishedIssuePreparationUseCase {
41
39
  private readonly issueRejectionEvaluator: IssueRejectionEvaluator;
@@ -17,6 +17,7 @@ import { InteractiveLiveSessionTranscriptResolver } from './adapter-interfaces/I
17
17
  import { SessionOutputActivityRepository } from './adapter-interfaces/SessionOutputActivityRepository';
18
18
  import { SessionSubAgentActivityRepository } from './adapter-interfaces/SessionSubAgentActivityRepository';
19
19
  import { OwnerCallStatusProvider } from './adapter-interfaces/OwnerCallStatusProvider';
20
+ import { RefusalTailStatusProvider } from './adapter-interfaces/RefusalTailStatusProvider';
20
21
  import { SilentSessionNotificationRepository } from './adapter-interfaces/SilentSessionNotificationRepository';
21
22
  import { SilentSessionCandidateStateRepository } from './adapter-interfaces/SilentSessionCandidateStateRepository';
22
23
  import { SilentSessionHubTaskStatusCacheRepository } from './adapter-interfaces/SilentSessionHubTaskStatusCacheRepository';
@@ -52,6 +53,7 @@ describe('NotifySilentLiveSessionsUseCase', () => {
52
53
  let mockSleeper: Mocked<Sleeper>;
53
54
  let mockHubTaskStatusResolver: Mocked<HubTaskStatusResolver>;
54
55
  let mockHubTaskStatusCacheRepository: Mocked<SilentSessionHubTaskStatusCacheRepository>;
56
+ let mockRefusalTailStatusProvider: Mocked<RefusalTailStatusProvider>;
55
57
  const now = new Date('2026-06-26T00:00:00Z');
56
58
  const nowEpochSeconds = Math.floor(now.getTime() / 1000);
57
59
  const GITHUB_SESSION = 'https_//github_com/HiromiShikata/repo/issues/42';
@@ -191,6 +193,11 @@ describe('NotifySilentLiveSessionsUseCase', () => {
191
193
  loadHubTaskStatus: jest.fn().mockResolvedValue(null),
192
194
  saveHubTaskStatus: jest.fn().mockResolvedValue(undefined),
193
195
  };
196
+ mockRefusalTailStatusProvider = {
197
+ listRefusalTailedSessionNames: jest
198
+ .fn()
199
+ .mockResolvedValue(new Set<string>()),
200
+ };
194
201
  useCase = new NotifySilentLiveSessionsUseCase(
195
202
  mockSnapshotProvider,
196
203
  mockTranscriptResolver,
@@ -203,6 +210,7 @@ describe('NotifySilentLiveSessionsUseCase', () => {
203
210
  mockSleeper,
204
211
  mockHubTaskStatusResolver,
205
212
  mockHubTaskStatusCacheRepository,
213
+ mockRefusalTailStatusProvider,
206
214
  );
207
215
  });
208
216
 
@@ -1477,6 +1485,145 @@ describe('NotifySilentLiveSessionsUseCase', () => {
1477
1485
  });
1478
1486
  });
1479
1487
 
1488
+ describe('refusal-tailed session gating', () => {
1489
+ it('excludes a main-stalled session whose last assistant turn is a refusal and logs one skip line', async () => {
1490
+ setupSilentMainSession(GITHUB_SESSION);
1491
+ mockRefusalTailStatusProvider.listRefusalTailedSessionNames.mockResolvedValue(
1492
+ new Set([GITHUB_SESSION]),
1493
+ );
1494
+
1495
+ await useCase.run(runParams());
1496
+
1497
+ expect(
1498
+ mockMessageComposer.composeMainStalledSection,
1499
+ ).not.toHaveBeenCalled();
1500
+ expect(
1501
+ mockNotificationRepository.sendSelfCheckNotification,
1502
+ ).not.toHaveBeenCalled();
1503
+ const skipLines = jest
1504
+ .mocked(console.log)
1505
+ .mock.calls.filter(
1506
+ (call) =>
1507
+ typeof call[0] === 'string' &&
1508
+ call[0].includes('last assistant turn was a model refusal'),
1509
+ );
1510
+ expect(skipLines).toEqual([
1511
+ [
1512
+ `Skipping ${GITHUB_SESSION}: last assistant turn was a model refusal; suppressing reminders until a non-refusal turn appears.`,
1513
+ ],
1514
+ ]);
1515
+ });
1516
+
1517
+ it('excludes a refusal-tailed session from the sub-agent reminder branch as well', async () => {
1518
+ setupLiveInteractiveSession(GITHUB_SESSION);
1519
+ const subAgents: SubAgentActivity[] = [
1520
+ {
1521
+ label: 'sub-process-1',
1522
+ silentSeconds: DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
1523
+ runningSeconds: 60,
1524
+ waitingOnExternalProcess: false,
1525
+ },
1526
+ ];
1527
+ mockSubAgentActivityRepository.listSubAgentActivitiesBySessionName.mockResolvedValue(
1528
+ new Map([[GITHUB_SESSION, subAgents]]),
1529
+ );
1530
+ mockRefusalTailStatusProvider.listRefusalTailedSessionNames.mockResolvedValue(
1531
+ new Set([GITHUB_SESSION]),
1532
+ );
1533
+
1534
+ await useCase.run(runParams());
1535
+
1536
+ expect(mockMessageComposer.composeSubAgentSection).not.toHaveBeenCalled();
1537
+ expect(
1538
+ mockNotificationRepository.sendSelfCheckNotification,
1539
+ ).not.toHaveBeenCalled();
1540
+ expect(
1541
+ mockSubAgentActivityRepository.listSubAgentActivitiesBySessionName,
1542
+ ).toHaveBeenCalledWith([], transcriptMapFor([GITHUB_SESSION]));
1543
+ });
1544
+
1545
+ it('passes the resolved transcript paths to the refusal-tail provider', async () => {
1546
+ setupSilentMainSession(GITHUB_SESSION);
1547
+
1548
+ await useCase.run(runParams());
1549
+
1550
+ expect(
1551
+ mockRefusalTailStatusProvider.listRefusalTailedSessionNames,
1552
+ ).toHaveBeenCalledWith(transcriptMapFor([GITHUB_SESSION]));
1553
+ });
1554
+
1555
+ it('notifies a session again once the provider stops reporting it (a non-refusal turn followed the refusal)', async () => {
1556
+ setupSilentMainSession(GITHUB_SESSION);
1557
+ mockRefusalTailStatusProvider.listRefusalTailedSessionNames.mockResolvedValue(
1558
+ new Set<string>(),
1559
+ );
1560
+
1561
+ await useCase.run(runParams());
1562
+
1563
+ expect(
1564
+ mockNotificationRepository.sendSelfCheckNotification,
1565
+ ).toHaveBeenCalledWith(GITHUB_SESSION, MAIN_STALLED_SECTION);
1566
+ });
1567
+
1568
+ it('excludes only the refusal-tailed session when mixed with a healthy stalled session', async () => {
1569
+ mockSnapshotProvider.getSnapshot.mockResolvedValue(
1570
+ snapshotWithSessions([GITHUB_SESSION_ALPHA, GITHUB_SESSION_BRAVO]),
1571
+ );
1572
+ mockTranscriptResolver.resolveTranscriptPaths.mockReturnValue(
1573
+ transcriptMapFor([GITHUB_SESSION_ALPHA, GITHUB_SESSION_BRAVO]),
1574
+ );
1575
+ mockSessionOutputActivityRepository.listSessionOutputActivities.mockResolvedValue(
1576
+ [
1577
+ {
1578
+ sessionName: GITHUB_SESSION_ALPHA,
1579
+ lastOutputEpochSeconds:
1580
+ nowEpochSeconds - DEFAULT_MAIN_SILENT_THRESHOLD_SECONDS,
1581
+ },
1582
+ {
1583
+ sessionName: GITHUB_SESSION_BRAVO,
1584
+ lastOutputEpochSeconds:
1585
+ nowEpochSeconds - DEFAULT_MAIN_SILENT_THRESHOLD_SECONDS,
1586
+ },
1587
+ ],
1588
+ );
1589
+ mockRefusalTailStatusProvider.listRefusalTailedSessionNames.mockResolvedValue(
1590
+ new Set([GITHUB_SESSION_ALPHA]),
1591
+ );
1592
+
1593
+ await useCase.run(runParams());
1594
+
1595
+ expect(
1596
+ mockNotificationRepository.sendSelfCheckNotification,
1597
+ ).toHaveBeenCalledTimes(1);
1598
+ expect(
1599
+ mockNotificationRepository.sendSelfCheckNotification,
1600
+ ).toHaveBeenCalledWith(GITHUB_SESSION_BRAVO, MAIN_STALLED_SECTION);
1601
+ });
1602
+
1603
+ it('keeps the existing behavior when no refusal-tail provider is configured', async () => {
1604
+ const useCaseWithoutProvider = new NotifySilentLiveSessionsUseCase(
1605
+ mockSnapshotProvider,
1606
+ mockTranscriptResolver,
1607
+ mockSessionOutputActivityRepository,
1608
+ mockSubAgentActivityRepository,
1609
+ mockOwnerCallStatusProvider,
1610
+ mockNotificationRepository,
1611
+ mockCandidateStateRepository,
1612
+ mockMessageComposer,
1613
+ mockSleeper,
1614
+ mockHubTaskStatusResolver,
1615
+ mockHubTaskStatusCacheRepository,
1616
+ );
1617
+ setupSilentMainSession(GITHUB_SESSION);
1618
+
1619
+ await useCaseWithoutProvider.run(runParams());
1620
+
1621
+ expect(
1622
+ mockNotificationRepository.sendSelfCheckNotification,
1623
+ ).toHaveBeenCalledWith(GITHUB_SESSION, MAIN_STALLED_SECTION);
1624
+ });
1625
+ });
1626
+
1480
1627
  describe('isGitHubIssueOrPullRequestSessionName', () => {
1481
1628
  it('accepts the encoded form of a github.com issue URL session name', () => {
1482
1629
  expect(
@@ -3,6 +3,7 @@ import { InteractiveLiveSession } from '../entities/InteractiveLiveSession';
3
3
  import { LiveSessionProcessSnapshotProvider } from './adapter-interfaces/LiveSessionProcessSnapshotProvider';
4
4
  import { InteractiveLiveSessionTranscriptResolver } from './adapter-interfaces/InteractiveLiveSessionTranscriptResolver';
5
5
  import { OwnerCallStatusProvider } from './adapter-interfaces/OwnerCallStatusProvider';
6
+ import { RefusalTailStatusProvider } from './adapter-interfaces/RefusalTailStatusProvider';
6
7
  import { SessionOutputActivityRepository } from './adapter-interfaces/SessionOutputActivityRepository';
7
8
  import { SessionSubAgentActivityRepository } from './adapter-interfaces/SessionSubAgentActivityRepository';
8
9
  import { SilentSessionMessageComposer } from './adapter-interfaces/SilentSessionMessageComposer';
@@ -79,6 +80,7 @@ export class NotifySilentLiveSessionsUseCase {
79
80
  private readonly sleeper: Sleeper,
80
81
  private readonly hubTaskStatusResolver: HubTaskStatusResolver | null = null,
81
82
  private readonly hubTaskStatusCacheRepository: SilentSessionHubTaskStatusCacheRepository | null = null,
83
+ private readonly refusalTailStatusProvider: RefusalTailStatusProvider | null = null,
82
84
  ) {}
83
85
 
84
86
  run = async (params: {
@@ -111,8 +113,31 @@ export class NotifySilentLiveSessionsUseCase {
111
113
  interactiveSessions,
112
114
  );
113
115
 
116
+ // A session whose most recent assistant turn is a model refusal is
117
+ // excluded from ALL reminder candidates (main-stall and sub-agent
118
+ // branches alike): each reminder delivery re-sends the full session
119
+ // context to the API and is guaranteed to produce another refusal, so
120
+ // reminding such a session only burns tokens. The gate is state-based
121
+ // (no time windows) and self-clears once a non-refusal assistant turn
122
+ // appears after the refusal.
123
+ const refusalTailedSessionNames =
124
+ this.refusalTailStatusProvider === null
125
+ ? new Set<string>()
126
+ : await this.refusalTailStatusProvider.listRefusalTailedSessionNames(
127
+ transcriptPathBySessionName,
128
+ );
129
+ const monitoredSessions = interactiveSessions.filter((session) => {
130
+ if (!refusalTailedSessionNames.has(session.sessionName)) {
131
+ return true;
132
+ }
133
+ console.log(
134
+ `Skipping ${session.sessionName}: last assistant turn was a model refusal; suppressing reminders until a non-refusal turn appears.`,
135
+ );
136
+ return false;
137
+ });
138
+
114
139
  const snapshots = await this.collectSnapshots(
115
- interactiveSessions,
140
+ monitoredSessions,
116
141
  transcriptPathBySessionName,
117
142
  params.now,
118
143
  );
@@ -0,0 +1,5 @@
1
+ export interface RefusalTailStatusProvider {
2
+ listRefusalTailedSessionNames: (
3
+ transcriptPathBySessionName: Map<string, string>,
4
+ ) => Promise<Set<string>>;
5
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"notifySilentTmuxSessions.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/notifySilentTmuxSessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AAGpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAEL,qBAAqB,EAQtB,MAAM,0DAA0D,CAAC;AAclE,OAAO,EAEL,6BAA6B,EAC9B,MAAM,6DAA6D,CAAC;AAKrE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,0BAA0B,EAAE,MAAM,CAAC;IACnC,+BAA+B,EAAE,MAAM,CAAC;IACxC,8BAA8B,EAAE,MAAM,CAAC;IACvC,+BAA+B,EAAE,MAAM,CAAC;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,qCAAqC,EAAE,MAAM,CAAC;IAC9C,8BAA8B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,qBAAqB,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACpD,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,4BAA4B,EAAE,MAAM,CAAC;IACrC,gBAAgB,EAAE,6BAA6B,CAAC;IAChD,GAAG,EAAE,IAAI,CAAC;CACX,CAAC;AAqCF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,8BAA8B,KACrC,OAAO,CAAC,IAAI,CA2Ed,CAAC;AAEF,eAAO,MAAM,0CAA0C;;;;;;;;CAS7C,CAAC"}
1
+ {"version":3,"file":"notifySilentTmuxSessions.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/notifySilentTmuxSessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AAGpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAEL,qBAAqB,EAQtB,MAAM,0DAA0D,CAAC;AAelE,OAAO,EAEL,6BAA6B,EAC9B,MAAM,6DAA6D,CAAC;AAKrE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,0BAA0B,EAAE,MAAM,CAAC;IACnC,+BAA+B,EAAE,MAAM,CAAC;IACxC,8BAA8B,EAAE,MAAM,CAAC;IACvC,+BAA+B,EAAE,MAAM,CAAC;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,qCAAqC,EAAE,MAAM,CAAC;IAC9C,8BAA8B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,qBAAqB,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACpD,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,4BAA4B,EAAE,MAAM,CAAC;IACrC,gBAAgB,EAAE,6BAA6B,CAAC;IAChD,GAAG,EAAE,IAAI,CAAC;CACX,CAAC;AAqCF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,8BAA8B,KACrC,OAAO,CAAC,IAAI,CA2Ed,CAAC;AAEF,eAAO,MAAM,0CAA0C;;;;;;;;CAS7C,CAAC"}
@@ -10,8 +10,7 @@ export type SilentSessionMessageTemplates = {
10
10
  export declare class ConfigurableSilentSessionMessageComposer implements SilentSessionMessageComposer {
11
11
  private readonly templates;
12
12
  private readonly fallback;
13
- private readonly ownerCallMarker;
14
- constructor(templates: SilentSessionMessageTemplates, fallback: SilentSessionMessageComposer, ownerCallMarker?: string | null);
13
+ constructor(templates: SilentSessionMessageTemplates, fallback: SilentSessionMessageComposer);
15
14
  composeMainStalledSection: (mainSilentSeconds: number) => string;
16
15
  composeMainStalledWithStaleOwnerCallSection: (mainSilentSeconds: number, unansweredOwnerCallAgeSeconds: number) => string;
17
16
  composeSubAgentSection: (stallSections: SubAgentStallSections) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableSilentSessionMessageComposer.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,uEAAuE,CAAC;AAQ/E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjD,CAAC;AAOF,qBAAa,wCAAyC,YAAW,4BAA4B;IAEzF,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAFf,SAAS,EAAE,6BAA6B,EACxC,QAAQ,EAAE,4BAA4B,EACtC,eAAe,GAAE,MAAM,GAAG,IAAW;IAGxD,yBAAyB,GAAI,mBAAmB,MAAM,KAAG,MAAM,CAO7D;IAEF,2CAA2C,GACzC,mBAAmB,MAAM,EACzB,+BAA+B,MAAM,KACpC,MAAM,CAUP;IAEF,sBAAsB,GAAI,eAAe,qBAAqB,KAAG,MAAM,CA4CrE;IAEF,OAAO,CAAC,kBAAkB,CAkBxB;IAEF,OAAO,CAAC,yBAAyB,CAkB/B;CACH"}
1
+ {"version":3,"file":"ConfigurableSilentSessionMessageComposer.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,uEAAuE,CAAC;AAQ/E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjD,CAAC;AAOF,qBAAa,wCAAyC,YAAW,4BAA4B;IAEzF,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADR,SAAS,EAAE,6BAA6B,EACxC,QAAQ,EAAE,4BAA4B;IAGzD,yBAAyB,GAAI,mBAAmB,MAAM,KAAG,MAAM,CAO7D;IAEF,2CAA2C,GACzC,mBAAmB,MAAM,EACzB,+BAA+B,MAAM,KACpC,MAAM,CAUP;IAEF,sBAAsB,GAAI,eAAe,qBAAqB,KAAG,MAAM,CA4CrE;IAEF,OAAO,CAAC,kBAAkB,CAkBxB;IAEF,OAAO,CAAC,yBAAyB,CAkB/B;CACH"}
@@ -0,0 +1,6 @@
1
+ import { RefusalTailStatusProvider } from '../../domain/usecases/adapter-interfaces/RefusalTailStatusProvider';
2
+ export declare class TranscriptRefusalTailStatusProvider implements RefusalTailStatusProvider {
3
+ listRefusalTailedSessionNames: (transcriptPathBySessionName: Map<string, string>) => Promise<Set<string>>;
4
+ private isTranscriptRefusalTailed;
5
+ }
6
+ //# sourceMappingURL=TranscriptRefusalTailStatusProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TranscriptRefusalTailStatusProvider.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/TranscriptRefusalTailStatusProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oEAAoE,CAAC;AA6B/G,qBAAa,mCAAoC,YAAW,yBAAyB;IAQnF,6BAA6B,GAC3B,6BAA6B,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAC/C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAQrB;IAEF,OAAO,CAAC,yBAAyB,CA4B/B;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"Project.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/Project.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EACD,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,MAAM,GACN,QAAQ,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,WAAW,EAAE,CAAC;KACzB,CAAC;IACF,cAAc,EAAE;QACd,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,cAAc,EAAE;QACd,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,WAAW,EAAE,CAAC;QACvB,uBAAuB,EAAE;YACvB,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;KACH,GAAG,IAAI,CAAC;IACT,0BAA0B,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,gCAAgC,EAAE;QAChC,IAAI,EAAE,MAAM,CAAC;Q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AC;KACH,GAAG,IAAI,CAAC;IACT,0BAA0B,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,gCAAgC,EAAE;QAChC,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,iCAAiC,EAAE;QACjC,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;CACV,CAAC"}
@@ -1,8 +1,6 @@
1
1
  import { SilentSessionMessageComposer, SubAgentStallSections } from './adapter-interfaces/SilentSessionMessageComposer';
2
- export declare const composeOwnerCallFormatGuidance: (ownerCallMarker: string | null) => string;
2
+ export declare const composeOwnerCallFormatGuidance: () => string;
3
3
  export declare class DefaultSilentSessionMessageComposer implements SilentSessionMessageComposer {
4
- private readonly ownerCallMarker;
5
- constructor(ownerCallMarker?: string | null);
6
4
  composeMainStalledSection: (mainSilentSeconds: number) => string;
7
5
  composeMainStalledWithStaleOwnerCallSection: (mainSilentSeconds: number, unansweredOwnerCallAgeSeconds: number) => string;
8
6
  composeSubAgentSection: (stallSections: SubAgentStallSections) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultSilentSessionMessageComposer.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/DefaultSilentSessionMessageComposer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,mDAAmD,CAAC;AAwC3D,eAAO,MAAM,8BAA8B,GACzC,iBAAiB,MAAM,GAAG,IAAI,KAC7B,MAMF,CAAC;AAmCF,qBAAa,mCAAoC,YAAW,4BAA4B;IAC1E,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,GAAE,MAAM,GAAG,IAAW;IAElE,yBAAyB,GAAI,mBAAmB,MAAM,KAAG,MAAM,CAE7D;IAEF,2CAA2C,GACzC,mBAAmB,MAAM,EACzB,+BAA+B,MAAM,KACpC,MAAM,CAMP;IAEF,sBAAsB,GAAI,eAAe,qBAAqB,KAAG,MAAM,CAWrE;CACH"}
1
+ {"version":3,"file":"DefaultSilentSessionMessageComposer.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/DefaultSilentSessionMessageComposer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,mDAAmD,CAAC;AAwC3D,eAAO,MAAM,8BAA8B,QAAO,MAEjD,CAAC;AA2BF,qBAAa,mCAAoC,YAAW,4BAA4B;IACtF,yBAAyB,GAAI,mBAAmB,MAAM,KAAG,MAAM,CAE7D;IAEF,2CAA2C,GACzC,mBAAmB,MAAM,EACzB,+BAA+B,MAAM,KACpC,MAAM,CAKP;IAEF,sBAAsB,GAAI,eAAe,qBAAqB,KAAG,MAAM,CAWrE;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"NotifyFinishedIssuePreparationUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/NotifyFinishedIssuePreparationUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAa3E,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,QAAQ,EAAE,MAAM;CAI7B;AACD,qBAAa,uBAAwB,SAAQ,KAAK;gBAE9C,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,cAAc,EAAE,MAAM,GAAG,IAAI;CAOhC;AAMD,qBAAa,qCAAqC;IAK9C,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAahC,OAAO,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QAC/B,iCAAiC,EAAE,MAAM,GAAG,IAAI,CAAC;QACjD,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACtC,oBAAoB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACvC,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;KACzD,KAAG,OAAO,CAAC,IAAI,CAAC,CAsMf;IAEF,OAAO,CAAC,eAAe,CAIgD;IAEvE,OAAO,CAAC,iBAAiB,CA+BvB;IAEF,OAAO,CAAC,qBAAqB,CAuB3B;IAEF,OAAO,CAAC,gCAAgC,CAoBtC;IAEF,OAAO,CAAC,uBAAuB,CAQ7B;IAEF,OAAO,CAAC,+BAA+B,CAgCrC;CACH"}
@@ -1,6 +1,7 @@
1
1
  import { LiveSessionProcessSnapshotProvider } from './adapter-interfaces/LiveSessionProcessSnapshotProvider';
2
2
  import { InteractiveLiveSessionTranscriptResolver } from './adapter-interfaces/InteractiveLiveSessionTranscriptResolver';
3
3
  import { OwnerCallStatusProvider } from './adapter-interfaces/OwnerCallStatusProvider';
4
+ import { RefusalTailStatusProvider } from './adapter-interfaces/RefusalTailStatusProvider';
4
5
  import { SessionOutputActivityRepository } from './adapter-interfaces/SessionOutputActivityRepository';
5
6
  import { SessionSubAgentActivityRepository } from './adapter-interfaces/SessionSubAgentActivityRepository';
6
7
  import { SilentSessionMessageComposer } from './adapter-interfaces/SilentSessionMessageComposer';
@@ -31,8 +32,9 @@ export declare class NotifySilentLiveSessionsUseCase {
31
32
  private readonly sleeper;
32
33
  private readonly hubTaskStatusResolver;
33
34
  private readonly hubTaskStatusCacheRepository;
35
+ private readonly refusalTailStatusProvider;
34
36
  private readonly resolveInteractiveLiveSessions;
35
- constructor(liveSessionProcessSnapshotProvider: LiveSessionProcessSnapshotProvider, interactiveLiveSessionTranscriptResolver: InteractiveLiveSessionTranscriptResolver, sessionOutputActivityRepository: SessionOutputActivityRepository, subAgentActivityRepository: SessionSubAgentActivityRepository, ownerCallStatusProvider: OwnerCallStatusProvider, notificationRepository: SilentSessionNotificationRepository, candidateStateRepository: SilentSessionCandidateStateRepository, messageComposer: SilentSessionMessageComposer, sleeper: Sleeper, hubTaskStatusResolver?: HubTaskStatusResolver | null, hubTaskStatusCacheRepository?: SilentSessionHubTaskStatusCacheRepository | null);
37
+ constructor(liveSessionProcessSnapshotProvider: LiveSessionProcessSnapshotProvider, interactiveLiveSessionTranscriptResolver: InteractiveLiveSessionTranscriptResolver, sessionOutputActivityRepository: SessionOutputActivityRepository, subAgentActivityRepository: SessionSubAgentActivityRepository, ownerCallStatusProvider: OwnerCallStatusProvider, notificationRepository: SilentSessionNotificationRepository, candidateStateRepository: SilentSessionCandidateStateRepository, messageComposer: SilentSessionMessageComposer, sleeper: Sleeper, hubTaskStatusResolver?: HubTaskStatusResolver | null, hubTaskStatusCacheRepository?: SilentSessionHubTaskStatusCacheRepository | null, refusalTailStatusProvider?: RefusalTailStatusProvider | null);
36
38
  run: (params: {
37
39
  mainSilentThresholdSeconds: number;
38
40
  unansweredOwnerCallGraceSeconds: number;
@@ -1 +1 @@
1
- {"version":3,"file":"NotifySilentLiveSessionsUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/NotifySilentLiveSessionsUseCase.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kCAAkC,EAAE,MAAM,yDAAyD,CAAC;AAC7G,OAAO,EAAE,wCAAwC,EAAE,MAAM,+DAA+D,CAAC;AACzH,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,EAAE,+BAA+B,EAAE,MAAM,sDAAsD,CAAC;AACvG,OAAO,EAAE,iCAAiC,EAAE,MAAM,wDAAwD,CAAC;AAC3G,OAAO,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AACjG,OAAO,EAAE,mCAAmC,EAAE,MAAM,0DAA0D,CAAC;AAC/G,OAAO,EAAE,qCAAqC,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<string, string>) => Promise<Set<string>>;
3
+ }
4
+ //# sourceMappingURL=RefusalTailStatusProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefusalTailStatusProvider.d.ts","sourceRoot":"","sources":["../../../../src/domain/usecases/adapter-interfaces/RefusalTailStatusProvider.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC,6BAA6B,EAAE,CAC7B,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CAC3B"}