@openclaw/copilot 2026.9.2 → 2026.9.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,4 +1,4 @@
1
- import { a as resolveCopilotAuth, i as createCopilotByokAuth, n as resolveCopilotProvider, r as createCopilotByokProxy } from "./harness-CIPB8kLr.js";
1
+ import { a as resolveCopilotAuth, i as createCopilotByokAuth, n as resolveCopilotProvider, r as createCopilotByokProxy } from "./harness-qA-Kb-ZC.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
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";
@@ -1380,7 +1380,7 @@ function registerCopilotActiveRun(params) {
1380
1380
  params.abortActiveSession();
1381
1381
  }
1382
1382
  };
1383
- setActiveEmbeddedRun(params.input.sessionId, activeRunHandle, params.input.sessionKey, params.input.sessionFile);
1383
+ setActiveEmbeddedRun(params.input.sessionId, activeRunHandle, params.input.sessionKey, params.input.sessionFile, params.agentId);
1384
1384
  params.input.replyOperation?.attachBackend(activeRunHandle);
1385
1385
  return activeRunHandle;
1386
1386
  }
@@ -1609,21 +1609,24 @@ async function createCopilotToolBridge(input) {
1609
1609
  return {
1610
1610
  cleanup: toolSurfaceRuntime.cleanup,
1611
1611
  codeModeEngaged: toolSurfaceRuntime.codeModeControlsEnabled,
1612
- promptToolPolicy: { apply: (params = {}) => {
1613
- const result = compactedTools.promptToolPolicy.apply({
1614
- ...params,
1615
- toolsAllow: buildEmbeddedAttemptToolRunContext({
1616
- ...attemptParams,
1617
- toolsAllow: params.toolsAllow,
1618
- forceMessageTool: shouldForceCopilotMessageTool(attemptParams)
1619
- }).runtimeToolAllowlist
1620
- });
1621
- const directToolNames = new Set(result.tools.map((tool) => tool.name));
1622
- return {
1623
- tools: sdkTools.filter((tool) => directToolNames.has(tool.name)),
1624
- callableToolNames: result.callableToolNames
1625
- };
1626
- } },
1612
+ promptToolPolicy: {
1613
+ requireExplicitMessageTarget: toolOptions.requireExplicitMessageTarget,
1614
+ apply: (params = {}) => {
1615
+ const result = compactedTools.promptToolPolicy.apply({
1616
+ ...params,
1617
+ toolsAllow: buildEmbeddedAttemptToolRunContext({
1618
+ ...attemptParams,
1619
+ toolsAllow: params.toolsAllow,
1620
+ forceMessageTool: shouldForceCopilotMessageTool(attemptParams)
1621
+ }).runtimeToolAllowlist
1622
+ });
1623
+ const directToolNames = new Set(result.tools.map((tool) => tool.name));
1624
+ return {
1625
+ tools: sdkTools.filter((tool) => directToolNames.has(tool.name)),
1626
+ callableToolNames: result.callableToolNames
1627
+ };
1628
+ }
1629
+ },
1627
1630
  sourceTools: exposedTools
1628
1631
  };
1629
1632
  }
@@ -1641,10 +1644,6 @@ function buildOpenClawCodingToolsOptions(input, toolPlan, toolSurfaceRuntime) {
1641
1644
  const cwd = input.cwd ?? a.cwd;
1642
1645
  const agentDir = input.agentDir ?? a.agentDir;
1643
1646
  const sandbox = input.sandbox ?? void 0;
1644
- const spawnWorkspaceDir = input.spawnWorkspaceDir ?? (workspaceDir ? resolveAttemptSpawnWorkspaceDir({
1645
- sandbox,
1646
- resolvedWorkspace: workspaceDir
1647
- }) : void 0);
1648
1647
  const model = a.model;
1649
1648
  const modelHasVision = Array.isArray(model?.input) && model.input.includes("image");
1650
1649
  const modelCompat = model && typeof model === "object" && "compat" in model && model.compat && typeof model.compat === "object" ? model.compat : void 0;
@@ -1662,24 +1661,6 @@ function buildOpenClawCodingToolsOptions(input, toolPlan, toolSurfaceRuntime) {
1662
1661
  send: a.onToolResult,
1663
1662
  ...a.messageChannel ? { messageChannel: a.messageChannel } : {}
1664
1663
  } } : {},
