@openclaw/opencode-provider 2026.8.1-beta.3 → 2026.8.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.
@@ -1,4 +1,4 @@
1
- import { buildStaticOpencodeZenProviderConfig } from "./provider-catalog.js";
1
+ import { n as buildStaticOpencodeZenProviderConfig } from "./provider-catalog-Dq-y_lMN.js";
2
2
  //#region extensions/opencode/provider-discovery.ts
3
3
  const opencodeProviderDiscovery = {
4
4
  id: "opencode",
@@ -1,4 +1,4 @@
1
- import { resolveClaudeThinkingProfile } from "openclaw/plugin-sdk/provider-model-shared";
1
+ import { resolveClaudeThinkingProfile } from "openclaw/plugin-sdk/claude-model-runtime";
2
2
  //#region extensions/opencode/provider-policy-api.ts
3
3
  const FIXED_REASONING_PROFILE = {
4
4
  levels: [{
@@ -6,7 +6,7 @@ import { accessSync, constants, statSync } from "node:fs";
6
6
  import path from "node:path";
7
7
  import process from "node:process";
8
8
  import { resolveAcpSessionAvailability } from "openclaw/plugin-sdk/acp-runtime";
9
- import { resolveSessionAgentIds } from "openclaw/plugin-sdk/agent-runtime";
9
+ import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
10
10
  import { resolveNodeHostExecutable } from "openclaw/plugin-sdk/node-host";
11
11
  import { createSessionCatalogFamily, createSessionCatalogNodeHostBindings, importSessionCatalogHistory, listAdoptedSessionCatalogSessions, sessionCatalogAdoptedSessionKey } from "openclaw/plugin-sdk/session-catalog";
12
12
  //#region extensions/opencode/session-catalog-plugin.ts
@@ -91,7 +91,7 @@ async function createAdoptedOpenCodeSession(params) {
91
91
  key: sessionCatalogAdoptedSessionKey(OPENCODE_ADOPTED_SESSION_KEY_PREFIX, params.threadId),
92
92
  agentId: params.agentId,
93
93
  recoverMatchingInitialEntry: true,
94
- ...params.session.name ? { label: params.session.name } : {},
94
+ ...params.session.name ? { displayName: params.session.name } : {},
95
95
  ...params.session.cwd ? { spawnedCwd: params.session.cwd } : {},
96
96
  initialEntry: {
97
97
  acpBackendId: ACPX_BACKEND_ID,
@@ -206,7 +206,7 @@ function registerOpenCodeSessionCatalog(api) {
206
206
  sessionUnavailable: "OpenCode session is unavailable"
207
207
  },
208
208
  continuation: {
209
- resolveAgentId: (agentId) => resolveSessionAgentIds({
209
+ resolveAgentId: (agentId) => resolveSessionAgentIdsStrict({
210
210
  config: api.config,
211
211
  agentId
212
212
  }).sessionAgentId,
@@ -9,7 +9,7 @@ import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "open
9
9
  const LOCAL_HOST_ID = "gateway";
10
10
  const MAX_SEARCH_LENGTH = 500;
11
11
  const MAX_CLI_LIST_SESSIONS = 1e4;
12
- const MAX_CLI_OUTPUT_BYTES = 32 * 1024 * 1024;
12
+ const MAX_CLI_OUTPUT_BYTES = 33554432;
13
13
  const CLI_TIMEOUT_MS = 3e4;
14
14
  const OPENCODE_QUERY_CACHE_TTL_MS = 32e3;
15
15
  const OPENCODE_QUERY_CACHE_MAX_ENTRIES = 32;
@@ -125,8 +125,10 @@ async function queryCachedOpenCodeSessions(query, options) {
125
125
  entry.resolved = true;
126
126
  return value;
127
127
  } catch (error) {
128
- if (openCodeQueryCache.get(key) === entry) if (cached?.resolved) openCodeQueryCache.set(key, cached);
129
- else openCodeQueryCache.delete(key);
128
+ if (openCodeQueryCache.get(key) === entry) {
129
+ if (cached?.resolved) openCodeQueryCache.set(key, cached);
130
+ else openCodeQueryCache.delete(key);
131
+ }
130
132
  throw error;
131
133
  }
132
134
  }
@@ -2,23 +2,11 @@ import { OPENCODE_SESSION_ID_PATTERN } from "./session-catalog-shared.js";
2
2
  import { exportOpenCodeSession, queryOpenCodeDatabase } from "./session-catalog.js";
3
3
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { isExternalUserText, normalizeUserText } from "openclaw/plugin-sdk/session-catalog";
5
+ import { runTasksWithConcurrency } from "openclaw/plugin-sdk/concurrency-runtime";
5
6
  //#region extensions/opencode/session-upstream-activity.ts
6
7
  const OPENCODE_EXPORT_CONCURRENCY = 4;
7
8
  const OPENCODE_REPLAY_LOOKBACK_USER_MESSAGES = 50;
8
9
  const OPENCODE_SHELL_SENTINEL = "The following tool was executed by the user";
9
- async function mapConcurrent(values, limit, mapper) {
10
- const results = [];
11
- results.length = values.length;
12
- let nextIndex = 0;
13
- const workers = Array.from({ length: Math.min(limit, values.length) }, async () => {
14
- while (nextIndex < values.length) {
15
- const index = nextIndex++;
16
- results[index] = await mapper(values[index]);
17
- }
18
- });
19
- await Promise.all(workers);
20
- return results;
21
- }
22
10
  function sqlString(value) {
23
11
  return `'${value.replaceAll("'", "''")}'`;
24
12
  }
@@ -35,12 +23,13 @@ function readMarker(probe) {
35
23
  }
36
24
  async function readIndicators(threadIds) {
37
25
  if (threadIds.length === 0) return /* @__PURE__ */ new Map();
38
- const value = await queryOpenCodeDatabase([
26
+ const query = [
39
27
  "SELECT s.id AS id, es.seq AS seq",
40
28
  "FROM session AS s",
41
29
  "LEFT JOIN event_sequence AS es ON es.aggregate_id = s.id",
42
30
  `WHERE s.id IN (${threadIds.map(sqlString).join(", ")})`
43
- ].join(" "));
31
+ ].join(" ");
32
+ const value = await queryOpenCodeDatabase(query);
44
33
  if (!Array.isArray(value)) throw new Error("OpenCode returned invalid upstream indicators");
45
34
  const indicators = /* @__PURE__ */ new Map();
46
35
  for (const row of value) {
@@ -215,18 +204,23 @@ async function checkOpenCodeUpstreamActivity(probes) {
215
204
  } catch {
216
205
  return [];
217
206
  }
218
- return (await mapConcurrent(eligible, OPENCODE_EXPORT_CONCURRENCY, async (probe) => {
219
- const indicator = indicators.get(probe.threadId);
220
- if (!indicator) return {
221
- kind: "missing",
222
- sessionKey: probe.sessionKey
223
- };
224
- try {
225
- return await classifyChangedProbe(probe, indicator);
226
- } catch {
227
- return;
228
- }
229
- })).filter((outcome) => outcome !== void 0);
207
+ const { results: outcomes } = await runTasksWithConcurrency({
208
+ tasks: eligible.map((probe) => async () => {
209
+ const indicator = indicators.get(probe.threadId);
210
+ if (!indicator) return {
211
+ kind: "missing",
212
+ sessionKey: probe.sessionKey
213
+ };
214
+ try {
215
+ return await classifyChangedProbe(probe, indicator);
216
+ } catch {
217
+ return;
218
+ }
219
+ }),
220
+ limit: OPENCODE_EXPORT_CONCURRENCY,
221
+ throwOnError: true
222
+ });
223
+ return outcomes.filter((outcome) => outcome !== void 0);
230
224
  }
231
225
  //#endregion
232
226
  export { checkOpenCodeUpstreamActivity, linkContinuedOpenCodeSession };