pi-harness-runtime 1.1.237 → 1.1.238
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/index.ts +20 -9
- package/package.json +1 -1
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/architecture-generator/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard-plugin/package.json +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/package.json +1 -1
- package/packages/doc-generator/package.json +1 -1
- package/packages/e2e-tester/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/feedback-collector/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/health-monitor/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/dist/continuation-controller.d.ts +20 -0
- package/packages/jev-judge/dist/continuation-controller.d.ts.map +1 -1
- package/packages/jev-judge/dist/continuation-controller.js +57 -6
- package/packages/jev-judge/dist/continuation-controller.js.map +1 -1
- package/packages/jev-judge/dist/task-intake.d.ts +21 -1
- package/packages/jev-judge/dist/task-intake.d.ts.map +1 -1
- package/packages/jev-judge/dist/task-intake.js +28 -13
- package/packages/jev-judge/dist/task-intake.js.map +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/jev-judge/src/continuation-controller.ts +64 -6
- package/packages/jev-judge/src/task-intake.ts +38 -17
- package/packages/knowledge-graph/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/milestone-manager/package.json +1 -1
- package/packages/model-registry/package.json +1 -1
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +1 -1
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-bootstrap/package.json +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/skills/package.json +1 -1
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/package.json +1 -1
- package/packages/telegram/package.json +1 -1
- package/packages/tencentdb-memory/package.json +1 -1
- package/packages/tencentdb-sync/package.json +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/packages/write-review/package.json +1 -1
package/index.ts
CHANGED
|
@@ -510,12 +510,20 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
510
510
|
|
|
511
511
|
// Wire user messages to task intake
|
|
512
512
|
pi.on("message_start", (event) => {
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
|
|
513
|
+
const msgEvent = event as { message?: { role?: string; content?: string | Array<{ type?: string; text?: string }>; customType?: string } };
|
|
514
|
+
const msg = msgEvent.message;
|
|
515
|
+
if (!msg) return;
|
|
516
|
+
|
|
517
|
+
// Skip harness-generated messages (internal use)
|
|
518
|
+
if (msg.customType?.startsWith("harness:")) {
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
if (msg.role === "user" && taskIntakeController) {
|
|
523
|
+
// Temporary pause for user input processing (auto-clears on next decision)
|
|
516
524
|
if (todoContinuationController) {
|
|
517
|
-
todoContinuationController.
|
|
518
|
-
logToFile("[auto-continue]", "User input received, pausing
|
|
525
|
+
todoContinuationController.tempPause();
|
|
526
|
+
logToFile("[auto-continue]", "User input received, temp pausing");
|
|
519
527
|
}
|
|
520
528
|
|
|
521
529
|
// Extract user message content
|
|
@@ -532,13 +540,16 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
532
540
|
}
|
|
533
541
|
|
|
534
542
|
// Evaluate with task intake controller (non-blocking)
|
|
535
|
-
if (userMessage.trim().length > 10 && taskIntakeController) {
|
|
543
|
+
if (userMessage.trim().length > 10 && taskIntakeController && todoContinuationController) {
|
|
536
544
|
const intake = taskIntakeController;
|
|
537
|
-
|
|
545
|
+
const controller = todoContinuationController;
|
|
546
|
+
|
|
547
|
+
// Get current todos for duplicate detection
|
|
548
|
+
intake.evaluateWithTodos(userMessage, controller).then(async (result) => {
|
|
538
549
|
if (result.actionable && result.action !== "skip") {
|
|
539
550
|
logToFile("[auto-continue]", "Task intake result:", JSON.stringify(result));
|
|
540
|
-
// Request capture if actionable
|
|
541
|
-
await intake.requestCapture(userMessage);
|
|
551
|
+
// Request capture if actionable using harness custom message
|
|
552
|
+
await intake.requestCapture(userMessage, "harness:task-capture");
|
|
542
553
|
}
|
|
543
554
|
}).catch((err) => {
|
|
544
555
|
logToFile("[auto-continue]", "Task intake error:", String(err));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/capability-registry",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.238",
|
|
4
4
|
"description": "Capability Registry for pi-harness-runtime — tracks model capabilities and enables capability-based routing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,6 +26,7 @@ export interface ContinuationState {
|
|
|
26
26
|
lastMessageId: string | null;
|
|
27
27
|
continuationQueued: boolean;
|
|
28
28
|
userPaused: boolean;
|
|
29
|
+
explicitPause: boolean;
|
|
29
30
|
lastSteerMessage: string | null;
|
|
30
31
|
steerAttemptsForCurrentItem: number;
|
|
31
32
|
lastItemContinued: number | null;
|
|
@@ -50,11 +51,29 @@ export declare class TodoContinuationController {
|
|
|
50
51
|
private config;
|
|
51
52
|
private todoProvider;
|
|
52
53
|
private state;
|
|
54
|
+
private _inFlight;
|
|
53
55
|
constructor(ctx: TodoContext, config?: ContinuationConfig);
|
|
54
56
|
/**
|
|
55
57
|
* Check if continuation is allowed (not paused, session idle)
|
|
56
58
|
*/
|
|
57
59
|
private canContinue;
|
|
60
|
+
/**
|
|
61
|
+
* User explicitly paused - only this clears on explicit resume
|
|
62
|
+
*/
|
|
63
|
+
explicitPause(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Resume from explicit pause
|
|
66
|
+
*/
|
|
67
|
+
resume(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Temporary pause for user input processing
|
|
70
|
+
* Does not require explicit resume
|
|
71
|
+
*/
|
|
72
|
+
tempPause(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Clear continuation queue (called when work completes or starts)
|
|
75
|
+
*/
|
|
76
|
+
clearQueue(): void;
|
|
58
77
|
/**
|
|
59
78
|
* Public method to evaluate and execute continuation
|
|
60
79
|
* Called by external handlers (e.g., agent_settled)
|
|
@@ -67,6 +86,7 @@ export declare class TodoContinuationController {
|
|
|
67
86
|
continueItem(item: TodoItem): Promise<void>;
|
|
68
87
|
/**
|
|
69
88
|
* Guarded dispatch - checks all conditions before sending
|
|
89
|
+
* Uses in-flight guard to prevent race conditions
|
|
70
90
|
*/
|
|
71
91
|
private guardedDispatch;
|
|
72
92
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continuation-controller.d.ts","sourceRoot":"","sources":["../src/continuation-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAmBhE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,iEAAiE;IACjE,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IA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O,CAAC,YAAY,CAAwC;IAE5D,OAAO,CAAC,KAAK,CAcX;IAEF,OAAO,CAAC,SAAS,CAAS;IAE1B,YAAY,GAAG,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,kBAAkB,EAUxD;IAED;;OAEG;IACH,OAAO,CAAC,WAAW;IAiBnB;;OAEG;IACH,aAAa,IAAI,IAAI,CAIpB;IAED;;OAEG;IACH,MAAM,IAAI,IAAI,CAOb;IAED;;;OAGG;IACH,SAAS,IAAI,IAAI,CAGhB;IAED;;OAEG;IACH,UAAU,IAAI,IAAI,CAIjB;IAED;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAmF1C;IAED;;OAEG;IACG,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BhD;IAED;;;OAGG;YACW,eAAe;IA0D7B;;OAEG;IACG,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBnD;IAED;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIjD;IAED;;OAEG;IACH,KAAK,IAAI,IAAI,CAIZ;IAED;;OAEG;IACH,MAAM,IAAI,IAAI,CAiBb;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAIf;IAED;;OAEG;IACH,QAAQ,IAAI;QAAE,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;QAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAM7E;CACD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACrC,GAAG,EAAE,WAAW,EAChB,MAAM,CAAC,EAAE,kBAAkB,GACzB,0BAA0B,CAE5B"}
|
|
@@ -33,11 +33,13 @@ export class TodoContinuationController {
|
|
|
33
33
|
lastMessageId: null,
|
|
34
34
|
continuationQueued: false,
|
|
35
35
|
userPaused: false,
|
|
36
|
+
explicitPause: false,
|
|
36
37
|
lastSteerMessage: null,
|
|
37
38
|
steerAttemptsForCurrentItem: 0,
|
|
38
39
|
lastItemContinued: null,
|
|
39
40
|
lastEvaluationResult: null,
|
|
40
41
|
};
|
|
42
|
+
_inFlight = false; // Guard against concurrent dispatches
|
|
41
43
|
constructor(ctx, config) {
|
|
42
44
|
this.ctx = ctx;
|
|
43
45
|
this.todoProvider = createTodoProvider(ctx);
|
|
@@ -53,8 +55,9 @@ export class TodoContinuationController {
|
|
|
53
55
|
* Check if continuation is allowed (not paused, session idle)
|
|
54
56
|
*/
|
|
55
57
|
canContinue() {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
// Only blocked by explicit pause, not by temporary user input pause
|
|
59
|
+
if (this.state.explicitPause) {
|
|
60
|
+
debugLog("TodoContinuation", "Explicitly paused, not continuing");
|
|
58
61
|
return false;
|
|
59
62
|
}
|
|
60
63
|
if (this.ctx.isIdle?.() === false) {
|
|
@@ -67,6 +70,41 @@ export class TodoContinuationController {
|
|
|
67
70
|
}
|
|
68
71
|
return true;
|
|
69
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* User explicitly paused - only this clears on explicit resume
|
|
75
|
+
*/
|
|
76
|
+
explicitPause() {
|
|
77
|
+
debugLog("TodoContinuation", "Explicit pause requested");
|
|
78
|
+
this.state.explicitPause = true;
|
|
79
|
+
this.state.userPaused = true;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Resume from explicit pause
|
|
83
|
+
*/
|
|
84
|
+
resume() {
|
|
85
|
+
if (this.state.explicitPause) {
|
|
86
|
+
debugLog("TodoContinuation", "Resuming from explicit pause");
|
|
87
|
+
this.state.explicitPause = false;
|
|
88
|
+
this.state.userPaused = false;
|
|
89
|
+
this.clearQueue();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Temporary pause for user input processing
|
|
94
|
+
* Does not require explicit resume
|
|
95
|
+
*/
|
|
96
|
+
tempPause() {
|
|
97
|
+
debugLog("TodoContinuation", "Temporary pause for user input");
|
|
98
|
+
this.state.userPaused = true;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Clear continuation queue (called when work completes or starts)
|
|
102
|
+
*/
|
|
103
|
+
clearQueue() {
|
|
104
|
+
this.state.continuationQueued = false;
|
|
105
|
+
this._inFlight = false;
|
|
106
|
+
debugLog("TodoContinuation", "Continuation queue cleared");
|
|
107
|
+
}
|
|
70
108
|
/**
|
|
71
109
|
* Public method to evaluate and execute continuation
|
|
72
110
|
* Called by external handlers (e.g., agent_settled)
|
|
@@ -175,11 +213,17 @@ export class TodoContinuationController {
|
|
|
175
213
|
}
|
|
176
214
|
/**
|
|
177
215
|
* Guarded dispatch - checks all conditions before sending
|
|
216
|
+
* Uses in-flight guard to prevent race conditions
|
|
178
217
|
*/
|
|
179
218
|
async guardedDispatch(itemId, message) {
|
|
180
|
-
//
|
|
181
|
-
if (this.
|
|
182
|
-
debugLog("TodoContinuation", "Guarded dispatch:
|
|
219
|
+
// 0. Acquire in-flight guard to prevent concurrent dispatches
|
|
220
|
+
if (this._inFlight) {
|
|
221
|
+
debugLog("TodoContinuation", "Guarded dispatch: already in-flight, skipping");
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
// 1. Check if paused by explicit user pause
|
|
225
|
+
if (this.state.explicitPause) {
|
|
226
|
+
debugLog("TodoContinuation", "Guarded dispatch: explicitly paused, skipping");
|
|
183
227
|
return false;
|
|
184
228
|
}
|
|
185
229
|
// 2. Check if session is still idle
|
|
@@ -192,18 +236,21 @@ export class TodoContinuationController {
|
|
|
192
236
|
debugLog("TodoContinuation", "Guarded dispatch: already queued, skipping");
|
|
193
237
|
return false;
|
|
194
238
|
}
|
|
195
|
-
// 4. Verify item still needs work (not completed)
|
|
239
|
+
// 4. Verify item still needs work (not completed) - acquire guard BEFORE await
|
|
240
|
+
this._inFlight = true;
|
|
196
241
|
try {
|
|
197
242
|
const snapshot = await this.todoProvider.getSnapshot();
|
|
198
243
|
const item = snapshot.items.find((i) => i.id === itemId);
|
|
199
244
|
if (item?.status === "completed") {
|
|
200
245
|
debugLog("TodoContinuation", "Guarded dispatch: item completed, skipping");
|
|
246
|
+
this._inFlight = false;
|
|
201
247
|
return false;
|
|
202
248
|
}
|
|
203
249
|
}
|
|
204
250
|
catch {
|
|
205
251
|
// If we can't read todos, skip dispatch
|
|
206
252
|
debugLog("TodoContinuation", "Guarded dispatch: failed to read todos, skipping");
|
|
253
|
+
this._inFlight = false;
|
|
207
254
|
return false;
|
|
208
255
|
}
|
|
209
256
|
// All checks passed - dispatch
|
|
@@ -211,11 +258,13 @@ export class TodoContinuationController {
|
|
|
211
258
|
this.state.lastSteerMessage = message;
|
|
212
259
|
try {
|
|
213
260
|
await this.config.dispatch(message);
|
|
261
|
+
// Queue stays set while agent processes - cleared on agent_settled
|
|
214
262
|
return true;
|
|
215
263
|
}
|
|
216
264
|
catch (err) {
|
|
217
265
|
debugLog("TodoContinuation", "Guarded dispatch failed:", String(err));
|
|
218
266
|
this.state.continuationQueued = false;
|
|
267
|
+
this._inFlight = false;
|
|
219
268
|
return false;
|
|
220
269
|
}
|
|
221
270
|
}
|
|
@@ -270,11 +319,13 @@ export class TodoContinuationController {
|
|
|
270
319
|
lastMessageId: null,
|
|
271
320
|
continuationQueued: false,
|
|
272
321
|
userPaused: false,
|
|
322
|
+
explicitPause: false,
|
|
273
323
|
lastSteerMessage: null,
|
|
274
324
|
steerAttemptsForCurrentItem: 0,
|
|
275
325
|
lastItemContinued: null,
|
|
276
326
|
lastEvaluationResult: null,
|
|
277
327
|
};
|
|
328
|
+
this._inFlight = false;
|
|
278
329
|
}
|
|
279
330
|
/**
|
|
280
331
|
* Cleanup on shutdown
|