oh-my-opencode 3.5.0 → 3.5.1

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/cli/index.js CHANGED
@@ -8867,7 +8867,7 @@ var {
8867
8867
  // package.json
8868
8868
  var package_default = {
8869
8869
  name: "oh-my-opencode",
8870
- version: "3.5.0",
8870
+ version: "3.5.1",
8871
8871
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
8872
8872
  main: "dist/index.js",
8873
8873
  types: "dist/index.d.ts",
@@ -8941,13 +8941,13 @@ var package_default = {
8941
8941
  typescript: "^5.7.3"
8942
8942
  },
8943
8943
  optionalDependencies: {
8944
- "oh-my-opencode-darwin-arm64": "3.5.0",
8945
- "oh-my-opencode-darwin-x64": "3.5.0",
8946
- "oh-my-opencode-linux-arm64": "3.5.0",
8947
- "oh-my-opencode-linux-arm64-musl": "3.5.0",
8948
- "oh-my-opencode-linux-x64": "3.5.0",
8949
- "oh-my-opencode-linux-x64-musl": "3.5.0",
8950
- "oh-my-opencode-windows-x64": "3.5.0"
8944
+ "oh-my-opencode-darwin-arm64": "3.5.1",
8945
+ "oh-my-opencode-darwin-x64": "3.5.1",
8946
+ "oh-my-opencode-linux-arm64": "3.5.1",
8947
+ "oh-my-opencode-linux-arm64-musl": "3.5.1",
8948
+ "oh-my-opencode-linux-x64": "3.5.1",
8949
+ "oh-my-opencode-linux-x64-musl": "3.5.1",
8950
+ "oh-my-opencode-windows-x64": "3.5.1"
8951
8951
  },
8952
8952
  trustedDependencies: [
8953
8953
  "@ast-grep/cli",
package/dist/index.js CHANGED
@@ -34207,6 +34207,63 @@ async function enforceMainPaneWidth(mainPaneId, windowWidth) {
34207
34207
  }
34208
34208
  // src/shared/model-suggestion-retry.ts
34209
34209
  init_logger();
34210
+ function extractMessage(error45) {
34211
+ if (typeof error45 === "string")
34212
+ return error45;
34213
+ if (error45 instanceof Error)
34214
+ return error45.message;
34215
+ if (typeof error45 === "object" && error45 !== null) {
34216
+ const obj = error45;
34217
+ if (typeof obj.message === "string")
34218
+ return obj.message;
34219
+ try {
34220
+ return JSON.stringify(error45);
34221
+ } catch {
34222
+ return "";
34223
+ }
34224
+ }
34225
+ return String(error45);
34226
+ }
34227
+ function parseModelSuggestion(error45) {
34228
+ if (!error45)
34229
+ return null;
34230
+ if (typeof error45 === "object") {
34231
+ const errObj = error45;
34232
+ if (errObj.name === "ProviderModelNotFoundError" && typeof errObj.data === "object" && errObj.data !== null) {
34233
+ const data = errObj.data;
34234
+ const suggestions = data.suggestions;
34235
+ if (Array.isArray(suggestions) && suggestions.length > 0 && typeof suggestions[0] === "string") {
34236
+ return {
34237
+ providerID: String(data.providerID ?? ""),
34238
+ modelID: String(data.modelID ?? ""),
34239
+ suggestion: suggestions[0]
34240
+ };
34241
+ }
34242
+ return null;
34243
+ }
34244
+ for (const key of ["data", "error", "cause"]) {
34245
+ const nested = errObj[key];
34246
+ if (nested && typeof nested === "object") {
34247
+ const result = parseModelSuggestion(nested);
34248
+ if (result)
34249
+ return result;
34250
+ }
34251
+ }
34252
+ }
34253
+ const message = extractMessage(error45);
34254
+ if (!message)
34255
+ return null;
34256
+ const modelMatch = message.match(/model not found:\s*([^/\s]+)\s*\/\s*([^.\s]+)/i);
34257
+ const suggestionMatch = message.match(/did you mean:\s*([^,?]+)/i);
34258
+ if (modelMatch && suggestionMatch) {
34259
+ return {
34260
+ providerID: modelMatch[1].trim(),
34261
+ modelID: modelMatch[2].trim(),
34262
+ suggestion: suggestionMatch[1].trim()
34263
+ };
34264
+ }
34265
+ return null;
34266
+ }
34210
34267
  async function promptWithModelSuggestionRetry(client, args) {
34211
34268
  const promptPromise = client.session.promptAsync(args);
34212
34269
  let timeoutID = null;
@@ -34222,6 +34279,30 @@ async function promptWithModelSuggestionRetry(client, args) {
34222
34279
  clearTimeout(timeoutID);
34223
34280
  }
34224
34281
  }
34282
+ async function promptSyncWithModelSuggestionRetry(client, args) {
34283
+ try {
34284
+ await client.session.prompt(args);
34285
+ } catch (error45) {
34286
+ const suggestion = parseModelSuggestion(error45);
34287
+ if (!suggestion || !args.body.model) {
34288
+ throw error45;
34289
+ }
34290
+ log("[model-suggestion-retry] Model not found, retrying with suggestion", {
34291
+ original: `${suggestion.providerID}/${suggestion.modelID}`,
34292
+ suggested: suggestion.suggestion
34293
+ });
34294
+ await client.session.prompt({
34295
+ ...args,
34296
+ body: {
34297
+ ...args.body,
34298
+ model: {
34299
+ providerID: suggestion.providerID,
34300
+ modelID: suggestion.suggestion
34301
+ }
34302
+ }
34303
+ });
34304
+ }
34305
+ }
34225
34306
  // src/shared/opencode-server-auth.ts
34226
34307
  function getServerBasicAuthHeader() {
34227
34308
  const password = process.env.OPENCODE_SERVER_PASSWORD;
@@ -49656,30 +49737,6 @@ var LOOK_AT_DESCRIPTION = `Analyze media files (PDFs, images, diagrams) that req
49656
49737
  import { basename as basename5 } from "path";
49657
49738
  import { pathToFileURL as pathToFileURL3 } from "url";
49658
49739
 
49659
- // src/tools/look-at/session-poller.ts
49660
- var DEFAULT_POLL_INTERVAL_MS = 1000;
49661
- var DEFAULT_TIMEOUT_MS6 = 120000;
49662
- async function pollSessionUntilIdle(client2, sessionID, options) {
49663
- const pollInterval = options?.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
49664
- const timeout = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS6;
49665
- const startTime = Date.now();
49666
- while (Date.now() - startTime < timeout) {
49667
- const statusResult = await client2.session.status().catch((error45) => {
49668
- log(`[look_at] session.status error (treating as idle):`, error45);
49669
- return { data: undefined, error: error45 };
49670
- });
49671
- if (statusResult.error || !statusResult.data) {
49672
- return;
49673
- }
49674
- const sessionStatus = statusResult.data[sessionID];
49675
- if (!sessionStatus || sessionStatus.type === "idle") {
49676
- return;
49677
- }
49678
- await new Promise((resolve11) => setTimeout(resolve11, pollInterval));
49679
- }
49680
- throw new Error(`[look_at] Polling timed out after ${timeout}ms waiting for session ${sessionID} to become idle`);
49681
- }
49682
-
49683
49740
  // src/tools/look-at/assistant-message-extractor.ts
49684
49741
  function isObject3(value) {
49685
49742
  return typeof value === "object" && value !== null;
@@ -49925,9 +49982,9 @@ Original error: ${createResult.error}`;
49925
49982
  const sessionID = createResult.data.id;
49926
49983
  log(`[look_at] Created session: ${sessionID}`);
49927
49984
  const { agentModel, agentVariant } = await resolveMultimodalLookerAgentMetadata(ctx);
49928
- log(`[look_at] Sending async prompt with ${isBase64Input ? "base64 image" : "file"} to session ${sessionID}`);
49985
+ log(`[look_at] Sending prompt with ${isBase64Input ? "base64 image" : "file"} to session ${sessionID}`);
49929
49986
  try {
49930
- await promptWithModelSuggestionRetry(ctx.client, {
49987
+ await promptSyncWithModelSuggestionRetry(ctx.client, {
49931
49988
  path: { id: sessionID },
49932
49989
  body: {
49933
49990
  agent: MULTIMODAL_LOOKER_AGENT,
@@ -49946,14 +50003,7 @@ Original error: ${createResult.error}`;
49946
50003
  }
49947
50004
  });
49948
50005
  } catch (promptError) {
49949
- log(`[look_at] promptAsync error:`, promptError);
49950
- return `Error: Failed to send prompt to multimodal-looker agent: ${promptError instanceof Error ? promptError.message : String(promptError)}`;
49951
- }
49952
- log(`[look_at] Polling session ${sessionID} until idle...`);
49953
- try {
49954
- await pollSessionUntilIdle(ctx.client, sessionID, { pollIntervalMs: 500, timeoutMs: 120000 });
49955
- } catch (pollError) {
49956
- log(`[look_at] Polling error (will still try to fetch messages):`, pollError);
50006
+ log(`[look_at] Prompt error (ignored, will still fetch messages):`, promptError);
49957
50007
  }
49958
50008
  log(`[look_at] Fetching messages from session ${sessionID}...`);
49959
50009
  const messagesResult = await ctx.client.session.messages({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -74,13 +74,13 @@
74
74
  "typescript": "^5.7.3"
75
75
  },
76
76
  "optionalDependencies": {
77
- "oh-my-opencode-darwin-arm64": "3.5.0",
78
- "oh-my-opencode-darwin-x64": "3.5.0",
79
- "oh-my-opencode-linux-arm64": "3.5.0",
80
- "oh-my-opencode-linux-arm64-musl": "3.5.0",
81
- "oh-my-opencode-linux-x64": "3.5.0",
82
- "oh-my-opencode-linux-x64-musl": "3.5.0",
83
- "oh-my-opencode-windows-x64": "3.5.0"
77
+ "oh-my-opencode-darwin-arm64": "3.5.1",
78
+ "oh-my-opencode-darwin-x64": "3.5.1",
79
+ "oh-my-opencode-linux-arm64": "3.5.1",
80
+ "oh-my-opencode-linux-arm64-musl": "3.5.1",
81
+ "oh-my-opencode-linux-x64": "3.5.1",
82
+ "oh-my-opencode-linux-x64-musl": "3.5.1",
83
+ "oh-my-opencode-windows-x64": "3.5.1"
84
84
  },
85
85
  "trustedDependencies": [
86
86
  "@ast-grep/cli",