@openclaw/copilot 2026.7.2-beta.2 → 2026.7.2-beta.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as resolveCopilotAuth, i as createCopilotByokAuth, n as resolveCopilotProvider, r as createCopilotByokProxy } from "./harness-
|
|
2
|
-
import { applyEmbeddedAttemptToolsAllow, awaitAgentEndSideEffects,
|
|
1
|
+
import { a as resolveCopilotAuth, i as createCopilotByokAuth, n as resolveCopilotProvider, r as createCopilotByokProxy } from "./harness-C1V8xh6L.js";
|
|
2
|
+
import { applyEmbeddedAttemptToolsAllow, awaitAgentEndSideEffects, buildAgentHookContextChannelFields, buildEmbeddedAttemptToolRunContext, callGatewayTool, cancelPendingAgentQuestionForSession, claimPendingAgentQuestionAnswer, clearActiveEmbeddedRun, detectAndLoadAgentHarnessPromptImages, embeddedAgentLog, extractToolErrorMessage, getModelProviderRequestTransport, getPluginToolMeta, isHostScopedAgentToolActive, isSubagentSessionKey, isToolResultError, resolveAgentHarnessBeforePromptBuildResult, resolveAttemptFsWorkspaceOnly, resolveAttemptSpawnWorkspaceDir, resolveBootstrapContextForRun, resolveCompactionTimeoutMs, resolveEmbeddedAttemptToolConstructionPlan, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, resolveUserPath, runAgentEndSideEffects, runAgentHarnessAfterCompactionHook, runAgentHarnessAfterToolCallHook, runAgentHarnessBeforeCompactionHook, runAgentHarnessBeforeMessageWriteHook, runAgentHarnessGatewayQuestion, runAgentHarnessLlmInputHook, runAgentHarnessLlmOutputHook, sanitizeToolResult, setActiveEmbeddedRun } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fsp from "node:fs/promises";
|
|
@@ -1145,6 +1145,7 @@ function buildOpenClawCodingToolsOptions(input, toolPlan, toolSurfaceRuntime) {
|
|
|
1145
1145
|
modelCompat,
|
|
1146
1146
|
modelApi: model?.api,
|
|
1147
1147
|
modelContextWindowTokens: model?.contextWindow,
|
|
1148
|
+
delegationCapability: a.delegationCapability,
|
|
1148
1149
|
modelAuthMode: resolveModelAuthMode(input.modelProvider, a.config, void 0, { workspaceDir }),
|
|
1149
1150
|
currentChannelId: a.currentChannelId,
|
|
1150
1151
|
currentMessagingTarget: a.currentMessagingTarget,
|
|
@@ -1444,68 +1445,62 @@ function toError$1(error) {
|
|
|
1444
1445
|
//#endregion
|
|
1445
1446
|
//#region extensions/copilot/src/user-input-bridge.ts
|
|
1446
1447
|
const COPILOT_USER_INPUT_QUESTION_ID = "answer";
|
|
1448
|
+
const DEFAULT_USER_INPUT_TIMEOUT_MS = 15 * 6e4;
|
|
1447
1449
|
function createCopilotUserInputBridge(params) {
|
|
1448
1450
|
let pending;
|
|
1449
|
-
const
|
|
1450
|
-
const current = pending;
|
|
1451
|
-
if (!current) return;
|
|
1452
|
-
pending = void 0;
|
|
1453
|
-
current.cleanup();
|
|
1454
|
-
current.resolve(value);
|
|
1455
|
-
};
|
|
1451
|
+
const gatewayCall = params.gatewayCall ?? callGatewayTool;
|
|
1456
1452
|
return {
|
|
1457
|
-
onUserInputRequest(request) {
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1453
|
+
async onUserInputRequest(request) {
|
|
1454
|
+
pending?.abort(/* @__PURE__ */ new Error("Copilot user input request replaced"));
|
|
1455
|
+
const abort = new AbortController();
|
|
1456
|
+
pending = abort;
|
|
1457
|
+
const abortFromRun = () => abort.abort(params.signal?.reason);
|
|
1458
|
+
params.signal?.addEventListener("abort", abortFromRun, { once: true });
|
|
1459
|
+
if (params.signal?.aborted) abortFromRun();
|
|
1460
|
+
try {
|
|
1461
|
+
const question = toQuestion(request);
|
|
1462
|
+
const result = await runAgentHarnessGatewayQuestion({
|
|
1463
|
+
questions: [question],
|
|
1464
|
+
sessionKey: params.paramsForRun.sessionKey ?? params.paramsForRun.sessionId,
|
|
1465
|
+
agentId: params.paramsForRun.agentId,
|
|
1466
|
+
timeoutMs: params.paramsForRun.timeoutMs ?? DEFAULT_USER_INPUT_TIMEOUT_MS,
|
|
1467
|
+
gatewayCall,
|
|
1468
|
+
delivery: params.paramsForRun,
|
|
1469
|
+
promptOptions: {
|
|
1470
|
+
intro: "Copilot needs input:",
|
|
1471
|
+
formatText: formatCopilotDisplayText
|
|
1472
|
+
},
|
|
1473
|
+
signal: abort.signal
|
|
1478
1474
|
});
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1475
|
+
if (result.status !== "answered") return emptyCopilotUserInputResponse();
|
|
1476
|
+
const selected = result.answers.answers[COPILOT_USER_INPUT_QUESTION_ID]?.answers[0] ?? "";
|
|
1477
|
+
return {
|
|
1478
|
+
answer: selected,
|
|
1479
|
+
wasFreeform: !isChoiceAnswer(question, selected)
|
|
1480
|
+
};
|
|
1481
|
+
} catch (error) {
|
|
1482
|
+
embeddedAgentLog.warn("failed to bridge copilot user input through gateway", { error });
|
|
1483
|
+
return emptyCopilotUserInputResponse();
|
|
1484
|
+
} finally {
|
|
1485
|
+
params.signal?.removeEventListener("abort", abortFromRun);
|
|
1486
|
+
if (pending === abort) pending = void 0;
|
|
1487
|
+
}
|
|
1486
1488
|
},
|
|
1487
1489
|
cancelPending() {
|
|
1488
|
-
|
|
1490
|
+
pending?.abort(/* @__PURE__ */ new Error("Copilot user input request cancelled"));
|
|
1489
1491
|
}
|
|
1490
1492
|
};
|
|
1491
1493
|
}
|
|
1492
1494
|
function toQuestion(request) {
|
|
1493
1495
|
return {
|
|
1494
1496
|
id: COPILOT_USER_INPUT_QUESTION_ID,
|
|
1495
|
-
header: "Copilot
|
|
1497
|
+
header: "Copilot",
|
|
1496
1498
|
question: request.question,
|
|
1497
1499
|
isOther: request.allowFreeform !== false,
|
|
1498
1500
|
isSecret: false,
|
|
1499
1501
|
options: request.choices && request.choices.length > 0 ? request.choices.map((choice) => ({ label: choice })) : null
|
|
1500
1502
|
};
|
|
1501
1503
|
}
|
|
1502
|
-
function buildCopilotUserInputResponse(question, inputText) {
|
|
1503
|
-
const selected = buildAgentHarnessUserInputAnswers([question], inputText).answers[COPILOT_USER_INPUT_QUESTION_ID]?.answers[0] ?? "";
|
|
1504
|
-
return {
|
|
1505
|
-
answer: selected,
|
|
1506
|
-
wasFreeform: !isChoiceAnswer(question, selected)
|
|
1507
|
-
};
|
|
1508
|
-
}
|
|
1509
1504
|
function emptyCopilotUserInputResponse() {
|
|
1510
1505
|
return {
|
|
1511
1506
|
answer: "",
|
|
@@ -2117,20 +2112,33 @@ async function runCopilotAttempt(params, deps) {
|
|
|
2117
2112
|
getSdkSessionId: () => sdkSessionId,
|
|
2118
2113
|
isAborted: () => aborted
|
|
2119
2114
|
});
|
|
2115
|
+
const cancelGatewayQuestionBestEffort = (resolvedBy) => {
|
|
2116
|
+
cancelPendingAgentQuestionForSession({
|
|
2117
|
+
sessionKey: input.sessionKey ?? input.sessionId,
|
|
2118
|
+
resolvedBy
|
|
2119
|
+
}).catch((error) => {
|
|
2120
|
+
embeddedAgentLog.warn("failed to cancel copilot gateway question during shutdown", { error });
|
|
2121
|
+
});
|
|
2122
|
+
};
|
|
2120
2123
|
const activeRunHandle = {
|
|
2121
2124
|
kind: "embedded",
|
|
2122
|
-
queueMessage: async (text) => {
|
|
2123
|
-
if (
|
|
2125
|
+
queueMessage: async (text, options) => {
|
|
2126
|
+
if (options?.isInboundUserMessage === true && await claimPendingAgentQuestionAnswer({
|
|
2127
|
+
sessionKey: input.sessionKey ?? input.sessionId,
|
|
2128
|
+
text
|
|
2129
|
+
})) return;
|
|
2124
2130
|
throw new Error("Copilot runtime is not waiting for user input.");
|
|
2125
2131
|
},
|
|
2126
2132
|
isStreaming: () => !settled && !aborted,
|
|
2127
2133
|
isCompacting: () => bridge?.isCompacting() ?? false,
|
|
2128
2134
|
sourceReplyDeliveryMode: input.sourceReplyDeliveryMode,
|
|
2129
2135
|
cancel: () => {
|
|
2136
|
+
cancelGatewayQuestionBestEffort("run-cancel");
|
|
2130
2137
|
userInputBridge.cancelPending();
|
|
2131
2138
|
abortActiveSession();
|
|
2132
2139
|
},
|
|
2133
2140
|
abort: () => {
|
|
2141
|
+
cancelGatewayQuestionBestEffort("run-abort");
|
|
2134
2142
|
userInputBridge.cancelPending();
|
|
2135
2143
|
abortActiveSession();
|
|
2136
2144
|
}
|
|
@@ -857,6 +857,7 @@ function createCopilotAgentHarness(options) {
|
|
|
857
857
|
return {
|
|
858
858
|
id: options?.id ?? "copilot",
|
|
859
859
|
label: options?.label ?? "GitHub Copilot agent runtime",
|
|
860
|
+
autoSelection: { providerIds: [] },
|
|
860
861
|
supports(ctx) {
|
|
861
862
|
if (String(ctx.requestedRuntime ?? "").trim().toLowerCase() !== "copilot") return {
|
|
862
863
|
supported: false,
|
|
@@ -894,7 +895,7 @@ function createCopilotAgentHarness(options) {
|
|
|
894
895
|
async runAttempt(params) {
|
|
895
896
|
const attemptPromise = (async () => {
|
|
896
897
|
if (disposed) throw new Error("[copilot] harness has been disposed; cannot start new attempts");
|
|
897
|
-
const { resolvePoolAcquire, runCopilotAttempt } = await import("./attempt-
|
|
898
|
+
const { resolvePoolAcquire, runCopilotAttempt } = await import("./attempt-5xlXVISm.js");
|
|
898
899
|
if (disposed) throw new Error("[copilot] harness was disposed while starting an attempt");
|
|
899
900
|
const pool = await getPool();
|
|
900
901
|
if (disposed) throw new Error("[copilot] harness was disposed while starting an attempt");
|
|
@@ -1010,7 +1011,7 @@ function createCopilotAgentHarness(options) {
|
|
|
1010
1011
|
};
|
|
1011
1012
|
const tracked = trackedSessions.get(openclawSessionId);
|
|
1012
1013
|
const currentCompactKey = computeSessionCompactKey(params);
|
|
1013
|
-
const { resolvePoolAcquire } = await import("./attempt-
|
|
1014
|
+
const { resolvePoolAcquire } = await import("./attempt-5xlXVISm.js");
|
|
1014
1015
|
let resolvedPoolAcquire;
|
|
1015
1016
|
let currentAuth;
|
|
1016
1017
|
try {
|
package/dist/harness.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createCopilotAgentHarness } from "./harness-
|
|
1
|
+
import { t as createCopilotAgentHarness } from "./harness-C1V8xh6L.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-C1V8xh6L.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
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/copilot",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/copilot",
|
|
9
|
-
"version": "2026.7.2-beta.
|
|
9
|
+
"version": "2026.7.2-beta.3",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@github/copilot-sdk": "1.0.5"
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/copilot",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.3",
|
|
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.7.2-beta.
|
|
27
|
+
"pluginApi": ">=2026.7.2-beta.3"
|
|
28
28
|
},
|
|
29
29
|
"build": {
|
|
30
|
-
"openclawVersion": "2026.7.2-beta.
|
|
30
|
+
"openclawVersion": "2026.7.2-beta.3",
|
|
31
31
|
"bundledDist": false
|
|
32
32
|
},
|
|
33
33
|
"release": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"README.md"
|
|
47
47
|
],
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"openclaw": ">=2026.7.2-beta.
|
|
49
|
+
"openclaw": ">=2026.7.2-beta.3"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"openclaw": {
|