@tangle-network/agent-provider-tangle 1.3.1 → 1.3.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.
|
@@ -147,11 +147,19 @@ export function sandboxSessionAsAgentSession(session, controlRef, provider, envi
|
|
|
147
147
|
sessionId: session.id,
|
|
148
148
|
...(useExactExecutionStream ? { streamBound: true } : {}),
|
|
149
149
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
// The sidecar stamps `id:` only on frames that have a replay-buffer position
|
|
151
|
+
// (agent-dev-container apps/sidecar/src/routes/agents-events.ts). A frame with no
|
|
152
|
+
// position carries no id by the SSE contract, so a reconnect resumes from the last
|
|
153
|
+
// frame that had one. Refusing such a frame ended the whole stream, and with it the
|
|
154
|
+
// terminal receipt that carries the execution's token usage: three long pi turns on
|
|
155
|
+
// 2026-09-15 settled at 0 tokens over 846-1693 s each for exactly this reason. An
|
|
156
|
+
// id-less frame cannot be replayed, so it cannot arrive twice; deliver it without
|
|
157
|
+
// dedup and leave the cursor where it was.
|
|
158
|
+
if (converted.id !== undefined) {
|
|
159
|
+
if (seenEventIds.has(converted.id))
|
|
160
|
+
continue;
|
|
161
|
+
seenEventIds.add(converted.id);
|
|
162
|
+
}
|
|
155
163
|
options?.signal?.throwIfAborted();
|
|
156
164
|
yield stepUsage?.observe(converted) ?? converted;
|
|
157
165
|
}
|