github-issue-tower-defence-management 1.111.0 → 1.111.1
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 +2 -2
- package/bin/adapter/repositories/TranscriptSessionSubAgentActivityRepository.js +2 -1
- package/bin/adapter/repositories/TranscriptSessionSubAgentActivityRepository.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.test.ts +29 -0
- package/src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.ts +4 -1
- package/types/adapter/repositories/TranscriptSessionSubAgentActivityRepository.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [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
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **schedule:** treat stop_sequence as a completed sub-agent in stall detection ([#1034](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/issues/1034)) ([0318011](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/0318011691871b1d8141eed735de911a15866e92)), closes [#1033](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/issues/1033)
|
|
7
|
+
|
|
1
8
|
# [1.111.0](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.110.1...v1.111.0) (2026-06-27)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -288,7 +288,7 @@ silentNotificationEnabled?: boolean # Optional: Master switch for the silent liv
|
|
|
288
288
|
subAgentOutputRootDirectory?: string # Optional: Root directory holding one output file per sub-process (file name derived from the sub-process label). The modification time of each file is read to compute how long the sub-process output has been idle. When unset, sub-process idle time is reported as 0 and only the running-time threshold can trigger a sub-process notification
|
|
289
289
|
subAgentProcessMatchPattern?: string # Optional: Regular expression matched against each process command line to discover the sub-processes that belong to a monitored session. The expression must define a named capture group `session` whose value equals the monitored session name, and may define a named capture group `label` used as the display name. When unset, the sub-process check is skipped
|
|
290
290
|
ownerCallMarker?: string # Optional: Marker substring that identifies an assistant message asking the owner for a decision or confirmation. When set, the main-session stalled section is suppressed while a session's latest marker-bearing assistant message is newer (by full timestamp) than its latest genuine owner reply. When unset, no session is treated as waiting on the owner
|
|
291
|
-
subAgentTranscriptRootDirectory?: string # Optional: Root directory under which each session has a `<sessionName>/subagents/` directory holding one `agent-<id>.jsonl` transcript per sub-agent. A sub-agent whose latest transcript entry reports a `stop_reason` of `end_turn` is treated as finished and skipped; for any other sub-agent the idle time is computed from the transcript file modification time (following symlinks) and the running time from its first entry timestamp. When set, this transcript-based discovery is used instead of `subAgentProcessMatchPattern`. When unset, the process-match discovery is used
|
|
291
|
+
subAgentTranscriptRootDirectory?: string # Optional: Root directory under which each session has a `<sessionName>/subagents/` directory holding one `agent-<id>.jsonl` transcript per sub-agent. A sub-agent whose latest transcript entry reports a `stop_reason` of `end_turn` or `stop_sequence` is treated as finished and skipped; for any other sub-agent the idle time is computed from the transcript file modification time (following symlinks) and the running time from its first entry timestamp. When set, this transcript-based discovery is used instead of `subAgentProcessMatchPattern`. When unset, the process-match discovery is used
|
|
292
292
|
mainSilentThresholdSeconds?: number # Optional: Seconds of main-session output silence after which the main-session self-check section is sent. Default 600
|
|
293
293
|
subAgentSilentThresholdSeconds?: number # Optional: Seconds of sub-process output silence after which the sub-process section is sent. Default 300
|
|
294
294
|
subAgentRunningThresholdSeconds?: number # Optional: Seconds a sub-process may run before the sub-process section is sent regardless of its output silence. Default 900
|
|
@@ -560,7 +560,7 @@ Sessions are selected purely from the live process tree, independently of sessio
|
|
|
560
560
|
|
|
561
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.
|
|
562
562
|
|
|
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`) 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.
|
|
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
|
|
|
565
565
|
A per-session cooldown (`silentNotificationCooldownSeconds`) prevents repeated notifications, persisted via the existing cache. When more than one session is notified in the same cycle, the sends are spaced out sequentially with `silentNotificationStaggerSeconds` between consecutive sends (no wait before the first or after the last) so the targets are not all triggered at once. Process-snapshot collection, transcript resolution, owner-call detection, the wait between sends, and the message wording are all performed through injectable ports, so the logic is unit-testable without touching the host, and the host-specific process and environment access, sub-process pattern, and message wording are supplied through adapters or configuration. When `silentNotificationEnabled` is not true the step is a no-op, and any error during the step is logged and swallowed so the schedule cycle is never affected.
|
|
566
566
|
|
|
@@ -133,7 +133,8 @@ class TranscriptSessionSubAgentActivityRepository {
|
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
135
135
|
const transcript = parseTranscript(content);
|
|
136
|
-
if (transcript.lastStopReason === 'end_turn'
|
|
136
|
+
if (transcript.lastStopReason === 'end_turn' ||
|
|
137
|
+
transcript.lastStopReason === 'stop_sequence') {
|
|
137
138
|
return null;
|
|
138
139
|
}
|
|
139
140
|
const silentSeconds = clampToZero(nowEpochSeconds - Math.floor(stats.mtimeMs / 1000));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranscriptSessionSubAgentActivityRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAK7B,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,iBAAiB,GAAG,CAAC,SAAwB,EAAiB,EAAE;IACpE,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAA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AM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC;gBAC5B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACnE,SAAS;gBACX,CAAC;gBACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;gBAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;gBACtE,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;oBACtB,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC;YACD,OAAO,UAAU,CAAC;QACpB,CAAC,CAAC;QAEM,eAAU,GAAG,CACnB,QAAgB,EAChB,QAAgB,EAChB,eAAuB,EACE,EAAE;YAC3B,IAAI,OAAe,CAAC;YACpB,IAAI,KAAe,CAAC;YACpB,IAAI,CAAC;gBACH,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAC5C,KAAK,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChC,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,UAAU,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;YAC5C,
|
|
1
|
+
{"version":3,"file":"TranscriptSessionSubAgentActivityRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAK7B,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KA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C;gBACH,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAC5C,KAAK,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAChC,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,UAAU,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;YAC5C,IACE,UAAU,CAAC,cAAc,KAAK,UAAU;gBACxC,UAAU,CAAC,cAAc,KAAK,eAAe,EAC7C,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,aAAa,GAAG,WAAW,CAC/B,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CACnD,CAAC;YACF,MAAM,cAAc,GAClB,UAAU,CAAC,sBAAsB,KAAK,IAAI;gBACxC,CAAC,CAAC,CAAC;gBACH,CAAC,CAAC,WAAW,CAAC,eAAe,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;YACvE,OAAO;gBACL,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;gBACvC,aAAa;gBACb,cAAc;aACf,CAAC;QACJ,CAAC,CAAC;IA9EC,CAAC;CA+EL;AAnFD,kGAmFC"}
|
package/package.json
CHANGED
|
@@ -67,6 +67,15 @@ describe('TranscriptSessionSubAgentActivityRepository', () => {
|
|
|
67
67
|
},
|
|
68
68
|
];
|
|
69
69
|
|
|
70
|
+
const stopSequenceFinishedEntries = (startTimestamp: string): object[] => [
|
|
71
|
+
{ type: 'user', timestamp: startTimestamp, message: { role: 'user' } },
|
|
72
|
+
{
|
|
73
|
+
type: 'assistant',
|
|
74
|
+
timestamp: startTimestamp,
|
|
75
|
+
message: { role: 'assistant', stop_reason: 'stop_sequence' },
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
|
|
70
79
|
it('reports a running sub-agent with silent seconds from the file mtime and running seconds from the first entry', async () => {
|
|
71
80
|
const sessionName = 'https_//github_com/owner/repo/issues/9';
|
|
72
81
|
const startTimestamp = '2026-06-27T11:45:00.000Z';
|
|
@@ -110,6 +119,26 @@ describe('TranscriptSessionSubAgentActivityRepository', () => {
|
|
|
110
119
|
expect(result.size).toBe(0);
|
|
111
120
|
});
|
|
112
121
|
|
|
122
|
+
it('excludes a finished sub-agent whose last entry stop_reason is stop_sequence', async () => {
|
|
123
|
+
const sessionName = 'https_//github_com/owner/repo/issues/9';
|
|
124
|
+
writeAgentTranscript(
|
|
125
|
+
sessionName,
|
|
126
|
+
'done2',
|
|
127
|
+
stopSequenceFinishedEntries('2026-06-27T11:00:00.000Z'),
|
|
128
|
+
nowEpochSeconds - 30,
|
|
129
|
+
);
|
|
130
|
+
const repository = new TranscriptSessionSubAgentActivityRepository(
|
|
131
|
+
createResolver(),
|
|
132
|
+
now,
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
const result = await repository.listSubAgentActivitiesBySessionName([
|
|
136
|
+
sessionName,
|
|
137
|
+
]);
|
|
138
|
+
|
|
139
|
+
expect(result.size).toBe(0);
|
|
140
|
+
});
|
|
141
|
+
|
|
113
142
|
it('follows a symlinked transcript when computing silent seconds', async () => {
|
|
114
143
|
const sessionName = 'https_//github_com/owner/repo/issues/9';
|
|
115
144
|
const targetDir = fs.mkdtempSync(
|
|
@@ -126,7 +126,10 @@ export class TranscriptSessionSubAgentActivityRepository implements SessionSubAg
|
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
128
|
const transcript = parseTranscript(content);
|
|
129
|
-
if (
|
|
129
|
+
if (
|
|
130
|
+
transcript.lastStopReason === 'end_turn' ||
|
|
131
|
+
transcript.lastStopReason === 'stop_sequence'
|
|
132
|
+
) {
|
|
130
133
|
return null;
|
|
131
134
|
}
|
|
132
135
|
const silentSeconds = clampToZero(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranscriptSessionSubAgentActivityRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,iCAAiC,EAAE,MAAM,4EAA4E,CAAC;AAC/H,OAAO,EAAE,mCAAmC,EAAE,MAAM,8EAA8E,CAAC;AA4DnI,qBAAa,2CAA4C,YAAW,iCAAiC;IAEjG,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,GAAG;gBADH,iBAAiB,EAAE,mCAAmC,EACtD,GAAG,EAAE,IAAI;IAG5B,mCAAmC,GACjC,cAAc,MAAM,EAAE,KACrB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAezC;IAEF,OAAO,CAAC,iBAAiB,CAuBvB;IAEF,OAAO,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"TranscriptSessionSubAgentActivityRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,iCAAiC,EAAE,MAAM,4EAA4E,CAAC;AAC/H,OAAO,EAAE,mCAAmC,EAAE,MAAM,8EAA8E,CAAC;AA4DnI,qBAAa,2CAA4C,YAAW,iCAAiC;IAEjG,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,GAAG;gBADH,iBAAiB,EAAE,mCAAmC,EACtD,GAAG,EAAE,IAAI;IAG5B,mCAAmC,GACjC,cAAc,MAAM,EAAE,KACrB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAezC;IAEF,OAAO,CAAC,iBAAiB,CAuBvB;IAEF,OAAO,CAAC,UAAU,CAgChB;CACH"}
|