@bivy/bivy 0.16.11-staging.1 → 0.16.11-staging.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.
|
@@ -309,6 +309,10 @@ export class AgentService {
|
|
|
309
309
|
// ---- event forwarding + snapshots ----------------------------------------
|
|
310
310
|
forward(svc, event) {
|
|
311
311
|
svc.lastActiveAt = this.now(); // any runtime event is activity (reaper anchor)
|
|
312
|
+
if (event.type === "agent_start" || event.type === "turn_start")
|
|
313
|
+
svc.turnEnded = false;
|
|
314
|
+
if (event.type === "agent_end")
|
|
315
|
+
svc.turnEnded = true;
|
|
312
316
|
const conn = svc.conn;
|
|
313
317
|
if (!conn)
|
|
314
318
|
return; // detached: the daemon re-syncs full state on attach
|
|
@@ -342,6 +346,10 @@ export class AgentService {
|
|
|
342
346
|
snapshotDelta(svc, authoritative = false) {
|
|
343
347
|
const s = svc.session;
|
|
344
348
|
const now = this.mirror(s);
|
|
349
|
+
// Lifecycle events own the wire state, not the ordering of SDK cleanup.
|
|
350
|
+
// Keep late metadata events from reviving a completed turn, too.
|
|
351
|
+
if (svc.turnEnded)
|
|
352
|
+
now.isStreaming = false;
|
|
345
353
|
const prev = svc.lastSent;
|
|
346
354
|
const delta = {};
|
|
347
355
|
let changed = false;
|
|
@@ -381,7 +389,7 @@ export class AgentService {
|
|
|
381
389
|
return {
|
|
382
390
|
sessionId: s.id,
|
|
383
391
|
cwd: s.cwd,
|
|
384
|
-
isStreaming: s.isStreaming,
|
|
392
|
+
isStreaming: !svc.turnEnded && s.isStreaming,
|
|
385
393
|
sessionFile: s.sessionFile ?? null,
|
|
386
394
|
name: s.getName() ?? null,
|
|
387
395
|
currentModel: s.getCurrentModel() ?? null,
|
package/package.json
CHANGED