@fitchmultz/pi-subagents 0.52.3 → 0.52.4

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.52.4] - 2026-10-29
6
+
7
+ ### Fixed
8
+
9
+ - Classify a certificate-selected bridge session deadline as `certificate_expired`, rather than idle-lease expiry, if the timer fires just before the wall-clock deadline. The timer rechecks without renewing the idle lease; depending on the connection-expiry race, a client can still see a connection reset.
10
+
5
11
  ## [0.52.3] - 2026-10-29
6
12
 
7
13
  ### Fixed
@@ -1 +1 @@
1
- export const EXTENSION_BUILD = Object.freeze({"version":"0.52.3","sha256":"56e15afa9487e79b68bb9a924bf3cbb4a62a8492cf4fe882d0496263f87a1e33"});
1
+ export const EXTENSION_BUILD = Object.freeze({"version":"0.52.4","sha256":"d8c708fa06701cc0d5f8770cc729ba6fa204bdc8f76c5f06f5aa9cc3e37b3cc9"});
@@ -63,9 +63,22 @@ export class Session {
63
63
  }
64
64
  touch() {
65
65
  clearTimeout(this.lease);
66
- this.lease = setTimeout(() => this.close(this.expires <= Date.now()
67
- ? new Fault(403, "certificate_expired", "Client certificate expired.")
68
- : new Fault(410, "lease_expired", "Bridge session idle lease expired.")), Math.max(1, Math.min(IDLE_TIMEOUT, this.expires - Date.now())));
66
+ this.armLease(IDLE_TIMEOUT);
67
+ }
68
+ armLease(idle) {
69
+ const due = Math.max(1, Math.min(idle, this.expires - Date.now()));
70
+ this.lease = setTimeout(() => {
71
+ if (this.expires <= Date.now()) {
72
+ this.close(new Fault(403, "certificate_expired", "Client certificate expired."));
73
+ }
74
+ else if (due < idle) {
75
+ // Node can fire before Date.now() reaches the certificate deadline; keep the idle budget.
76
+ this.armLease(idle - due);
77
+ }
78
+ else {
79
+ this.close(new Fault(410, "lease_expired", "Bridge session idle lease expired."));
80
+ }
81
+ }, due);
69
82
  }
70
83
  begin() {
71
84
  this.guard();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fitchmultz/pi-subagents",
3
- "version": "0.52.3",
3
+ "version": "0.52.4",
4
4
  "description": "Pi extension for subagent orchestration and local session coordination",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -87,15 +87,20 @@ export class Session {
87
87
  }
88
88
  private touch(): void {
89
89
  clearTimeout(this.lease);
90
- this.lease = setTimeout(
91
- () =>
92
- this.close(
93
- this.expires <= Date.now()
94
- ? new Fault(403, "certificate_expired", "Client certificate expired.")
95
- : new Fault(410, "lease_expired", "Bridge session idle lease expired."),
96
- ),
97
- Math.max(1, Math.min(IDLE_TIMEOUT, this.expires - Date.now())),
98
- );
90
+ this.armLease(IDLE_TIMEOUT);
91
+ }
92
+ private armLease(idle: number): void {
93
+ const due = Math.max(1, Math.min(idle, this.expires - Date.now()));
94
+ this.lease = setTimeout(() => {
95
+ if (this.expires <= Date.now()) {
96
+ this.close(new Fault(403, "certificate_expired", "Client certificate expired."));
97
+ } else if (due < idle) {
98
+ // Node can fire before Date.now() reaches the certificate deadline; keep the idle budget.
99
+ this.armLease(idle - due);
100
+ } else {
101
+ this.close(new Fault(410, "lease_expired", "Bridge session idle lease expired."));
102
+ }
103
+ }, due);
99
104
  }
100
105
  begin(): AbortController {
101
106
  this.guard();