fix(pi): serialize write-leased tool batches

This commit is contained in:
inman
2026-09-02 12:07:13 +08:00
parent 6073bd6f4c
commit 49112b688d
7 changed files with 304 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
import path from 'node:path';
import { atomicWriteText } from '../../../coding-projects/atomic-json';
export const MAKELORE_PI_EXTENSION_VERSION = 4;
export const MAKELORE_PI_EXTENSION_VERSION = 5;
export const MAKELORE_PI_EXTENSION_FILENAME = `makelore-runtime-v${MAKELORE_PI_EXTENSION_VERSION}.mjs`;
const BUNDLE_SOURCE = String.raw`
@@ -172,12 +172,13 @@ export function createMakeloreRuntime(runtimeDefaults = {}) {
return response.result;
}
function registerProductTool(name, label, description, parameters) {
function registerProductTool(name, label, description, parameters, projectWriteLease = false) {
pi.registerTool({
name,
label,
description,
parameters,
...(projectWriteLease ? { executionMode: 'sequential' } : {}),
async execute(toolCallId, params, signal) {
return await invokeProduct(toolCallId, name, params, signal);
},
@@ -219,6 +220,7 @@ export function createMakeloreRuntime(runtimeDefaults = {}) {
declaration.label,
declaration.description,
declaration.inputSchema,
dynamicLeaseTools.has(declaration.name),
);
}
}

View File

@@ -1416,7 +1416,7 @@ export async function runFinalAsarExtensionProof(): Promise<PiReleaseExtensionPr
providerRequests: requestCounts,
subagentStatus: 'complete',
subagentSummary: 'REAL_CHILD_COMPLETE',
materializedExtension: 'makelore-runtime-v4.mjs',
materializedExtension: 'makelore-runtime-v5.mjs',
providerFirstEventDelayMs: PROOF_PROVIDER_FIRST_EVENT_DELAY_MS,
managedTurns,
managedWorkerMilestones: composition.telemetry,