perf(subagents): speed announce retry polling and trim duplicate e2e coverage

This commit is contained in:
Peter Steinberger
2026-02-14 00:28:12 +00:00
parent 4d1461011d
commit 6daa4911e7
2 changed files with 4 additions and 57 deletions

View File

@@ -298,6 +298,7 @@ async function readLatestAssistantReplyWithRetry(params: {
initialReply?: string;
maxWaitMs: number;
}): Promise<string | undefined> {
const RETRY_INTERVAL_MS = 100;
let reply = params.initialReply?.trim() ? params.initialReply : undefined;
if (reply) {
return reply;
@@ -305,7 +306,7 @@ async function readLatestAssistantReplyWithRetry(params: {
const deadline = Date.now() + Math.max(0, Math.min(params.maxWaitMs, 15_000));
while (Date.now() < deadline) {
await new Promise((resolve) => setTimeout(resolve, 300));
await new Promise((resolve) => setTimeout(resolve, RETRY_INTERVAL_MS));
const latest = await readLatestAssistantReply({ sessionKey: params.sessionKey });
if (latest?.trim()) {
return latest;