@rubytech/taskmaster 1.44.7 → 1.44.8
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { loadConfig } from "../config/config.js";
|
|
4
|
+
import { appendUserMessageToSessionTranscript } from "../config/sessions/transcript.js";
|
|
4
5
|
import { loadSessionStore, resolveAgentIdFromSessionKey, resolveMainSessionKey, resolveStorePath, } from "../config/sessions.js";
|
|
5
6
|
import { normalizeMainKey } from "../routing/session-key.js";
|
|
6
7
|
import { resolveQueueSettings } from "../auto-reply/reply/queue.js";
|
|
@@ -395,11 +396,34 @@ export async function runSubagentAnnounceFlow(params) {
|
|
|
395
396
|
}
|
|
396
397
|
if (lastErr) {
|
|
397
398
|
defaultRuntime.error?.(`[subagent-announce] direct send FAILED after ${MAX_ANNOUNCE_ATTEMPTS} attempts ` +
|
|
398
|
-
`for "${taskLabel}" —
|
|
399
|
+
`for "${taskLabel}" — falling back to transcript injection ` +
|
|
399
400
|
`(child=${params.childSessionKey}, requester=${params.requesterSessionKey}, ` +
|
|
400
401
|
`channel=${directOrigin?.channel ?? "none"}, to=${directOrigin?.to ?? "none"}, ` +
|
|
401
402
|
`outcome=${outcome.status}, error=${String(lastErr)})`);
|
|
402
|
-
//
|
|
403
|
+
// Fallback: inject the announce directly into the session transcript so it
|
|
404
|
+
// survives model outages and rate limits. The parent agent will process it
|
|
405
|
+
// on the next user interaction rather than losing it entirely.
|
|
406
|
+
try {
|
|
407
|
+
const agentId = resolveAgentIdFromSessionKey(params.requesterSessionKey);
|
|
408
|
+
const result = await appendUserMessageToSessionTranscript({
|
|
409
|
+
agentId,
|
|
410
|
+
sessionKey: params.requesterSessionKey,
|
|
411
|
+
text: triggerMessage,
|
|
412
|
+
});
|
|
413
|
+
if (result.ok) {
|
|
414
|
+
defaultRuntime.log(`[subagent-announce] fallback transcript injection succeeded for "${taskLabel}" ` +
|
|
415
|
+
`(requester=${params.requesterSessionKey}, file=${result.sessionFile})`);
|
|
416
|
+
didAnnounce = true;
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
defaultRuntime.error?.(`[subagent-announce] fallback transcript injection ALSO failed for "${taskLabel}" ` +
|
|
420
|
+
`— announce lost (reason=${result.reason})`);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
catch (fallbackErr) {
|
|
424
|
+
defaultRuntime.error?.(`[subagent-announce] fallback transcript injection threw for "${taskLabel}" ` +
|
|
425
|
+
`— announce lost (error=${String(fallbackErr)})`);
|
|
426
|
+
}
|
|
403
427
|
}
|
|
404
428
|
else {
|
|
405
429
|
didAnnounce = true;
|
package/dist/build-info.json
CHANGED