@openclaw/copilot 2026.9.1 → 2026.9.2
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/dist/{attempt-Ls_qYja7.js → attempt-BJ2mxTkh.js} +49 -39
- package/dist/{harness-V2lGlWa5.js → harness-CIPB8kLr.js} +3 -3
- package/dist/harness.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{isolated-completion-DxQ0E51R.js → isolated-completion-OGrJ9ITR.js} +19 -8
- package/openclaw.plugin.json +0 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as resolveCopilotAuth, i as createCopilotByokAuth, n as resolveCopilotProvider, r as createCopilotByokProxy } from "./harness-
|
|
1
|
+
import { a as resolveCopilotAuth, i as createCopilotByokAuth, n as resolveCopilotProvider, r as createCopilotByokProxy } from "./harness-CIPB8kLr.js";
|
|
2
2
|
import { n as normalizeCopilotUsage, r as createCopilotIsolatedSessionRestrictions, t as buildCopilotAssistantUsage } from "./usage-bridge-Cpa-ZYwL.js";
|
|
3
3
|
import { asNonArrayRecord, asOptionalRecord, normalizeOptionalString, normalizeUniqueStringEntries, readNonBlankString, readNonEmptyStringPreservingWhitespace, readNonEmptyStringPreservingWhitespace as readNonEmptyString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
-
import { SKILL_WORKSHOP_TOOL_NAME, applyEmbeddedAttemptToolsAllow, awaitAgentEndSideEffects, buildAgentHookContextChannelFields, buildCredentialSafetyPrompt, buildDelegationGuidanceSection, buildEmbeddedAttemptToolRunContext, buildEmbeddedForegroundPromptContext, buildHarnessVisibleReplyGuidance, buildSkillWorkshopPromptSection,
|
|
4
|
+
import { SKILL_WORKSHOP_TOOL_NAME, applyEmbeddedAttemptToolsAllow, awaitAgentEndSideEffects, buildAgentHookContextChannelFields, buildCredentialSafetyPrompt, buildDelegationGuidanceSection, buildEmbeddedAttemptToolRunContext, buildEmbeddedForegroundPromptContext, buildHarnessVisibleReplyGuidance, buildSkillWorkshopPromptSection, cancelPendingAgentQuestionForSession, claimPendingAgentQuestionAnswer, clearActiveEmbeddedRun, detectAndLoadAgentHarnessPromptImages, embeddedAgentLog, extractToolErrorMessage, getModelProviderRequestTransport, getPluginToolMeta, getPluginToolSideEffectOwnerKey, isHostScopedAgentToolActive, isSubagentSessionKey, isToolResultError, projectAgentHarnessTranscriptMessageForDisplay, resolveAgentDir, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptFsWorkspaceOnly, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveCompactionTimeoutMs, resolveEmbeddedAttemptToolConstructionPlan, resolveMainSessionDelegationMode, resolveModelAuthMode, resolveSandboxContext, resolveUserPath, restorePreparedUserTurnOperationalMetaForRuntime, runAgentEndSideEffects, runAgentHarnessAfterCompactionHook, runAgentHarnessAfterToolCallHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessGatewayQuestion, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, sanitizeToolResult, setActiveEmbeddedRun } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { formatErrorMessage, toErrorObject, toStringifiedError, toStringifiedError as toCopilotError } from "openclaw/plugin-sdk/error-runtime";
|
|
7
7
|
import { parseDateStringTimestampMs } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -1323,15 +1323,20 @@ function registerCopilotActiveRun(params) {
|
|
|
1323
1323
|
acceptanceReported = true;
|
|
1324
1324
|
options?.onQueueAccepted?.(accepted);
|
|
1325
1325
|
};
|
|
1326
|
+
if (await claimPendingUserInputAnswer(text, options)) {
|
|
1327
|
+
reportAcceptance(true);
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1326
1330
|
let messageId;
|
|
1327
1331
|
try {
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
return;
|
|
1331
|
-
}
|
|
1332
|
+
const recorder = options?.userTurnTranscriptRecorder;
|
|
1333
|
+
const sourceMessage = recorder ? await recorder.resolveMessage() : void 0;
|
|
1332
1334
|
if (params.isSettled() || params.isAborted()) throw new Error("Copilot steering is unavailable after the active run ended");
|
|
1333
1335
|
if (!params.canAcceptSteering()) throw new Error("Copilot steering is unavailable before initial user validation");
|
|
1334
|
-
messageId = await params.transcriptJournal.sendSdkUser(() => params.session.send({
|
|
1336
|
+
messageId = await params.transcriptJournal.sendSdkUser(() => params.session.send({
|
|
1337
|
+
prompt: text,
|
|
1338
|
+
...typeof sourceMessage?.content === "string" ? { displayPrompt: sourceMessage.content } : {}
|
|
1339
|
+
}), recorder);
|
|
1335
1340
|
reportAcceptance(true);
|
|
1336
1341
|
} catch (error) {
|
|
1337
1342
|
reportAcceptance(false);
|
|
@@ -1590,13 +1595,17 @@ async function createCopilotToolBridge(input) {
|
|
|
1590
1595
|
const exposedTools = compactedTools.tools.map((tool) => newlyBoundTools.get(tool) ?? tool);
|
|
1591
1596
|
const duplicateNames = findDuplicateToolNames(exposedTools);
|
|
1592
1597
|
if (duplicateNames.length > 0) throw new Error(`[copilot-tool-bridge] duplicate tool names: ${duplicateNames.join(", ")}`);
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1598
|
+
let sequentialBarrier = Promise.resolve();
|
|
1599
|
+
const pendingCalls = /* @__PURE__ */ new Set();
|
|
1600
|
+
const scheduleToolExecution = (executionMode, execute) => {
|
|
1601
|
+
const run = (executionMode === "sequential" ? Promise.all(pendingCalls) : sequentialBarrier).then(execute);
|
|
1602
|
+
const settled = run.then(() => void 0, () => void 0);
|
|
1603
|
+
pendingCalls.add(settled);
|
|
1604
|
+
settled.then(() => pendingCalls.delete(settled));
|
|
1605
|
+
if (executionMode === "sequential") sequentialBarrier = settled;
|
|
1606
|
+
return run;
|
|
1607
|
+
};
|
|
1608
|
+
const sdkTools = exposedTools.map((sourceTool) => convertOpenClawToolToSdkTool(sourceTool, input, scheduleToolExecution));
|
|
1600
1609
|
return {
|
|
1601
1610
|
cleanup: toolSurfaceRuntime.cleanup,
|
|
1602
1611
|
codeModeEngaged: toolSurfaceRuntime.codeModeControlsEnabled,
|
|
@@ -1649,6 +1658,10 @@ function buildOpenClawCodingToolsOptions(input, toolPlan, toolSurfaceRuntime) {
|
|
|
1649
1658
|
},
|
|
1650
1659
|
messageProvider: a.messageProvider ?? a.messageChannel,
|
|
1651
1660
|
messageChannel: a.messageChannel,
|
|
1661
|
+
...a.onToolResult ? { questionPrompt: {
|
|
1662
|
+
send: a.onToolResult,
|
|
1663
|
+
...a.messageChannel ? { messageChannel: a.messageChannel } : {}
|
|
1664
|
+
} } : {},
|
|
1652
1665
|
toolBindings: a.toolBindings,
|
|
1653
1666
|
chatType: a.chatType,
|
|
1654
1667
|
agentAccountId: a.agentAccountId,
|
|
@@ -1720,15 +1733,14 @@ function buildOpenClawCodingToolsOptions(input, toolPlan, toolSurfaceRuntime) {
|
|
|
1720
1733
|
}
|
|
1721
1734
|
};
|
|
1722
1735
|
}
|
|
1723
|
-
function convertOpenClawToolToSdkTool(sourceTool,
|
|
1736
|
+
function convertOpenClawToolToSdkTool(sourceTool, input, scheduleToolExecution) {
|
|
1724
1737
|
if (typeof sourceTool.name !== "string" || sourceTool.name.trim().length === 0) throw new Error("[copilot-tool-bridge] tool name must be a non-empty string");
|
|
1725
1738
|
if (typeof sourceTool.execute !== "function") throw new Error(`[copilot-tool-bridge] tool '${sourceTool.name}' must define an execute function`);
|
|
1726
1739
|
const ownerKey = getPluginToolSideEffectOwnerKey(sourceTool);
|
|
1727
1740
|
const ownerMutation = ownerKey ? { ownerKey } : void 0;
|
|
1728
|
-
let sequentialLock = Promise.resolve();
|
|
1729
1741
|
const notifyToolResult = (result, isError) => {
|
|
1730
1742
|
try {
|
|
1731
|
-
|
|
1743
|
+
input.attemptParams.onAgentToolResult?.({
|
|
1732
1744
|
toolName: sourceTool.name,
|
|
1733
1745
|
result,
|
|
1734
1746
|
isError
|
|
@@ -1739,7 +1751,7 @@ function convertOpenClawToolToSdkTool(sourceTool, ctx) {
|
|
|
1739
1751
|
};
|
|
1740
1752
|
const notifyToolCompleted = (completion) => {
|
|
1741
1753
|
try {
|
|
1742
|
-
Promise.resolve(
|
|
1754
|
+
Promise.resolve(input.onToolCompleted?.(completion)).catch((error) => {
|
|
1743
1755
|
console.warn("[copilot-tool-bridge] onToolCompleted handler threw; continuing", error);
|
|
1744
1756
|
});
|
|
1745
1757
|
} catch (error) {
|
|
@@ -1748,7 +1760,7 @@ function convertOpenClawToolToSdkTool(sourceTool, ctx) {
|
|
|
1748
1760
|
};
|
|
1749
1761
|
const failureResult = (executedArgs, invocation, startedAt, message, error, executionStarted) => {
|
|
1750
1762
|
const errorMessage = toStringifiedError(error).message;
|
|
1751
|
-
|
|
1763
|
+
input.attemptParams.observeToolTerminal?.({
|
|
1752
1764
|
toolCallId: invocation.toolCallId,
|
|
1753
1765
|
toolName: sourceTool.name,
|
|
1754
1766
|
arguments: executedArgs,
|
|
@@ -1778,12 +1790,12 @@ function convertOpenClawToolToSdkTool(sourceTool, ctx) {
|
|
|
1778
1790
|
};
|
|
1779
1791
|
const executeOnce = async (args, invocation) => {
|
|
1780
1792
|
const startedAt = Date.now();
|
|
1781
|
-
if (
|
|
1793
|
+
if (input.abortSignal?.aborted) {
|
|
1782
1794
|
const error = /* @__PURE__ */ new Error("[copilot-tool-bridge] aborted before execution");
|
|
1783
1795
|
return failureResult(args, invocation, startedAt, error.message, error, false);
|
|
1784
1796
|
}
|
|
1785
1797
|
try {
|
|
1786
|
-
await
|
|
1798
|
+
await input.beforeExecute?.({
|
|
1787
1799
|
args,
|
|
1788
1800
|
invocation,
|
|
1789
1801
|
sourceTool,
|
|
@@ -1801,7 +1813,7 @@ function convertOpenClawToolToSdkTool(sourceTool, ctx) {
|
|
|
1801
1813
|
}
|
|
1802
1814
|
let result;
|
|
1803
1815
|
try {
|
|
1804
|
-
result = await sourceTool.execute(invocation.toolCallId, preparedArgs,
|
|
1816
|
+
result = await sourceTool.execute(invocation.toolCallId, preparedArgs, input.abortSignal, void 0);
|
|
1805
1817
|
} catch (error) {
|
|
1806
1818
|
return failureResult(preparedArgs, invocation, startedAt, `[copilot-tool-bridge] tool '${sourceTool.name}' failed: ${toStringifiedError(error).message}`, error, true);
|
|
1807
1819
|
}
|
|
@@ -1812,7 +1824,7 @@ function convertOpenClawToolToSdkTool(sourceTool, ctx) {
|
|
|
1812
1824
|
isError: resultIsError
|
|
1813
1825
|
});
|
|
1814
1826
|
const resultError = resultIsError ? extractToolErrorMessage(sanitizedResult) : void 0;
|
|
1815
|
-
|
|
1827
|
+
input.attemptParams.observeToolTerminal?.({
|
|
1816
1828
|
toolCallId: invocation.toolCallId,
|
|
1817
1829
|
toolName: sourceTool.name,
|
|
1818
1830
|
arguments: preparedArgs,
|
|
@@ -1832,15 +1844,10 @@ function convertOpenClawToolToSdkTool(sourceTool, ctx) {
|
|
|
1832
1844
|
});
|
|
1833
1845
|
return sdkResult;
|
|
1834
1846
|
};
|
|
1835
|
-
const handler = sourceTool.executionMode === "sequential" ? (args, invocation) => {
|
|
1836
|
-
const run = sequentialLock.then(() => executeOnce(args, invocation), () => executeOnce(args, invocation));
|
|
1837
|
-
sequentialLock = run.then(() => void 0, () => void 0);
|
|
1838
|
-
return run;
|
|
1839
|
-
} : executeOnce;
|
|
1840
1847
|
return {
|
|
1841
1848
|
description: sourceTool.description,
|
|
1842
1849
|
defer: sourceTool.catalogMode === "direct-only" ? "never" : void 0,
|
|
1843
|
-
handler,
|
|
1850
|
+
handler: (args, invocation) => scheduleToolExecution(sourceTool.executionMode, () => executeOnce(args, invocation)),
|
|
1844
1851
|
name: sourceTool.name,
|
|
1845
1852
|
overridesBuiltInTool: true,
|
|
1846
1853
|
parameters: sourceTool.parameters,
|
|
@@ -2100,7 +2107,6 @@ const COPILOT_USER_INPUT_QUESTION_ID = "answer";
|
|
|
2100
2107
|
const DEFAULT_USER_INPUT_TIMEOUT_MS = 9e5;
|
|
2101
2108
|
function createCopilotUserInputBridge(params) {
|
|
2102
2109
|
let pending;
|
|
2103
|
-
const gatewayCall = params.gatewayCall ?? callGatewayTool;
|
|
2104
2110
|
return {
|
|
2105
2111
|
async onUserInputRequest(request) {
|
|
2106
2112
|
pending?.abort(/* @__PURE__ */ new Error("Copilot user input request replaced"));
|
|
@@ -2117,7 +2123,7 @@ function createCopilotUserInputBridge(params) {
|
|
|
2117
2123
|
agentId: params.paramsForRun.agentId,
|
|
2118
2124
|
runId: params.paramsForRun.runId,
|
|
2119
2125
|
timeoutMs: params.paramsForRun.timeoutMs ?? DEFAULT_USER_INPUT_TIMEOUT_MS,
|
|
2120
|
-
gatewayCall,
|
|
2126
|
+
gatewayCall: params.gatewayCall,
|
|
2121
2127
|
delivery: params.paramsForRun,
|
|
2122
2128
|
promptOptions: {
|
|
2123
2129
|
intro: "Copilot needs input:",
|
|
@@ -2575,7 +2581,7 @@ function createAttemptTranscriptJournal(params) {
|
|
|
2575
2581
|
toolCallId: message.toolCallId,
|
|
2576
2582
|
toolName: message.toolName
|
|
2577
2583
|
} : {};
|
|
2578
|
-
const
|
|
2584
|
+
const projected = projectDisplay({
|
|
2579
2585
|
...hooked,
|
|
2580
2586
|
...toolIdentity,
|
|
2581
2587
|
...taintMetadata ? { __openclaw: {
|
|
@@ -2586,6 +2592,10 @@ function createAttemptTranscriptJournal(params) {
|
|
|
2586
2592
|
...message.role === "user" && message.provenance ? { provenance: message.provenance } : {},
|
|
2587
2593
|
...message.display === false ? { display: false } : {}
|
|
2588
2594
|
});
|
|
2595
|
+
const prepared = message.role === "user" ? restorePreparedUserTurnOperationalMetaForRuntime({
|
|
2596
|
+
runtimeMessage: projected,
|
|
2597
|
+
preparedMessage: message
|
|
2598
|
+
}) : projected;
|
|
2589
2599
|
return options.singleton && !isCompatibleSingletonRewrite(message, prepared) ? void 0 : prepared;
|
|
2590
2600
|
};
|
|
2591
2601
|
const append = async (write) => {
|
|
@@ -2603,7 +2613,7 @@ function createAttemptTranscriptJournal(params) {
|
|
|
2603
2613
|
}
|
|
2604
2614
|
if (outcome.kind === "rejected") throw new Error("Transcript session changed before singleton append");
|
|
2605
2615
|
if (!isDeepStrictEqual(projectReplayPayload(write.message), projectReplayPayload(outcome.result.message))) replayInvalid = true;
|
|
2606
|
-
if (outcome.result.message.role === "user") write.recorder?.markRuntimePersisted(outcome.result.message, outcome.result.anchor);
|
|
2616
|
+
if (outcome.result.message.role === "user") write.recorder?.markRuntimePersisted(outcome.result.message, outcome.result.anchor, { appended: outcome.result.appended });
|
|
2607
2617
|
return outcome.result;
|
|
2608
2618
|
};
|
|
2609
2619
|
const appendToolGroup = async (group) => {
|
|
@@ -2723,7 +2733,7 @@ function createAttemptTranscriptJournal(params) {
|
|
|
2723
2733
|
accept(outcome);
|
|
2724
2734
|
persistedInitialUser = persisted;
|
|
2725
2735
|
terminalAnchor = outcome.anchor;
|
|
2726
|
-
recorder.markRuntimePersisted(persisted, outcome.anchor);
|
|
2736
|
+
recorder.markRuntimePersisted(persisted, outcome.anchor, { appended: outcome.appended });
|
|
2727
2737
|
params.attempt.onUserMessagePersisted?.(persisted);
|
|
2728
2738
|
await publish(outcome.appended);
|
|
2729
2739
|
})();
|
|
@@ -2749,13 +2759,13 @@ function createAttemptTranscriptJournal(params) {
|
|
|
2749
2759
|
schedule(async () => {
|
|
2750
2760
|
const recorder = sdkUserRecorders.get(input.eventId);
|
|
2751
2761
|
sdkUserRecorders.delete(input.eventId);
|
|
2752
|
-
const
|
|
2762
|
+
const preparedMessage = await recorder?.resolveMessage();
|
|
2753
2763
|
const write = {
|
|
2754
2764
|
eventId: input.eventId,
|
|
2755
|
-
message:
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
}
|
|
2765
|
+
message: restorePreparedUserTurnOperationalMetaForRuntime({
|
|
2766
|
+
runtimeMessage: input.message,
|
|
2767
|
+
preparedMessage
|
|
2768
|
+
}),
|
|
2759
2769
|
recorder
|
|
2760
2770
|
};
|
|
2761
2771
|
if (pendingTools) {
|
|
@@ -888,7 +888,7 @@ function createCopilotAgentHarness(options) {
|
|
|
888
888
|
async function runHarnessAttempt(params, operation) {
|
|
889
889
|
const attemptPromise = (async () => {
|
|
890
890
|
if (disposed) throw new Error("[copilot] harness has been disposed; cannot start new attempts");
|
|
891
|
-
const { resolvePoolAcquire, runCopilotAttempt } = await import("./attempt-
|
|
891
|
+
const { resolvePoolAcquire, runCopilotAttempt } = await import("./attempt-BJ2mxTkh.js");
|
|
892
892
|
if (disposed) throw new Error("[copilot] harness was disposed while starting an attempt");
|
|
893
893
|
const pool = await getPool();
|
|
894
894
|
if (disposed) throw new Error("[copilot] harness was disposed while starting an attempt");
|
|
@@ -1019,7 +1019,7 @@ function createCopilotAgentHarness(options) {
|
|
|
1019
1019
|
async function runIsolatedCompletionV2(params) {
|
|
1020
1020
|
const completionPromise = (async () => {
|
|
1021
1021
|
if (disposed) throw new Error("[copilot] harness has been disposed; cannot start isolated completion");
|
|
1022
|
-
const { runCopilotIsolatedCompletion } = await import("./isolated-completion-
|
|
1022
|
+
const { runCopilotIsolatedCompletion } = await import("./isolated-completion-OGrJ9ITR.js");
|
|
1023
1023
|
if (disposed) throw new Error("[copilot] harness was disposed while starting isolated completion");
|
|
1024
1024
|
return await runCopilotIsolatedCompletion(params, async () => {
|
|
1025
1025
|
const pool = await getPool();
|
|
@@ -1111,7 +1111,7 @@ function createCopilotAgentHarness(options) {
|
|
|
1111
1111
|
};
|
|
1112
1112
|
const tracked = trackedSessions.get(openclawSessionId);
|
|
1113
1113
|
const currentCompactKey = computeCompactRequestKey(params);
|
|
1114
|
-
const { resolvePoolAcquire } = await import("./attempt-
|
|
1114
|
+
const { resolvePoolAcquire } = await import("./attempt-BJ2mxTkh.js");
|
|
1115
1115
|
let resolvedPoolAcquire;
|
|
1116
1116
|
let currentAuth;
|
|
1117
1117
|
try {
|
package/dist/harness.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createCopilotAgentHarness } from "./harness-
|
|
1
|
+
import { t as createCopilotAgentHarness } from "./harness-CIPB8kLr.js";
|
|
2
2
|
export { createCopilotAgentHarness };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createCopilotAgentHarness } from "./harness-
|
|
1
|
+
import { t as createCopilotAgentHarness } from "./harness-CIPB8kLr.js";
|
|
2
2
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
3
3
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
//#region extensions/copilot/index.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveCopilotProvider, o as tokenFingerprint, r as createCopilotByokProxy } from "./harness-
|
|
1
|
+
import { n as resolveCopilotProvider, o as tokenFingerprint, r as createCopilotByokProxy } from "./harness-CIPB8kLr.js";
|
|
2
2
|
import { r as createCopilotIsolatedSessionRestrictions, t as buildCopilotAssistantUsage } from "./usage-bridge-Cpa-ZYwL.js";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
//#region extensions/copilot/src/isolated-completion.ts
|
|
@@ -26,14 +26,12 @@ async function awaitWithinCompletionBoundary(params) {
|
|
|
26
26
|
if (signal?.aborted) throw createAbortError(signal);
|
|
27
27
|
const remainingMs = params.boundary.deadlineMs - Date.now();
|
|
28
28
|
if (remainingMs <= 0) throw createTimeoutError(params.boundary.timeoutMs);
|
|
29
|
-
let boundaryWon = false;
|
|
30
29
|
let boundaryError;
|
|
31
30
|
let timer;
|
|
32
31
|
let onAbort;
|
|
33
32
|
const boundary = new Promise((_resolve, reject) => {
|
|
34
33
|
const rejectBoundary = (error) => {
|
|
35
|
-
if (
|
|
36
|
-
boundaryWon = true;
|
|
34
|
+
if (boundaryError) return;
|
|
37
35
|
boundaryError = error;
|
|
38
36
|
params.onBoundary?.();
|
|
39
37
|
reject(error);
|
|
@@ -45,15 +43,27 @@ async function awaitWithinCompletionBoundary(params) {
|
|
|
45
43
|
if (signal.aborted) onAbort();
|
|
46
44
|
}
|
|
47
45
|
});
|
|
46
|
+
const assertCurrent = () => {
|
|
47
|
+
if (boundaryError) throw boundaryError;
|
|
48
|
+
params.boundary.assertCurrent?.();
|
|
49
|
+
};
|
|
48
50
|
const operation = Promise.resolve().then(() => {
|
|
49
|
-
|
|
51
|
+
assertCurrent();
|
|
50
52
|
return params.start(remainingMs);
|
|
51
|
-
}).then(
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
}).then((value) => {
|
|
54
|
+
try {
|
|
55
|
+
assertCurrent();
|
|
56
|
+
return value;
|
|
57
|
+
} catch (error) {
|
|
58
|
+
startBestEffortCleanup(async () => await params.cleanupLate?.(value));
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
54
61
|
});
|
|
55
62
|
try {
|
|
56
63
|
return await Promise.race([operation, boundary]);
|
|
64
|
+
} catch (error) {
|
|
65
|
+
params.boundary.assertCurrent?.();
|
|
66
|
+
throw error;
|
|
57
67
|
} finally {
|
|
58
68
|
if (timer) clearTimeout(timer);
|
|
59
69
|
if (signal && onAbort) signal.removeEventListener("abort", onAbort);
|
|
@@ -76,6 +86,7 @@ async function runCopilotIsolatedCompletion(params, getPool) {
|
|
|
76
86
|
if (params.thinkLevel !== void 0 && reasoningEffort === void 0) throw new Error(`[copilot] isolated completion does not support thinking level ${params.thinkLevel}`);
|
|
77
87
|
const boundary = {
|
|
78
88
|
abortSignal: params.abortSignal,
|
|
89
|
+
assertCurrent: params.assertCurrent,
|
|
79
90
|
deadlineMs: Date.now() + params.timeoutMs,
|
|
80
91
|
timeoutMs: params.timeoutMs
|
|
81
92
|
};
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/copilot",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.2",
|
|
4
4
|
"description": "OpenClaw GitHub Copilot agent runtime plugin (registers a `github-copilot` AgentHarness backed by @github/copilot-sdk over JSON-RPC to the GitHub Copilot CLI)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"minHostVersion": ">=2026.5.28"
|
|
25
25
|
},
|
|
26
26
|
"compat": {
|
|
27
|
-
"pluginApi": ">=2026.9.
|
|
27
|
+
"pluginApi": ">=2026.9.2"
|
|
28
28
|
},
|
|
29
29
|
"build": {
|
|
30
|
-
"openclawVersion": "2026.9.
|
|
30
|
+
"openclawVersion": "2026.9.2",
|
|
31
31
|
"bundledDist": false
|
|
32
32
|
},
|
|
33
33
|
"release": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"README.md"
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"openclaw": ">=2026.9.
|
|
48
|
+
"openclaw": ">=2026.9.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"openclaw": {
|