@volter/supercode-frontend-vscode 0.1.46 → 0.1.47

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.
Files changed (2) hide show
  1. package/dist/session.js +22 -0
  2. package/package.json +1 -1
package/dist/session.js CHANGED
@@ -1,3 +1,6 @@
1
+ /** How long a turn waits on a connection that dropped before saying it was lost (the follow loop's re-attach backs
2
+ * off to 15 s; this outlasts a few of its attempts). */
3
+ const DISCONNECT_GRACE_MS = 60_000;
1
4
  /** The request this attachment tried to answer is no longer open. */
2
5
  export class RequestNotPendingError extends Error {
3
6
  requestId;
@@ -402,7 +405,25 @@ export class VscodeFrontendSession {
402
405
  // that hangs one is worse than one that ends it a beat early. The
403
406
  // descriptor going idle after the submit is the second, independent signal.
404
407
  let sawBusy = false;
408
+ // A stream that ends is re-attached from its cursor (the extension's follow loop), and the replay ends the turn;
409
+ // only a connection closed, or one still down after DISCONNECT_GRACE_MS, ends the wait, said: a response held open
410
+ // with nothing in it is the silent failure.
411
+ let down;
412
+ const lost = () => fail?.(new Error('The connection to this conversation\'s runtime was lost before its turn ended; the turn may still be running. Reopen the chat to see where it stands.'));
413
+ finished.catch(() => undefined); // a loss while the submit is still in flight is answered by the submit's own error
405
414
  const unwatch = this.onChange(() => {
415
+ if (this.connection === 'closed') {
416
+ lost();
417
+ return;
418
+ }
419
+ if (this.connection === 'connected') {
420
+ clearTimeout(down);
421
+ down = undefined;
422
+ }
423
+ else {
424
+ down ??= setTimeout(lost, DISCONNECT_GRACE_MS);
425
+ return;
426
+ }
406
427
  const state = this.descriptor?.turn_state;
407
428
  if (state === 'busy')
408
429
  sawBusy = true;
@@ -417,6 +438,7 @@ export class VscodeFrontendSession {
417
438
  return await finished;
418
439
  }
419
440
  finally {
441
+ clearTimeout(down);
420
442
  unsubscribe();
421
443
  unwatch();
422
444
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@volter/supercode-frontend-vscode",
3
3
  "displayName": "Volter Harness",
4
- "version": "0.1.46",
4
+ "version": "0.1.47",
5
5
  "type": "module",
6
6
  "description": "VS Code chat-view frontend for an existing Volter Harness SDK runtime",
7
7
  "publisher": "volter-ai-dev",