@mjasnikovs/pi-task 0.24.2 → 0.24.3
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.
|
@@ -96,8 +96,14 @@ export declare class CommandWatchdog {
|
|
|
96
96
|
private fire;
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
|
-
* Real-clock schedule/cancel
|
|
100
|
-
*
|
|
101
|
-
*
|
|
99
|
+
* Real-clock schedule/cancel. Shared by both adapters; tests substitute a fake
|
|
100
|
+
* scheduler instead.
|
|
101
|
+
*
|
|
102
|
+
* REF'd, for the same measured reason as the stream watchdog's poll (see
|
|
103
|
+
* realStreamTimerDeps): under Bun on windows an unref'd timer never fires once
|
|
104
|
+
* nothing ref'd is pending, and a child sitting in a hung command is exactly
|
|
105
|
+
* that state — so the unref disabled the guard in the one case it exists for.
|
|
106
|
+
* The timer is cleared when the tool ends and in runWorker's `finally`, so it
|
|
107
|
+
* cannot outlive the call it watches.
|
|
102
108
|
*/
|
|
103
109
|
export declare const realTimerDeps: Pick<WatchdogDeps, 'schedule' | 'cancel'>;
|
|
@@ -141,18 +141,17 @@ export class CommandWatchdog {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
|
-
* Real-clock schedule/cancel
|
|
145
|
-
*
|
|
146
|
-
*
|
|
144
|
+
* Real-clock schedule/cancel. Shared by both adapters; tests substitute a fake
|
|
145
|
+
* scheduler instead.
|
|
146
|
+
*
|
|
147
|
+
* REF'd, for the same measured reason as the stream watchdog's poll (see
|
|
148
|
+
* realStreamTimerDeps): under Bun on windows an unref'd timer never fires once
|
|
149
|
+
* nothing ref'd is pending, and a child sitting in a hung command is exactly
|
|
150
|
+
* that state — so the unref disabled the guard in the one case it exists for.
|
|
151
|
+
* The timer is cleared when the tool ends and in runWorker's `finally`, so it
|
|
152
|
+
* cannot outlive the call it watches.
|
|
147
153
|
*/
|
|
148
154
|
export const realTimerDeps = {
|
|
149
|
-
schedule: (fn, ms) =>
|
|
150
|
-
const handle = setTimeout(fn, ms);
|
|
151
|
-
if (typeof handle.unref === 'function') {
|
|
152
|
-
;
|
|
153
|
-
handle.unref();
|
|
154
|
-
}
|
|
155
|
-
return handle;
|
|
156
|
-
},
|
|
155
|
+
schedule: (fn, ms) => setTimeout(fn, ms),
|
|
157
156
|
cancel: handle => clearTimeout(handle)
|
|
158
157
|
};
|
|
@@ -103,9 +103,23 @@ export declare class StreamWatchdog {
|
|
|
103
103
|
check(): void;
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
|
-
* Real-clock poll deps
|
|
107
|
-
*
|
|
108
|
-
*
|
|
106
|
+
* Real-clock poll deps. `schedule` returns a repeating interval — the machine
|
|
107
|
+
* cancels it on stop/fire, and runChild's cleanup() stops the watchdog on every
|
|
108
|
+
* settle path (close, error, abort), so it cannot outlive the child it watches.
|
|
109
|
+
*
|
|
110
|
+
* The poll is REF'd, deliberately. It used to be unref'd, on the reasoning that a
|
|
111
|
+
* pending watchdog poll should never keep the process alive at exit — but under
|
|
112
|
+
* Bun on WINDOWS an unref'd timer does not fire at all once nothing ref'd is
|
|
113
|
+
* pending. Measured on a windows-latest runner (bun 1.3.14): an unref'd interval
|
|
114
|
+
* with nothing else pending never fired in 20s, while the identical ref'd one
|
|
115
|
+
* fired at 101ms; on linux both fire at 100ms.
|
|
116
|
+
*
|
|
117
|
+
* That state — no ref'd work outstanding — is EXACTLY the state this watchdog
|
|
118
|
+
* exists to police: a child whose model stream has gone silent. So the unref
|
|
119
|
+
* disabled the guard precisely when it was needed, and every stream-stall
|
|
120
|
+
* integration test hung forever on windows (CI runs 30476786365, 30477802633,
|
|
121
|
+
* 30478455402 — it hangs at v0.24.1 too, so this predates that release).
|
|
122
|
+
* A poll that can delay exit by one interval is the cheaper failure.
|
|
109
123
|
*/
|
|
110
124
|
export declare const realStreamTimerDeps: Pick<StreamWatchdogDeps, 'now' | 'schedule' | 'cancel'>;
|
|
111
125
|
/**
|
|
@@ -148,20 +148,27 @@ export class StreamWatchdog {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
|
-
* Real-clock poll deps
|
|
152
|
-
*
|
|
153
|
-
*
|
|
151
|
+
* Real-clock poll deps. `schedule` returns a repeating interval — the machine
|
|
152
|
+
* cancels it on stop/fire, and runChild's cleanup() stops the watchdog on every
|
|
153
|
+
* settle path (close, error, abort), so it cannot outlive the child it watches.
|
|
154
|
+
*
|
|
155
|
+
* The poll is REF'd, deliberately. It used to be unref'd, on the reasoning that a
|
|
156
|
+
* pending watchdog poll should never keep the process alive at exit — but under
|
|
157
|
+
* Bun on WINDOWS an unref'd timer does not fire at all once nothing ref'd is
|
|
158
|
+
* pending. Measured on a windows-latest runner (bun 1.3.14): an unref'd interval
|
|
159
|
+
* with nothing else pending never fired in 20s, while the identical ref'd one
|
|
160
|
+
* fired at 101ms; on linux both fire at 100ms.
|
|
161
|
+
*
|
|
162
|
+
* That state — no ref'd work outstanding — is EXACTLY the state this watchdog
|
|
163
|
+
* exists to police: a child whose model stream has gone silent. So the unref
|
|
164
|
+
* disabled the guard precisely when it was needed, and every stream-stall
|
|
165
|
+
* integration test hung forever on windows (CI runs 30476786365, 30477802633,
|
|
166
|
+
* 30478455402 — it hangs at v0.24.1 too, so this predates that release).
|
|
167
|
+
* A poll that can delay exit by one interval is the cheaper failure.
|
|
154
168
|
*/
|
|
155
169
|
export const realStreamTimerDeps = {
|
|
156
170
|
now: () => Date.now(),
|
|
157
|
-
schedule: (fn, ms) =>
|
|
158
|
-
const handle = setInterval(fn, ms);
|
|
159
|
-
if (typeof handle.unref === 'function') {
|
|
160
|
-
;
|
|
161
|
-
handle.unref();
|
|
162
|
-
}
|
|
163
|
-
return handle;
|
|
164
|
-
},
|
|
171
|
+
schedule: (fn, ms) => setInterval(fn, ms),
|
|
165
172
|
cancel: handle => clearInterval(handle)
|
|
166
173
|
};
|
|
167
174
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mjasnikovs/pi-task",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.3",
|
|
4
4
|
"description": "Deterministic task planning and spec-orchestration for local models — crash-safe /task pipelines with verify/enforce gates, a real-time remote web view, and web/docs/fetch/worker subagent tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|