@yeaft/webchat-agent 0.1.1077 → 0.1.1078
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/package.json
CHANGED
|
@@ -354,11 +354,16 @@ async function driveSubAgent(agent, subEngine, vpPersona, deps) {
|
|
|
354
354
|
// the bump.
|
|
355
355
|
bumpLivenessFromEvent(agent.liveness, evt);
|
|
356
356
|
|
|
357
|
-
// Mirror to log
|
|
357
|
+
// Mirror every raw event to the durable log, but do not live-stream
|
|
358
|
+
// assistant text to the parent/UI. A sub-agent's answer is consumed
|
|
359
|
+
// as one complete result at sub_agent_turn_end / task_result re-entry;
|
|
360
|
+
// streaming deltas here make the card look like the result itself
|
|
361
|
+
// and can leave users staring at an "idle" preview before the parent
|
|
362
|
+
// VP consumes the completed task result.
|
|
358
363
|
if (agent.outputLog) {
|
|
359
364
|
try { agent.outputLog.write(wrapEvt(evt)); } catch { /* ignore */ }
|
|
360
365
|
}
|
|
361
|
-
if (onEvent) {
|
|
366
|
+
if (onEvent && evt?.type !== 'text_delta') {
|
|
362
367
|
try { onEvent(agent.id, wrapEvt(evt)); } catch { /* ignore listener errors */ }
|
|
363
368
|
}
|
|
364
369
|
|
|
@@ -454,14 +459,15 @@ async function driveSubAgent(agent, subEngine, vpPersona, deps) {
|
|
|
454
459
|
// the agent/task instead of letting the idle watchdog later mark the
|
|
455
460
|
// already-delivered work as abandoned. Legacy in-process callers with
|
|
456
461
|
// no TaskManager keep the old idle/PromptAgent continuation flow.
|
|
457
|
-
emit({ type: 'sub_agent_turn_end', content: assistantText });
|
|
458
462
|
if (agent.taskId && deps.taskManager && agent.parentSessionId) {
|
|
459
463
|
transitionTerminal(agent, STATUS.COMPLETED, {
|
|
460
464
|
diagnostic: 'task_turn_complete',
|
|
461
465
|
deps,
|
|
462
466
|
});
|
|
467
|
+
emit({ type: 'sub_agent_turn_end', content: assistantText, status: STATUS.COMPLETED });
|
|
463
468
|
return;
|
|
464
469
|
}
|
|
470
|
+
emit({ type: 'sub_agent_turn_end', content: assistantText, status: STATUS.IDLE });
|
|
465
471
|
}
|
|
466
472
|
} finally {
|
|
467
473
|
if (wallTimeWatchdog) clearTimeout(wallTimeWatchdog);
|