github-issue-tower-defence-management 1.111.1 → 1.111.2
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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/bin/adapter/repositories/ConfigurableSilentSessionMessageComposer.js +6 -2
- package/bin/adapter/repositories/ConfigurableSilentSessionMessageComposer.js.map +1 -1
- package/bin/adapter/repositories/TranscriptOwnerCallStatusProvider.js +15 -2
- package/bin/adapter/repositories/TranscriptOwnerCallStatusProvider.js.map +1 -1
- package/bin/domain/usecases/DefaultSilentSessionMessageComposer.js +3 -2
- package/bin/domain/usecases/DefaultSilentSessionMessageComposer.js.map +1 -1
- package/bin/domain/usecases/silentSessionReminderSentinel.js +12 -0
- package/bin/domain/usecases/silentSessionReminderSentinel.js.map +1 -0
- package/package.json +1 -1
- package/src/adapter/entry-points/handlers/notifySilentTmuxSessions.test.ts +4 -1
- package/src/adapter/repositories/ConfigurableSilentSessionMessageComposer.test.ts +19 -1
- package/src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts +8 -2
- package/src/adapter/repositories/TranscriptOwnerCallStatusProvider.test.ts +67 -0
- package/src/adapter/repositories/TranscriptOwnerCallStatusProvider.ts +17 -2
- package/src/domain/usecases/DefaultSilentSessionMessageComposer.test.ts +13 -0
- package/src/domain/usecases/DefaultSilentSessionMessageComposer.ts +3 -2
- package/src/domain/usecases/silentSessionReminderSentinel.ts +9 -0
- package/types/adapter/repositories/ConfigurableSilentSessionMessageComposer.d.ts.map +1 -1
- package/types/adapter/repositories/TranscriptOwnerCallStatusProvider.d.ts.map +1 -1
- package/types/domain/usecases/DefaultSilentSessionMessageComposer.d.ts.map +1 -1
- package/types/domain/usecases/silentSessionReminderSentinel.d.ts +2 -0
- package/types/domain/usecases/silentSessionReminderSentinel.d.ts.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.111.2](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.111.1...v1.111.2) (2026-06-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **schedule:** do not count monitor-injected reminders as owner replies ([#1036](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/issues/1036)) ([b1e667c](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/b1e667c4e8c6a798f86bff3765dfba03246bce1c)), closes [#1035](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/issues/1035)
|
|
7
|
+
|
|
1
8
|
## [1.111.1](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.111.0...v1.111.1) (2026-06-28)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -558,7 +558,7 @@ Each schedule cycle, when `silentNotificationEnabled` is true, also inspects eve
|
|
|
558
558
|
|
|
559
559
|
Sessions are selected purely from the live process tree, independently of session naming or any GitHub issue linkage: every live tmux session is taken, the descendants of each session's pane processes are walked, and the first descendant that is an interactive Claude Code process (its command line contains `claude` and does not contain the owner-handover marker `Take ownership of`, and its environment exposes both `CLAUDE_CODE_SESSION_ID` and `CLAUDE_CONFIG_DIR`) is taken as that session's process. Both issue-url-named sessions and plain-named sessions (for example `workbench`) are selected equally. Because the walk is anchored on tmux panes, background owner-handover spawns, the preparation daemon, and monitor processes — none of which run inside an interactive tmux pane — are excluded; the owner-handover marker check is an additional guard. Each selected session's transcript is then resolved from its process environment as `<CLAUDE_CONFIG_DIR>/projects/<cwd-slug>/<CLAUDE_CODE_SESSION_ID>.jsonl` (the most recently modified match is used when several exist), so a session that has no issue URL resolves just as reliably as one that does.
|
|
560
560
|
|
|
561
|
-
The main-session stalled section is sent when the session's main output has been idle for at least `mainSilentThresholdSeconds`, unless the session is currently waiting on the owner (in that case the silence is expected and the section is suppressed). Idle time is computed from the timestamp of the latest `assistant` entry in the session's resolved transcript rather than from the transcript file modification time, so a transcript that is only updated by tool results or owner replies still counts as silent. Whether a session is waiting on the owner is determined through an injectable port; the built-in default reports no session as waiting, so the suppression is only applied when a host provides an implementation. When `ownerCallMarker` is configured, a transcript-based implementation is used: it reads each session's resolved transcript and treats the session as waiting on the owner when the latest entry containing `ownerCallMarker` is newer (by full timestamp) than the latest genuine owner reply.
|
|
561
|
+
The main-session stalled section is sent when the session's main output has been idle for at least `mainSilentThresholdSeconds`, unless the session is currently waiting on the owner (in that case the silence is expected and the section is suppressed). Idle time is computed from the timestamp of the latest `assistant` entry in the session's resolved transcript rather than from the transcript file modification time, so a transcript that is only updated by tool results or owner replies still counts as silent. Whether a session is waiting on the owner is determined through an injectable port; the built-in default reports no session as waiting, so the suppression is only applied when a host provides an implementation. When `ownerCallMarker` is configured, a transcript-based implementation is used: it reads each session's resolved transcript and treats the session as waiting on the owner when the latest entry containing `ownerCallMarker` is newer (by full timestamp) than the latest genuine owner reply. A self-check reminder that the monitor injects into a session via `tmux send-keys` itself lands in that session's transcript as a `user` text entry; every injected reminder carries a fixed sentinel tag (`[TDPM_SILENT_SESSION_SELF_CHECK_REMINDER]`), and a `user` entry whose text contains that sentinel is not counted as a genuine owner reply. This prevents the monitor's own reminder from being mistaken for the owner answering, which would otherwise make a genuinely waiting session stop being suppressed and get re-notified.
|
|
562
562
|
|
|
563
563
|
The sub-process section is sent, regardless of main output, when at least one sub-process of the session has been output-idle for `subAgentSilentThresholdSeconds` or has been running for `subAgentRunningThresholdSeconds`; the message lists each matched sub-process with its idle and running minutes. Sub-processes are discovered in one of two ways: when `subAgentTranscriptRootDirectory` is configured, each session's `subagents/agent-<id>.jsonl` transcripts are scanned, finished sub-agents (latest transcript entry `stop_reason` equal to `end_turn` or `stop_sequence`) are skipped, and idle time is taken from the transcript file modification time (following symlinks) while running time is taken from its first entry timestamp; otherwise sub-processes are discovered by matching `subAgentProcessMatchPattern` against process command lines.
|
|
564
564
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConfigurableSilentSessionMessageComposer = void 0;
|
|
4
|
+
const silentSessionReminderSentinel_1 = require("../../domain/usecases/silentSessionReminderSentinel");
|
|
5
|
+
const withReminderSentinel = (message) => message.includes(silentSessionReminderSentinel_1.SILENT_SESSION_REMINDER_SENTINEL)
|
|
6
|
+
? message
|
|
7
|
+
: `${silentSessionReminderSentinel_1.SILENT_SESSION_REMINDER_SENTINEL} ${message}`;
|
|
4
8
|
const formatMinutes = (seconds) => {
|
|
5
9
|
const minutes = Math.floor(seconds / 60);
|
|
6
10
|
return `${minutes}m`;
|
|
@@ -13,7 +17,7 @@ class ConfigurableSilentSessionMessageComposer {
|
|
|
13
17
|
if (this.templates.mainStalledMessage === null) {
|
|
14
18
|
return this.fallback.composeMainStalledSection(mainSilentSeconds);
|
|
15
19
|
}
|
|
16
|
-
return this.templates.mainStalledMessage;
|
|
20
|
+
return withReminderSentinel(this.templates.mainStalledMessage);
|
|
17
21
|
};
|
|
18
22
|
this.composeSubAgentSection = (subAgents) => {
|
|
19
23
|
if (this.templates.subAgentMessageHeader === null &&
|
|
@@ -29,7 +33,7 @@ class ConfigurableSilentSessionMessageComposer {
|
|
|
29
33
|
if (this.templates.subAgentMessageFooter !== null) {
|
|
30
34
|
sections.push(this.templates.subAgentMessageFooter);
|
|
31
35
|
}
|
|
32
|
-
return sections.join('\n');
|
|
36
|
+
return withReminderSentinel(sections.join('\n'));
|
|
33
37
|
};
|
|
34
38
|
}
|
|
35
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurableSilentSessionMessageComposer.js","sourceRoot":"","sources":["../../../src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ConfigurableSilentSessionMessageComposer.js","sourceRoot":"","sources":["../../../src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts"],"names":[],"mapp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EAAE,CAC7D,CAAC;YACF,MAAM,QAAQ,GAAa,EAAE,CAAC;YAC9B,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,KAAK,IAAI,EAAE,CAAC;gBAClD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;YACtD,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;YACxB,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,KAAK,IAAI,EAAE,CAAC;gBAClD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;YACtD,CAAC;YACD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACnD,CAAC,CAAC;IA/BC,CAAC;CAgCL;AApCD,4FAoCC"}
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.TranscriptOwnerCallStatusProvider = void 0;
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
|
+
const silentSessionReminderSentinel_1 = require("../../domain/usecases/silentSessionReminderSentinel");
|
|
38
39
|
const isRecord = (value) => typeof value === 'object' && value !== null;
|
|
39
40
|
const readString = (value, key) => {
|
|
40
41
|
const candidate = value[key];
|
|
@@ -67,12 +68,24 @@ const extractText = (content) => {
|
|
|
67
68
|
};
|
|
68
69
|
const hasOwnerTextReply = (content) => {
|
|
69
70
|
if (typeof content === 'string') {
|
|
70
|
-
|
|
71
|
+
if (content.length === 0) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
// A monitor-injected self-check reminder lands in the target session's
|
|
75
|
+
// transcript as a user text entry. It carries the reminder sentinel, so it
|
|
76
|
+
// is the monitor talking to the session, not the owner replying. It MUST NOT
|
|
77
|
+
// advance the last-owner-reply time, otherwise an outstanding call-to-user
|
|
78
|
+
// is wrongly treated as answered and the session stops being suppressed.
|
|
79
|
+
return !content.includes(silentSessionReminderSentinel_1.SILENT_SESSION_REMINDER_SENTINEL);
|
|
71
80
|
}
|
|
72
81
|
if (!Array.isArray(content)) {
|
|
73
82
|
return false;
|
|
74
83
|
}
|
|
75
|
-
|
|
84
|
+
const hasTextBlock = content.some((block) => isRecord(block) && block.type === 'text');
|
|
85
|
+
if (!hasTextBlock) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
return !extractText(content).includes(silentSessionReminderSentinel_1.SILENT_SESSION_REMINDER_SENTINEL);
|
|
76
89
|
};
|
|
77
90
|
class TranscriptOwnerCallStatusProvider {
|
|
78
91
|
constructor(ownerCallMarker) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranscriptOwnerCallStatusProvider.js","sourceRoot":"","sources":["../../../src/adapter/repositories/TranscriptOwnerCallStatusProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;
|
|
1
|
+
{"version":3,"file":"TranscriptOwnerCallStatusProvider.js","sourceRoot":"","sources":["../../../src/adapter/repositories/TranscriptOwnerCallStatusProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEzB,uGAAuG;AAEvG,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AAE9C,MAAM,UAAU,GAAG,CACjB,KAA8B,EAC9B,GAAW,EACI,EAAE;IACjB,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1D,CAAC,CAAC;AAEF,MAAM,sBAAsB,GAAG,CAAC,SAAw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,iBAAiB,CAAC,cAAc,CAAC,EAAE,CAAC;oBACzD,qBAAqB,GAAG,OAAO,CAAC;gBAClC,CAAC;YACH,CAAC;YACD,IAAI,oBAAoB,KAAK,IAAI,EAAE,CAAC;gBAClC,OAAO,KAAK,CAAC;YACf,CAAC;YACD,OAAO,CACL,qBAAqB,KAAK,IAAI;gBAC9B,oBAAoB,GAAG,qBAAqB,CAC7C,CAAC;QACJ,CAAC,CAAC;IApE4D,CAAC;CAqEhE;AAtED,8EAsEC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DefaultSilentSessionMessageComposer = void 0;
|
|
4
|
+
const silentSessionReminderSentinel_1 = require("./silentSessionReminderSentinel");
|
|
4
5
|
const formatMinutes = (seconds) => {
|
|
5
6
|
const minutes = Math.floor(seconds / 60);
|
|
6
7
|
return `${minutes}m`;
|
|
@@ -8,7 +9,7 @@ const formatMinutes = (seconds) => {
|
|
|
8
9
|
const composeMainStalledMessage = (mainSilentSeconds) => {
|
|
9
10
|
const minutes = Math.floor(mainSilentSeconds / 60);
|
|
10
11
|
return [
|
|
11
|
-
|
|
12
|
+
`${silentSessionReminderSentinel_1.SILENT_SESSION_REMINDER_SENTINEL} You have produced no output for ${minutes} minutes. Idle waiting wastes this live session and is unacceptable. Always work proactively and stay ahead of the work: anticipate the next steps and, at every point, choose the fastest path so the whole task finishes as early as possible; never wait passively. Finish every task in the shortest possible time — but "fastest" means correct and incident-free, not merely quick: a fast but wrong result is worthless and causes incidents, so be fast without breaking things. Use parallel execution and your whole team of sub-agents to minimize total wall-clock time. Your goal is to drive every task to completion and have the owner confirm that all tasks are done. Do NOT close this session on your own — it is closed only after the owner has verified completion and tells you to close it. Self-check now:`,
|
|
12
13
|
`1. Every request from the owner is registered as a session task and your task list is kept current (mark tasks completed when done); verify nothing is missing or stale.`,
|
|
13
14
|
`2. Your plan is the fastest correct path: parallelize independent work across sub-agents, delegate, and remove needless serialization. Choose the fastest safe method, not the easiest.`,
|
|
14
15
|
`3. A monitor is in place that detects when any sub-agent produces no output for 5 minutes.`,
|
|
@@ -24,7 +25,7 @@ class DefaultSilentSessionMessageComposer {
|
|
|
24
25
|
this.composeSubAgentSection = (subAgents) => {
|
|
25
26
|
const lines = subAgents.map((subAgent) => `- ${subAgent.label}: silent for ${formatMinutes(subAgent.silentSeconds)}, running for ${formatMinutes(subAgent.runningSeconds)}`);
|
|
26
27
|
return [
|
|
27
|
-
|
|
28
|
+
`${silentSessionReminderSentinel_1.SILENT_SESSION_REMINDER_SENTINEL} The following sub-processes have been silent or running for a long time:`,
|
|
28
29
|
...lines,
|
|
29
30
|
'If a sub-process is stalled, take action (restart, hand off, or replace it). If it is legitimately waiting on an external dependency (continuous integration, an external API, or another process), let it continue.',
|
|
30
31
|
].join('\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultSilentSessionMessageComposer.js","sourceRoot":"","sources":["../../../src/domain/usecases/DefaultSilentSessionMessageComposer.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"DefaultSilentSessionMessageComposer.js","sourceRoot":"","sources":["../../../src/domain/usecases/DefaultSilentSessionMessageComposer.ts"],"names":[],"mappings":";;;AAEA,mFAAmF;AAEnF,MAAM,aAAa,GAAG,CAAC,OAAe,EAAU,EAAE;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACzC,OAAO,GAAG,OAAO,GAAG,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,iBAAyB,EAAU,EAAE;IACtE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,GAAG,EAAE,CAAC,CAAC;IACnD,OAAO;QACL,GAAG,gEAAgC,oCAAoC,OAAO,syBAAsyB;QACp3B,0KAA0K;QAC1K,yLAAyL;QACzL,4FAA4F;QAC5F,0YAA0Y;QAC1Y,qHAAqH;KACtH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC,CAAC;AAEF,MAAa,mCAAmC;IAAhD;QACE,8BAAyB,GAAG,CAAC,iBAAyB,EAAU,EAAE;YAChE,OAAO,yBAAyB,CAAC,iBAAiB,CAAC,CAAC;QACtD,CAAC,CAAC;QAEF,2BAAsB,GAAG,CAAC,SAA6B,EAAU,EAAE;YACjE,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CACzB,CAAC,QAAQ,EAAE,EAAE,CACX,KAAK,QAAQ,CAAC,KAAK,gBAAgB,aAAa,CAC9C,QAAQ,CAAC,aAAa,CACvB,iBAAiB,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAC7D,CAAC;YACF,OAAO;gBACL,GAAG,gEAAgC,2EAA2E;gBAC9G,GAAG,KAAK;gBACR,sNAAsN;aACvN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAC;IACJ,CAAC;CAAA;AAlBD,kFAkBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SILENT_SESSION_REMINDER_SENTINEL = void 0;
|
|
4
|
+
// Stable, recognizable marker embedded in every monitor-injected silent-session
|
|
5
|
+
// self-check reminder. It lets owner-reply detection distinguish a reminder that
|
|
6
|
+
// the monitor injected into a session's transcript (which arrives as a user text
|
|
7
|
+
// entry via `tmux send-keys`) from a genuine owner reply, so an injected reminder
|
|
8
|
+
// is never miscounted as the owner answering an outstanding call-to-user. The tag
|
|
9
|
+
// is bracketed and namespaced to make an accidental collision with genuine human
|
|
10
|
+
// owner text effectively impossible.
|
|
11
|
+
exports.SILENT_SESSION_REMINDER_SENTINEL = '[TDPM_SILENT_SESSION_SELF_CHECK_REMINDER]';
|
|
12
|
+
//# sourceMappingURL=silentSessionReminderSentinel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"silentSessionReminderSentinel.js","sourceRoot":"","sources":["../../../src/domain/usecases/silentSessionReminderSentinel.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,iFAAiF;AACjF,iFAAiF;AACjF,kFAAkF;AAClF,kFAAkF;AAClF,iFAAiF;AACjF,qCAAqC;AACxB,QAAA,gCAAgC,GAC3C,2CAA2C,CAAC"}
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import { ProcessEnvironReader } from '../../../domain/usecases/adapter-interface
|
|
|
6
6
|
import { LocalStorageCacheRepository } from '../../repositories/LocalStorageCacheRepository';
|
|
7
7
|
import { LocalStorageRepository } from '../../repositories/LocalStorageRepository';
|
|
8
8
|
import { SilentSessionMessageTemplates } from '../../repositories/ConfigurableSilentSessionMessageComposer';
|
|
9
|
+
import { SILENT_SESSION_REMINDER_SENTINEL } from '../../../domain/usecases/silentSessionReminderSentinel';
|
|
9
10
|
import {
|
|
10
11
|
notifySilentTmuxSessions,
|
|
11
12
|
DEFAULT_NOTIFY_SILENT_TMUX_SESSIONS_PARAMS,
|
|
@@ -170,7 +171,9 @@ describe('notifySilentTmuxSessions', () => {
|
|
|
170
171
|
const sendCall = runner.runCommand.mock.calls.find(
|
|
171
172
|
(call) => call[0] === 'tmux' && call[1][0] === 'send-keys',
|
|
172
173
|
);
|
|
173
|
-
expect(sendCall?.[1][4]).toBe(
|
|
174
|
+
expect(sendCall?.[1][4]).toBe(
|
|
175
|
+
`${SILENT_SESSION_REMINDER_SENTINEL} CUSTOM_MAIN_TEMPLATE`,
|
|
176
|
+
);
|
|
174
177
|
});
|
|
175
178
|
|
|
176
179
|
it('suppresses the main stalled notification when the transcript shows an unanswered owner call', async () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ConfigurableSilentSessionMessageComposer } from './ConfigurableSilentSessionMessageComposer';
|
|
2
2
|
import { SilentSessionMessageComposer } from '../../domain/usecases/adapter-interfaces/SilentSessionMessageComposer';
|
|
3
|
+
import { SILENT_SESSION_REMINDER_SENTINEL } from '../../domain/usecases/silentSessionReminderSentinel';
|
|
3
4
|
|
|
4
5
|
type Mocked<T> = jest.Mocked<T> & jest.MockedObject<T>;
|
|
5
6
|
|
|
@@ -33,7 +34,9 @@ describe('ConfigurableSilentSessionMessageComposer', () => {
|
|
|
33
34
|
},
|
|
34
35
|
fallback,
|
|
35
36
|
);
|
|
36
|
-
|
|
37
|
+
const section = composer.composeMainStalledSection(600);
|
|
38
|
+
expect(section).toContain('CUSTOM_MAIN');
|
|
39
|
+
expect(section).toContain(SILENT_SESSION_REMINDER_SENTINEL);
|
|
37
40
|
expect(fallback.composeMainStalledSection).not.toHaveBeenCalled();
|
|
38
41
|
});
|
|
39
42
|
|
|
@@ -72,6 +75,21 @@ describe('ConfigurableSilentSessionMessageComposer', () => {
|
|
|
72
75
|
expect(section).toContain('silent for 6m');
|
|
73
76
|
expect(section).toContain('running for 20m');
|
|
74
77
|
expect(section).toContain('FOOTER');
|
|
78
|
+
expect(section).toContain(SILENT_SESSION_REMINDER_SENTINEL);
|
|
75
79
|
expect(fallback.composeSubAgentSection).not.toHaveBeenCalled();
|
|
76
80
|
});
|
|
81
|
+
|
|
82
|
+
it('does not double-prepend the sentinel when the template already carries it', () => {
|
|
83
|
+
const fallback = createFallback();
|
|
84
|
+
const composer = new ConfigurableSilentSessionMessageComposer(
|
|
85
|
+
{
|
|
86
|
+
mainStalledMessage: `${SILENT_SESSION_REMINDER_SENTINEL} CUSTOM_MAIN`,
|
|
87
|
+
subAgentMessageHeader: null,
|
|
88
|
+
subAgentMessageFooter: null,
|
|
89
|
+
},
|
|
90
|
+
fallback,
|
|
91
|
+
);
|
|
92
|
+
const section = composer.composeMainStalledSection(600);
|
|
93
|
+
expect(section).toBe(`${SILENT_SESSION_REMINDER_SENTINEL} CUSTOM_MAIN`);
|
|
94
|
+
});
|
|
77
95
|
});
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { SubAgentActivity } from '../../domain/entities/LiveSessionActivitySnapshot';
|
|
2
2
|
import { SilentSessionMessageComposer } from '../../domain/usecases/adapter-interfaces/SilentSessionMessageComposer';
|
|
3
|
+
import { SILENT_SESSION_REMINDER_SENTINEL } from '../../domain/usecases/silentSessionReminderSentinel';
|
|
4
|
+
|
|
5
|
+
const withReminderSentinel = (message: string): string =>
|
|
6
|
+
message.includes(SILENT_SESSION_REMINDER_SENTINEL)
|
|
7
|
+
? message
|
|
8
|
+
: `${SILENT_SESSION_REMINDER_SENTINEL} ${message}`;
|
|
3
9
|
|
|
4
10
|
export type SilentSessionMessageTemplates = {
|
|
5
11
|
mainStalledMessage: string | null;
|
|
@@ -22,7 +28,7 @@ export class ConfigurableSilentSessionMessageComposer implements SilentSessionMe
|
|
|
22
28
|
if (this.templates.mainStalledMessage === null) {
|
|
23
29
|
return this.fallback.composeMainStalledSection(mainSilentSeconds);
|
|
24
30
|
}
|
|
25
|
-
return this.templates.mainStalledMessage;
|
|
31
|
+
return withReminderSentinel(this.templates.mainStalledMessage);
|
|
26
32
|
};
|
|
27
33
|
|
|
28
34
|
composeSubAgentSection = (subAgents: SubAgentActivity[]): string => {
|
|
@@ -46,6 +52,6 @@ export class ConfigurableSilentSessionMessageComposer implements SilentSessionMe
|
|
|
46
52
|
if (this.templates.subAgentMessageFooter !== null) {
|
|
47
53
|
sections.push(this.templates.subAgentMessageFooter);
|
|
48
54
|
}
|
|
49
|
-
return sections.join('\n');
|
|
55
|
+
return withReminderSentinel(sections.join('\n'));
|
|
50
56
|
};
|
|
51
57
|
}
|
|
@@ -2,6 +2,7 @@ import * as fs from 'fs';
|
|
|
2
2
|
import * as os from 'os';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import { TranscriptOwnerCallStatusProvider } from './TranscriptOwnerCallStatusProvider';
|
|
5
|
+
import { SILENT_SESSION_REMINDER_SENTINEL } from '../../domain/usecases/silentSessionReminderSentinel';
|
|
5
6
|
|
|
6
7
|
describe('TranscriptOwnerCallStatusProvider', () => {
|
|
7
8
|
let rootDirectory: string;
|
|
@@ -63,6 +64,29 @@ describe('TranscriptOwnerCallStatusProvider', () => {
|
|
|
63
64
|
},
|
|
64
65
|
});
|
|
65
66
|
|
|
67
|
+
const injectedReminderStringContent = (timestamp: string): object => ({
|
|
68
|
+
type: 'user',
|
|
69
|
+
timestamp,
|
|
70
|
+
message: {
|
|
71
|
+
role: 'user',
|
|
72
|
+
content: `${SILENT_SESSION_REMINDER_SENTINEL} You have produced no output for 10 minutes. Self-check now:`,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const injectedReminderBlockContent = (timestamp: string): object => ({
|
|
77
|
+
type: 'user',
|
|
78
|
+
timestamp,
|
|
79
|
+
message: {
|
|
80
|
+
role: 'user',
|
|
81
|
+
content: [
|
|
82
|
+
{
|
|
83
|
+
type: 'text',
|
|
84
|
+
text: `${SILENT_SESSION_REMINDER_SENTINEL} The following sub-processes have been silent or running for a long time:`,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
|
|
66
90
|
const sessionName = 'workbench';
|
|
67
91
|
|
|
68
92
|
it('reports a session as waiting when the last owner call is newer than the last owner reply', async () => {
|
|
@@ -121,6 +145,49 @@ describe('TranscriptOwnerCallStatusProvider', () => {
|
|
|
121
145
|
expect(result.has(sessionName)).toBe(true);
|
|
122
146
|
});
|
|
123
147
|
|
|
148
|
+
it('does not count a monitor-injected reminder with string content as an owner reply', async () => {
|
|
149
|
+
const transcriptPath = writeTranscript('workbench.jsonl', [
|
|
150
|
+
assistantWithMarker('2026-06-27T10:00:00.000Z'),
|
|
151
|
+
injectedReminderStringContent('2026-06-27T10:10:00.000Z'),
|
|
152
|
+
]);
|
|
153
|
+
const provider = new TranscriptOwnerCallStatusProvider('<<OWNER_CALL>>');
|
|
154
|
+
|
|
155
|
+
const result = await provider.listSessionNamesWithUnansweredOwnerCall(
|
|
156
|
+
new Map([[sessionName, transcriptPath]]),
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
expect(result.has(sessionName)).toBe(true);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it('does not count a monitor-injected reminder with text-block content as an owner reply', async () => {
|
|
163
|
+
const transcriptPath = writeTranscript('workbench.jsonl', [
|
|
164
|
+
assistantWithMarker('2026-06-27T10:00:00.000Z'),
|
|
165
|
+
injectedReminderBlockContent('2026-06-27T10:10:00.000Z'),
|
|
166
|
+
]);
|
|
167
|
+
const provider = new TranscriptOwnerCallStatusProvider('<<OWNER_CALL>>');
|
|
168
|
+
|
|
169
|
+
const result = await provider.listSessionNamesWithUnansweredOwnerCall(
|
|
170
|
+
new Map([[sessionName, transcriptPath]]),
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
expect(result.has(sessionName)).toBe(true);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it('still counts a genuine owner reply that arrives after a monitor-injected reminder', async () => {
|
|
177
|
+
const transcriptPath = writeTranscript('workbench.jsonl', [
|
|
178
|
+
assistantWithMarker('2026-06-27T10:00:00.000Z'),
|
|
179
|
+
injectedReminderStringContent('2026-06-27T10:10:00.000Z'),
|
|
180
|
+
ownerReply('2026-06-27T10:20:00.000Z'),
|
|
181
|
+
]);
|
|
182
|
+
const provider = new TranscriptOwnerCallStatusProvider('<<OWNER_CALL>>');
|
|
183
|
+
|
|
184
|
+
const result = await provider.listSessionNamesWithUnansweredOwnerCall(
|
|
185
|
+
new Map([[sessionName, transcriptPath]]),
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
expect(result.has(sessionName)).toBe(false);
|
|
189
|
+
});
|
|
190
|
+
|
|
124
191
|
it('does not report a session that never raised an owner call', async () => {
|
|
125
192
|
const transcriptPath = writeTranscript('workbench.jsonl', [
|
|
126
193
|
assistantPlain('2026-06-27T10:00:00.000Z'),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import { OwnerCallStatusProvider } from '../../domain/usecases/adapter-interfaces/OwnerCallStatusProvider';
|
|
3
|
+
import { SILENT_SESSION_REMINDER_SENTINEL } from '../../domain/usecases/silentSessionReminderSentinel';
|
|
3
4
|
|
|
4
5
|
const isRecord = (value: unknown): value is Record<string, unknown> =>
|
|
5
6
|
typeof value === 'object' && value !== null;
|
|
@@ -41,12 +42,26 @@ const extractText = (content: unknown): string => {
|
|
|
41
42
|
|
|
42
43
|
const hasOwnerTextReply = (content: unknown): boolean => {
|
|
43
44
|
if (typeof content === 'string') {
|
|
44
|
-
|
|
45
|
+
if (content.length === 0) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
// A monitor-injected self-check reminder lands in the target session's
|
|
49
|
+
// transcript as a user text entry. It carries the reminder sentinel, so it
|
|
50
|
+
// is the monitor talking to the session, not the owner replying. It MUST NOT
|
|
51
|
+
// advance the last-owner-reply time, otherwise an outstanding call-to-user
|
|
52
|
+
// is wrongly treated as answered and the session stops being suppressed.
|
|
53
|
+
return !content.includes(SILENT_SESSION_REMINDER_SENTINEL);
|
|
45
54
|
}
|
|
46
55
|
if (!Array.isArray(content)) {
|
|
47
56
|
return false;
|
|
48
57
|
}
|
|
49
|
-
|
|
58
|
+
const hasTextBlock = content.some(
|
|
59
|
+
(block) => isRecord(block) && block.type === 'text',
|
|
60
|
+
);
|
|
61
|
+
if (!hasTextBlock) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return !extractText(content).includes(SILENT_SESSION_REMINDER_SENTINEL);
|
|
50
65
|
};
|
|
51
66
|
|
|
52
67
|
export class TranscriptOwnerCallStatusProvider implements OwnerCallStatusProvider {
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { DefaultSilentSessionMessageComposer } from './DefaultSilentSessionMessageComposer';
|
|
2
|
+
import { SILENT_SESSION_REMINDER_SENTINEL } from './silentSessionReminderSentinel';
|
|
2
3
|
|
|
3
4
|
describe('DefaultSilentSessionMessageComposer', () => {
|
|
4
5
|
const composer = new DefaultSilentSessionMessageComposer();
|
|
5
6
|
|
|
7
|
+
it('embeds the reminder sentinel in the main-stalled section', () => {
|
|
8
|
+
const section = composer.composeMainStalledSection(600);
|
|
9
|
+
expect(section).toContain(SILENT_SESSION_REMINDER_SENTINEL);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('embeds the reminder sentinel in the sub-agent section', () => {
|
|
13
|
+
const section = composer.composeSubAgentSection([
|
|
14
|
+
{ label: 'sub-process-1', silentSeconds: 360, runningSeconds: 1200 },
|
|
15
|
+
]);
|
|
16
|
+
expect(section).toContain(SILENT_SESSION_REMINDER_SENTINEL);
|
|
17
|
+
});
|
|
18
|
+
|
|
6
19
|
it('renders the configured main-stalled message with the silent minutes substituted', () => {
|
|
7
20
|
const section = composer.composeMainStalledSection(600);
|
|
8
21
|
expect(section).toContain('You have produced no output for 10 minutes.');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SubAgentActivity } from '../entities/LiveSessionActivitySnapshot';
|
|
2
2
|
import { SilentSessionMessageComposer } from './adapter-interfaces/SilentSessionMessageComposer';
|
|
3
|
+
import { SILENT_SESSION_REMINDER_SENTINEL } from './silentSessionReminderSentinel';
|
|
3
4
|
|
|
4
5
|
const formatMinutes = (seconds: number): string => {
|
|
5
6
|
const minutes = Math.floor(seconds / 60);
|
|
@@ -9,7 +10,7 @@ const formatMinutes = (seconds: number): string => {
|
|
|
9
10
|
const composeMainStalledMessage = (mainSilentSeconds: number): string => {
|
|
10
11
|
const minutes = Math.floor(mainSilentSeconds / 60);
|
|
11
12
|
return [
|
|
12
|
-
|
|
13
|
+
`${SILENT_SESSION_REMINDER_SENTINEL} You have produced no output for ${minutes} minutes. Idle waiting wastes this live session and is unacceptable. Always work proactively and stay ahead of the work: anticipate the next steps and, at every point, choose the fastest path so the whole task finishes as early as possible; never wait passively. Finish every task in the shortest possible time — but "fastest" means correct and incident-free, not merely quick: a fast but wrong result is worthless and causes incidents, so be fast without breaking things. Use parallel execution and your whole team of sub-agents to minimize total wall-clock time. Your goal is to drive every task to completion and have the owner confirm that all tasks are done. Do NOT close this session on your own — it is closed only after the owner has verified completion and tells you to close it. Self-check now:`,
|
|
13
14
|
`1. Every request from the owner is registered as a session task and your task list is kept current (mark tasks completed when done); verify nothing is missing or stale.`,
|
|
14
15
|
`2. Your plan is the fastest correct path: parallelize independent work across sub-agents, delegate, and remove needless serialization. Choose the fastest safe method, not the easiest.`,
|
|
15
16
|
`3. A monitor is in place that detects when any sub-agent produces no output for 5 minutes.`,
|
|
@@ -31,7 +32,7 @@ export class DefaultSilentSessionMessageComposer implements SilentSessionMessage
|
|
|
31
32
|
)}, running for ${formatMinutes(subAgent.runningSeconds)}`,
|
|
32
33
|
);
|
|
33
34
|
return [
|
|
34
|
-
|
|
35
|
+
`${SILENT_SESSION_REMINDER_SENTINEL} The following sub-processes have been silent or running for a long time:`,
|
|
35
36
|
...lines,
|
|
36
37
|
'If a sub-process is stalled, take action (restart, hand off, or replace it). If it is legitimately waiting on an external dependency (continuous integration, an external API, or another process), let it continue.',
|
|
37
38
|
].join('\n');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Stable, recognizable marker embedded in every monitor-injected silent-session
|
|
2
|
+
// self-check reminder. It lets owner-reply detection distinguish a reminder that
|
|
3
|
+
// the monitor injected into a session's transcript (which arrives as a user text
|
|
4
|
+
// entry via `tmux send-keys`) from a genuine owner reply, so an injected reminder
|
|
5
|
+
// is never miscounted as the owner answering an outstanding call-to-user. The tag
|
|
6
|
+
// is bracketed and namespaced to make an accidental collision with genuine human
|
|
7
|
+
// owner text effectively impossible.
|
|
8
|
+
export const SILENT_SESSION_REMINDER_SENTINEL =
|
|
9
|
+
'[TDPM_SILENT_SESSION_SELF_CHECK_REMINDER]';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurableSilentSessionMessageComposer.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uEAAuE,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigurableSilentSessionMessageComposer.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uEAAuE,CAAC;AAQrH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC,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,CAK7D;IAEF,sBAAsB,GAAI,WAAW,gBAAgB,EAAE,KAAG,MAAM,CAsB9D;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranscriptOwnerCallStatusProvider.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/TranscriptOwnerCallStatusProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kEAAkE,CAAC;
|
|
1
|
+
{"version":3,"file":"TranscriptOwnerCallStatusProvider.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/TranscriptOwnerCallStatusProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kEAAkE,CAAC;AAiE3G,qBAAa,iCAAkC,YAAW,uBAAuB;IACnE,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,MAAM,GAAG,IAAI;IAE3D,uCAAuC,GACrC,6BAA6B,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAC/C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAYrB;IAEF,OAAO,CAAC,sBAAsB,CAkD5B;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultSilentSessionMessageComposer.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/DefaultSilentSessionMessageComposer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultSilentSessionMessageComposer.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/DefaultSilentSessionMessageComposer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AAoBjG,qBAAa,mCAAoC,YAAW,4BAA4B;IACtF,yBAAyB,GAAI,mBAAmB,MAAM,KAAG,MAAM,CAE7D;IAEF,sBAAsB,GAAI,WAAW,gBAAgB,EAAE,KAAG,MAAM,CAY9D;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"silentSessionReminderSentinel.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/silentSessionReminderSentinel.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gCAAgC,8CACA,CAAC"}
|