1665
- toolBindings: a.toolBindings,
1666
- chatType: a.chatType,
1667
- agentAccountId: a.agentAccountId,
1668
- messageTo: a.messageTo,
1669
- messageThreadId: a.messageThreadId,
1670
- nativeChannelId: a.chatId,
1671
- messageActionTurnCapability: a.messageActionTurnCapability,
1672
- groupId: a.groupId,
1673
- groupChannel: a.groupChannel,
1674
- groupSpace: a.groupSpace,
1675
- memberRoleIds: a.memberRoleIds,
1676
- spawnedBy: a.spawnedBy,
1677
- senderId: a.senderId,
1678
- senderName: a.senderName,
1679
- senderUsername: a.senderUsername,
1680
- senderE164: a.senderE164,
1681
- senderIsOwner: a.senderIsOwner,
1682
- scheduledToolPolicy: a.scheduledToolPolicy,
1683
1664
  allowGatewaySubagentBinding: a.allowGatewaySubagentBinding,
1684
1665
  sessionKey: sandboxSessionKey,
1685
1666
  runSessionKey,
@@ -1690,7 +1671,7 @@ function buildOpenClawCodingToolsOptions(input, toolPlan, toolSurfaceRuntime) {
1690
1671
  workspaceDir,
1691
1672
  cwd,
1692
1673
  sandbox,
1693
- spawnWorkspaceDir,
1674
+ spawnWorkspaceDir: input.spawnWorkspaceDir,
1694
1675
  config: toolSurfaceRuntime?.config ?? a.config,
1695
1676
  abortSignal: input.abortSignal,
1696
1677
  modelProvider: input.modelProvider,
@@ -1706,15 +1687,8 @@ function buildOpenClawCodingToolsOptions(input, toolPlan, toolSurfaceRuntime) {
1706
1687
  modelContextWindowTokens: a.contextTokenBudget ?? model?.contextWindow,
1707
1688
  delegationCapability: a.delegationCapability,
1708
1689
  modelAuthMode: resolveModelAuthMode(input.modelProvider, a.config, void 0, { workspaceDir }),
1709
- currentChannelId: a.currentChannelId,
1710
- currentMessagingTarget: a.currentMessagingTarget,
1711
- currentThreadTs: a.currentThreadTs,
1712
- currentMessageId: a.currentMessageId,
1713
- replyToMode: a.replyToMode,
1714
- hasRepliedRef: a.hasRepliedRef,
1715
1690
  modelHasVision,
1716
1691
  requireExplicitMessageTarget: a.requireExplicitMessageTarget ?? isSubagentSessionKey(liveSessionKey),
1717
- sourceReplyDeliveryMode: a.sourceReplyDeliveryMode,
1718
1692
  disableMessageTool: a.disableMessageTool,
1719
1693
  forceMessageTool: a.forceMessageTool,
1720
1694
  enableHeartbeatTool: a.enableHeartbeatTool,
@@ -1763,6 +1737,7 @@ function convertOpenClawToolToSdkTool(sourceTool, input, scheduleToolExecution)
1763
1737
  input.attemptParams.observeToolTerminal?.({
1764
1738
  toolCallId: invocation.toolCallId,
1765
1739
  toolName: sourceTool.name,
1740
+ result: error,
1766
1741
  arguments: executedArgs,
1767
1742
  executionStarted,
1768
1743
  outcome: "failure",
@@ -1827,6 +1802,7 @@ function convertOpenClawToolToSdkTool(sourceTool, input, scheduleToolExecution)
1827
1802
  input.attemptParams.observeToolTerminal?.({
1828
1803
  toolCallId: invocation.toolCallId,
1829
1804
  toolName: sourceTool.name,
1805
+ result,
1830
1806
  arguments: preparedArgs,
1831
1807
  executionStarted: true,
1832
1808
  outcome: resultIsError ? "failure" : "success",
@@ -1873,6 +1849,7 @@ async function executeCatalogTool(input, params) {
1873
1849
  input.attemptParams?.observeToolTerminal?.({
1874
1850
  toolCallId: params.toolCallId,
1875
1851
  toolName: params.toolName,
1852
+ result,
1876
1853
  arguments: preparedArgs,
1877
1854
  executionStarted,
1878
1855
  outcome: isError ? "failure" : "success",
@@ -1898,6 +1875,7 @@ async function executeCatalogTool(input, params) {
1898
1875
  if (!terminalObserved) input.attemptParams?.observeToolTerminal?.({
1899
1876
  toolCallId: params.toolCallId,
1900
1877
  toolName: params.toolName,
1878
+ result: error,
1901
1879
  arguments: preparedArgs,
1902
1880
  executionStarted,
1903
1881
  outcome: "failure",
@@ -2094,7 +2072,8 @@ function buildCopilotPromptGuidance(params) {
2094
2072
  delegationGuidance,
2095
2073
  buildHarnessVisibleReplyGuidance({
2096
2074
  sourceReplyDeliveryMode: params.attempt.sourceReplyDeliveryMode,
2097
- messageToolAvailable: callableTools.has("message")
2075
+ messageToolAvailable: callableTools.has("message"),
2076
+ requireExplicitMessageTarget: params.requireExplicitMessageTarget
2098
2077
  }),
2099
2078
  buildCredentialSafetyPrompt(params.attempt.disableTools !== true && callableTools.has("secrets") ? "secrets" : void 0),
2100
2079
  params.workspaceBootstrapInstructions?.trim(),
@@ -2372,6 +2351,7 @@ async function createCopilotSessionSetup(params) {
2372
2351
  return buildCopilotPromptGuidance({
2373
2352
  attempt: input,
2374
2353
  callableToolNames: promptPolicyResult.callableToolNames,
2354
+ requireExplicitMessageTarget: promptToolPolicy.requireExplicitMessageTarget,
2375
2355
  workspaceBootstrapInstructions: workspaceBootstrap.instructions
2376
2356
  });
2377
2357
  } },
@@ -2566,7 +2546,7 @@ function createAttemptTranscriptJournal(params) {
2566
2546
  };
2567
2547
  const prepare = (write, options = {}) => {
2568
2548
  const message = structuredClone(write.message);
2569
- const originalReplayPayload = structuredClone(projectReplayPayload(message));
2549
+ const originalReplayPayload = projectReplayPayload(message);
2570
2550
  const hooked = runAgentHarnessBeforeMessageWriteHook({
2571
2551
  message: structuredClone(message),
2572
2552
  agentId: target.agentId,
@@ -3339,6 +3319,7 @@ async function runCopilotExecution(context) {
3339
3319
  if (!userInputBridge) throw new Error("[copilot-attempt] ordinary attempts require a user-input bridge");
3340
3320
  activeRunHandleRef = registerCopilotActiveRun({
3341
3321
  abortActiveSession,
3322
+ agentId: sessionAgentId,
3342
3323
  bridge,
3343
3324
  canAcceptSteering: () => initialSdkUserValidated,
3344
3325
  startedAtMs: input.startedAtMs,
@@ -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-BJ2mxTkh.js");
891
+ const { resolvePoolAcquire, runCopilotAttempt } = await import("./attempt-e3wCSh8h.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-OGrJ9ITR.js");
1022
+ const { runCopilotIsolatedCompletion } = await import("./isolated-completion-D01XCEU3.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-BJ2mxTkh.js");
1114
+ const { resolvePoolAcquire } = await import("./attempt-e3wCSh8h.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-CIPB8kLr.js";
1
+ import { t as createCopilotAgentHarness } from "./harness-qA-Kb-ZC.js";
2
2
  export { createCopilotAgentHarness };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createCopilotAgentHarness } from "./harness-CIPB8kLr.js";
1
+ import { t as createCopilotAgentHarness } from "./harness-qA-Kb-ZC.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-CIPB8kLr.js";
1
+ import { n as resolveCopilotProvider, o as tokenFingerprint, r as createCopilotByokProxy } from "./harness-qA-Kb-ZC.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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/copilot",
3
- "version": "2026.9.2",
3
+ "version": "2026.9.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.9.2"
27
+ "pluginApi": ">=2026.9.3"
28
28
  },
29
29
  "build": {
30
- "openclawVersion": "2026.9.2",
30
+ "openclawVersion": "2026.9.3",
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.2"
48
+ "openclaw": ">=2026.9.3"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "openclaw": {