@aexol/spectral 0.2.18 → 0.2.19
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/dist/server/pi-bridge.js +4 -0
- package/package.json +1 -1
package/dist/server/pi-bridge.js
CHANGED
|
@@ -656,6 +656,10 @@ export class PiBridge {
|
|
|
656
656
|
if (this.disposed)
|
|
657
657
|
return;
|
|
658
658
|
this.disposed = true;
|
|
659
|
+
// Persist the current in-flight message (if any) before tearing down.
|
|
660
|
+
// Without this, cancelling mid-turn loses the message along with its
|
|
661
|
+
// token_usage event, which breaks context-window tracking on reconnect.
|
|
662
|
+
this.finalizePendingMessage();
|
|
659
663
|
try {
|
|
660
664
|
this.unsubscribe?.();
|
|
661
665
|
}
|