oh-my-opencode 3.17.5 → 3.17.7

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.
Files changed (56) hide show
  1. package/README.ja.md +1 -1
  2. package/README.ko.md +1 -1
  3. package/README.md +1 -1
  4. package/README.ru.md +1 -1
  5. package/README.zh-cn.md +1 -1
  6. package/dist/agents/agent-builder.d.ts +2 -3
  7. package/dist/agents/agent-skill-resolution.d.ts +7 -0
  8. package/dist/agents/frontier-tool-schema-guard.d.ts +3 -0
  9. package/dist/agents/hephaestus/agent.d.ts +1 -1
  10. package/dist/agents/hephaestus/gpt-5-5.d.ts +12 -0
  11. package/dist/agents/sisyphus/claude-opus-4-7.d.ts +20 -0
  12. package/dist/agents/sisyphus/gpt-5-5.d.ts +20 -0
  13. package/dist/agents/sisyphus/index.d.ts +5 -0
  14. package/dist/agents/sisyphus/kimi-k2-6.d.ts +32 -0
  15. package/dist/agents/sisyphus-junior/agent.d.ts +1 -1
  16. package/dist/agents/sisyphus-junior/gpt-5-5.d.ts +14 -0
  17. package/dist/agents/sisyphus-junior/index.d.ts +2 -0
  18. package/dist/agents/sisyphus-junior/kimi-k2-6.d.ts +13 -0
  19. package/dist/agents/types.d.ts +17 -1
  20. package/dist/cli/doctor/checks/model-resolution.d.ts +4 -0
  21. package/dist/cli/index.js +141 -86
  22. package/dist/features/background-agent/attempt-lifecycle.d.ts +12 -0
  23. package/dist/features/background-agent/background-task-notification-template.d.ts +2 -1
  24. package/dist/features/background-agent/constants.d.ts +1 -0
  25. package/dist/features/background-agent/fallback-retry-handler.d.ts +8 -0
  26. package/dist/features/background-agent/manager.d.ts +9 -0
  27. package/dist/features/background-agent/types.d.ts +24 -0
  28. package/dist/hooks/model-fallback/controller-accessor.d.ts +1 -0
  29. package/dist/hooks/model-fallback/fallback-state-controller.d.ts +1 -0
  30. package/dist/hooks/model-fallback/hook.d.ts +2 -1
  31. package/dist/hooks/preemptive-compaction-degradation-monitor.d.ts +1 -0
  32. package/dist/hooks/preemptive-compaction-no-text-tail.d.ts +1 -0
  33. package/dist/hooks/ralph-loop/ralph-loop-event-handler.d.ts +1 -6
  34. package/dist/hooks/ralph-loop/session-event-handler.d.ts +2 -6
  35. package/dist/hooks/ralph-loop/types.d.ts +5 -0
  36. package/dist/index.js +3533 -667
  37. package/dist/plugin/event.d.ts +1 -0
  38. package/dist/plugin/hooks/create-core-hooks.d.ts +2 -0
  39. package/dist/plugin/hooks/create-session-hooks.d.ts +2 -0
  40. package/dist/shared/agent-display-names.d.ts +7 -2
  41. package/dist/shared/agent-sort-shim.d.ts +28 -0
  42. package/dist/shared/dynamic-truncator.d.ts +9 -10
  43. package/dist/shared/file-reference-resolver.d.ts +1 -0
  44. package/dist/shared/model-error-classifier.d.ts +2 -2
  45. package/dist/shared/posthog-activity-state.d.ts +5 -2
  46. package/dist/shared/posthog.d.ts +5 -0
  47. package/dist/tools/background-task/clients.d.ts +1 -0
  48. package/dist/tools/delegate-task/builtin-categories.d.ts +1 -0
  49. package/dist/tools/delegate-task/builtin-category-definition.d.ts +1 -0
  50. package/dist/tools/delegate-task/constants.d.ts +1 -1
  51. package/dist/tools/delegate-task/executor-types.d.ts +1 -0
  52. package/dist/tools/delegate-task/openai-categories.d.ts +3 -0
  53. package/dist/tools/delegate-task/sync-task-fallback.d.ts +3 -0
  54. package/dist/tools/slashcommand/command-discovery-deps.d.ts +6 -0
  55. package/package.json +12 -12
  56. package/dist/hooks/ralph-loop/loop-session-recovery.d.ts +0 -7
package/dist/cli/index.js CHANGED
@@ -5095,8 +5095,10 @@ function normalizeSDKResponse(response, fallback, options) {
5095
5095
  }
5096
5096
 
5097
5097
  // src/shared/dynamic-truncator.ts
5098
+ var usageCacheByClient;
5098
5099
  var init_dynamic_truncator = __esm(() => {
5099
5100
  init_context_limit_resolver();
5101
+ usageCacheByClient = new WeakMap;
5100
5102
  });
5101
5103
 
5102
5104
  // src/shared/data-path.ts
@@ -6204,7 +6206,8 @@ var init_model_versions = __esm(() => {
6204
6206
  "anthropic/claude-opus-4-5": "anthropic/claude-opus-4-7",
6205
6207
  "anthropic/claude-opus-4-6": "anthropic/claude-opus-4-7",
6206
6208
  "anthropic/claude-sonnet-4-5": "anthropic/claude-sonnet-4-6",
6207
- "openai/gpt-5.3-codex": "openai/gpt-5.4"
6209
+ "openai/gpt-5.3-codex": "openai/gpt-5.4",
6210
+ "openai/gpt-5.4": "openai/gpt-5.5"
6208
6211
  };
6209
6212
  });
6210
6213
 
@@ -6289,12 +6292,15 @@ function migrateConfigFile(configPath, rawConfig) {
6289
6292
  const copy = JSON.parse(JSON.stringify(rawConfig));
6290
6293
  let needsWrite = false;
6291
6294
  const sidecarMigrations = readAppliedMigrations(configPath);
6292
- const inConfigMigrations = Array.isArray(copy._migrations) ? new Set(copy._migrations) : new Set;
6295
+ const inConfigMigrations = Array.isArray(copy._migrations) ? new Set(copy._migrations.filter((migration) => typeof migration === "string")) : new Set;
6296
+ const inlineAppliedMigrations = Array.isArray(copy.appliedMigrations) ? new Set(copy.appliedMigrations.filter((migration) => typeof migration === "string")) : new Set;
6293
6297
  const existingMigrations = new Set([
6294
6298
  ...sidecarMigrations,
6295
- ...inConfigMigrations
6299
+ ...inConfigMigrations,
6300
+ ...inlineAppliedMigrations
6296
6301
  ]);
6297
6302
  const hadLegacyInConfigMigrations = inConfigMigrations.size > 0;
6303
+ const hadInlineAppliedMigrations = inlineAppliedMigrations.size > 0;
6298
6304
  const allNewMigrations = [];
6299
6305
  if (copy.agents && typeof copy.agents === "object") {
6300
6306
  const { migrated, changed } = migrateAgentNames(copy.agents);
@@ -6326,11 +6332,12 @@ function migrateConfigFile(configPath, rawConfig) {
6326
6332
  ...existingMigrations,
6327
6333
  ...newMigrationsToRecord
6328
6334
  ]);
6329
- const shouldWriteSidecar = newMigrationsToRecord.length > 0 || hadLegacyInConfigMigrations;
6335
+ const shouldWriteSidecar = newMigrationsToRecord.length > 0 || hadLegacyInConfigMigrations || hadInlineAppliedMigrations;
6330
6336
  if (newMigrationsToRecord.length > 0) {
6331
6337
  needsWrite = true;
6332
6338
  }
6333
- if (hadLegacyInConfigMigrations) {
6339
+ if (hadLegacyInConfigMigrations || hadInlineAppliedMigrations) {
6340
+ delete copy.appliedMigrations;
6334
6341
  needsWrite = true;
6335
6342
  }
6336
6343
  if (shouldWriteSidecar) {
@@ -6701,11 +6708,6 @@ function stripInvisibleAgentCharacters(agentName) {
6701
6708
  function stripAgentListSortPrefix(agentName) {
6702
6709
  return stripInvisibleAgentCharacters(agentName);
6703
6710
  }
6704
- function getAgentRuntimeName(configKey) {
6705
- const displayName = getAgentDisplayName(configKey);
6706
- const prefix = AGENT_LIST_SORT_PREFIXES[configKey.toLowerCase()];
6707
- return prefix ? `${prefix}${displayName}` : displayName;
6708
- }
6709
6711
  function getAgentDisplayName(configKey) {
6710
6712
  const exactMatch = AGENT_DISPLAY_NAMES[configKey];
6711
6713
  if (exactMatch !== undefined)
@@ -6733,7 +6735,7 @@ function getAgentConfigKey(agentName) {
6733
6735
  const lower = stripAgentListSortPrefix(agentName).trim().toLowerCase();
6734
6736
  return resolveKnownAgentConfigKey(agentName) ?? lower;
6735
6737
  }
6736
- var AGENT_DISPLAY_NAMES, AGENT_LIST_SORT_PREFIXES, INVISIBLE_AGENT_CHARACTERS_REGEX, REVERSE_DISPLAY_NAMES, LEGACY_DISPLAY_NAMES;
6738
+ var AGENT_DISPLAY_NAMES, INVISIBLE_AGENT_CHARACTERS_REGEX, REVERSE_DISPLAY_NAMES, LEGACY_DISPLAY_NAMES;
6737
6739
  var init_agent_display_names = __esm(() => {
6738
6740
  AGENT_DISPLAY_NAMES = {
6739
6741
  sisyphus: "Sisyphus - Ultraworker",
@@ -6751,12 +6753,6 @@ var init_agent_display_names = __esm(() => {
6751
6753
  "multimodal-looker": "multimodal-looker",
6752
6754
  "council-member": "council-member"
6753
6755
  };
6754
- AGENT_LIST_SORT_PREFIXES = {
6755
- sisyphus: "\u200B",
6756
- hephaestus: "\u200B\u200B",
6757
- prometheus: "\u200B\u200B\u200B",
6758
- atlas: "\u200B\u200B\u200B\u200B"
6759
- };
6760
6756
  INVISIBLE_AGENT_CHARACTERS_REGEX = /[\u200B\u200C\u200D\uFEFF]/g;
6761
6757
  REVERSE_DISPLAY_NAMES = Object.fromEntries(Object.entries(AGENT_DISPLAY_NAMES).map(([key, displayName]) => [displayName.toLowerCase(), key]));
6762
6758
  LEGACY_DISPLAY_NAMES = {
@@ -6796,7 +6792,7 @@ var init_model_requirements = __esm(() => {
6796
6792
  ],
6797
6793
  model: "kimi-k2.5"
6798
6794
  },
6799
- { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.4", variant: "medium" },
6795
+ { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.5", variant: "medium" },
6800
6796
  { providers: ["zai-coding-plan", "opencode", "vercel"], model: "glm-5" },
6801
6797
  { providers: ["opencode"], model: "big-pickle" }
6802
6798
  ],
@@ -6806,7 +6802,7 @@ var init_model_requirements = __esm(() => {
6806
6802
  fallbackChain: [
6807
6803
  {
6808
6804
  providers: ["openai", "github-copilot", "venice", "opencode", "vercel"],
6809
- model: "gpt-5.4",
6805
+ model: "gpt-5.5",
6810
6806
  variant: "medium"
6811
6807
  }
6812
6808
  ],
@@ -6816,7 +6812,7 @@ var init_model_requirements = __esm(() => {
6816
6812
  fallbackChain: [
6817
6813
  {
6818
6814
  providers: ["openai", "github-copilot", "opencode", "vercel"],
6819
- model: "gpt-5.4",
6815
+ model: "gpt-5.5",
6820
6816
  variant: "high"
6821
6817
  },
6822
6818
  {
@@ -6852,7 +6848,7 @@ var init_model_requirements = __esm(() => {
6852
6848
  },
6853
6849
  "multimodal-looker": {
6854
6850
  fallbackChain: [
6855
- { providers: ["openai", "opencode", "vercel"], model: "gpt-5.4", variant: "medium" },
6851
+ { providers: ["openai", "opencode", "vercel"], model: "gpt-5.5", variant: "medium" },
6856
6852
  { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6857
6853
  { providers: ["zai-coding-plan", "vercel"], model: "glm-4.6v" },
6858
6854
  { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5-nano" }
@@ -6867,7 +6863,7 @@ var init_model_requirements = __esm(() => {
6867
6863
  },
6868
6864
  {
6869
6865
  providers: ["openai", "github-copilot", "opencode", "vercel"],
6870
- model: "gpt-5.4",
6866
+ model: "gpt-5.5",
6871
6867
  variant: "high"
6872
6868
  },
6873
6869
  { providers: ["opencode-go", "vercel"], model: "glm-5" },
@@ -6886,7 +6882,7 @@ var init_model_requirements = __esm(() => {
6886
6882
  },
6887
6883
  {
6888
6884
  providers: ["openai", "github-copilot", "opencode", "vercel"],
6889
- model: "gpt-5.4",
6885
+ model: "gpt-5.5",
6890
6886
  variant: "high"
6891
6887
  },
6892
6888
  { providers: ["opencode-go", "vercel"], model: "glm-5" },
@@ -6897,7 +6893,7 @@ var init_model_requirements = __esm(() => {
6897
6893
  fallbackChain: [
6898
6894
  {
6899
6895
  providers: ["openai", "github-copilot", "opencode", "vercel"],
6900
- model: "gpt-5.4",
6896
+ model: "gpt-5.5",
6901
6897
  variant: "xhigh"
6902
6898
  },
6903
6899
  {
@@ -6919,7 +6915,7 @@ var init_model_requirements = __esm(() => {
6919
6915
  { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6920
6916
  {
6921
6917
  providers: ["openai", "github-copilot", "opencode", "vercel"],
6922
- model: "gpt-5.4",
6918
+ model: "gpt-5.5",
6923
6919
  variant: "medium"
6924
6920
  },
6925
6921
  { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" }
@@ -6931,7 +6927,7 @@ var init_model_requirements = __esm(() => {
6931
6927
  { providers: ["opencode-go", "vercel"], model: "kimi-k2.5" },
6932
6928
  {
6933
6929
  providers: ["openai", "github-copilot", "opencode", "vercel"],
6934
- model: "gpt-5.4",
6930
+ model: "gpt-5.5",
6935
6931
  variant: "medium"
6936
6932
  },
6937
6933
  { providers: ["opencode-go", "vercel"], model: "minimax-m2.7" },
@@ -6961,7 +6957,7 @@ var init_model_requirements = __esm(() => {
6961
6957
  fallbackChain: [
6962
6958
  {
6963
6959
  providers: ["openai", "opencode", "vercel"],
6964
- model: "gpt-5.4",
6960
+ model: "gpt-5.5",
6965
6961
  variant: "xhigh"
6966
6962
  },
6967
6963
  {
@@ -6981,7 +6977,7 @@ var init_model_requirements = __esm(() => {
6981
6977
  fallbackChain: [
6982
6978
  {
6983
6979
  providers: ["openai", "github-copilot", "venice", "opencode", "vercel"],
6984
- model: "gpt-5.4",
6980
+ model: "gpt-5.5",
6985
6981
  variant: "medium"
6986
6982
  },
6987
6983
  {
@@ -7008,7 +7004,7 @@ var init_model_requirements = __esm(() => {
7008
7004
  model: "claude-opus-4-7",
7009
7005
  variant: "max"
7010
7006
  },
7011
- { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.4" }
7007
+ { providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.5" }
7012
7008
  ],
7013
7009
  requiresModel: "gemini-3.1-pro"
7014
7010
  },
@@ -7058,7 +7054,7 @@ var init_model_requirements = __esm(() => {
7058
7054
  },
7059
7055
  {
7060
7056
  providers: ["openai", "github-copilot", "opencode", "vercel"],
7061
- model: "gpt-5.4",
7057
+ model: "gpt-5.5",
7062
7058
  variant: "high"
7063
7059
  },
7064
7060
  { providers: ["zai-coding-plan", "opencode", "vercel"], model: "glm-5" },
@@ -49900,6 +49896,22 @@ var init_supplemental_entries = __esm(() => {
49900
49896
  input: 272000,
49901
49897
  output: 128000
49902
49898
  }
49899
+ },
49900
+ "gpt-5.5": {
49901
+ id: "gpt-5.5",
49902
+ family: "gpt",
49903
+ reasoning: true,
49904
+ temperature: false,
49905
+ toolCall: true,
49906
+ modalities: {
49907
+ input: ["text", "image", "pdf"],
49908
+ output: ["text"]
49909
+ },
49910
+ limit: {
49911
+ context: 400000,
49912
+ input: 272000,
49913
+ output: 128000
49914
+ }
49903
49915
  }
49904
49916
  };
49905
49917
  });
@@ -49979,6 +49991,18 @@ var init_model_capability_aliases = __esm(() => {
49979
49991
  ruleID: "gemini-3-pro-tier-alias",
49980
49992
  canonicalModelID: "gemini-3-pro-preview",
49981
49993
  rationale: "Legacy Gemini 3 tier suffixes still need to land on the canonical preview model."
49994
+ },
49995
+ {
49996
+ aliasModelID: "k2pb",
49997
+ ruleID: "kimi-k2pb-alias",
49998
+ canonicalModelID: "k2p5",
49999
+ rationale: "Kimi for Coding exposes k2pb while the bundled capabilities snapshot uses the canonical k2p5 ID."
50000
+ },
50001
+ {
50002
+ aliasModelID: "claude-opus-4.7",
50003
+ ruleID: "claude-opus-dotted-version-alias",
50004
+ canonicalModelID: "claude-opus-4-7",
50005
+ rationale: "GitHub Copilot exposes Claude Opus 4.7 with dotted version syntax while the snapshot uses dashed syntax."
49982
50006
  }
49983
50007
  ];
49984
50008
  EXACT_ALIAS_RULES_BY_MODEL = new Map(EXACT_ALIAS_RULES.map((rule) => [rule.aliasModelID, rule]));
@@ -50048,10 +50072,18 @@ var init_model_capability_heuristics = __esm(() => {
50048
50072
  includes: ["gemini"],
50049
50073
  variants: ["low", "medium", "high"]
50050
50074
  },
50075
+ {
50076
+ family: "kimi-thinking",
50077
+ includes: ["kimi-thinking", "k2-thinking", "k2-think"],
50078
+ pattern: /(?:kimi|k2).*-(?:thinking|think)/,
50079
+ variants: ["low", "medium", "high"],
50080
+ supportsThinking: true
50081
+ },
50051
50082
  {
50052
50083
  family: "kimi",
50053
50084
  includes: ["kimi", "k2"],
50054
- variants: ["low", "medium", "high"]
50085
+ variants: ["low", "medium", "high"],
50086
+ supportsThinking: false
50055
50087
  },
50056
50088
  {
50057
50089
  family: "glm",
@@ -50061,7 +50093,8 @@ var init_model_capability_heuristics = __esm(() => {
50061
50093
  {
50062
50094
  family: "minimax",
50063
50095
  includes: ["minimax"],
50064
- variants: ["low", "medium", "high"]
50096
+ variants: ["low", "medium", "high"],
50097
+ supportsThinking: false
50065
50098
  },
50066
50099
  {
50067
50100
  family: "deepseek",
@@ -51528,10 +51561,10 @@ var init_openai_only_model_catalog = __esm(() => {
51528
51561
  librarian: { model: "openai/gpt-5.4-mini-fast" }
51529
51562
  };
51530
51563
  OPENAI_ONLY_CATEGORY_OVERRIDES = {
51531
- artistry: { model: "openai/gpt-5.4", variant: "xhigh" },
51564
+ artistry: { model: "openai/gpt-5.5", variant: "xhigh" },
51532
51565
  quick: { model: "openai/gpt-5.4-mini" },
51533
- "visual-engineering": { model: "openai/gpt-5.4", variant: "high" },
51534
- writing: { model: "openai/gpt-5.4", variant: "medium" }
51566
+ "visual-engineering": { model: "openai/gpt-5.5", variant: "high" },
51567
+ writing: { model: "openai/gpt-5.5", variant: "medium" }
51535
51568
  };
51536
51569
  });
51537
51570
 
@@ -51854,6 +51887,30 @@ function archiveLegacyConfigFile(legacyPath) {
51854
51887
  }
51855
51888
  }
51856
51889
  }
51890
+ function migrateLegacySidecarFile(legacyPath, canonicalPath) {
51891
+ const legacySidecarPath = getSidecarPath(legacyPath);
51892
+ if (!existsSync14(legacySidecarPath))
51893
+ return true;
51894
+ const canonicalSidecarPath = getSidecarPath(canonicalPath);
51895
+ if (existsSync14(canonicalSidecarPath))
51896
+ return true;
51897
+ try {
51898
+ const content = readFileSync9(legacySidecarPath, "utf-8");
51899
+ writeFileAtomically(canonicalSidecarPath, content);
51900
+ log("[migrateLegacyConfigFile] Migrated legacy migration sidecar to canonical path", {
51901
+ from: legacySidecarPath,
51902
+ to: canonicalSidecarPath
51903
+ });
51904
+ return true;
51905
+ } catch (error) {
51906
+ log("[migrateLegacyConfigFile] Failed to migrate legacy migration sidecar", {
51907
+ legacySidecarPath,
51908
+ canonicalSidecarPath,
51909
+ error
51910
+ });
51911
+ return false;
51912
+ }
51913
+ }
51857
51914
  function migrateLegacyConfigFile(legacyPath) {
51858
51915
  if (!existsSync14(legacyPath))
51859
51916
  return false;
@@ -51865,10 +51922,12 @@ function migrateLegacyConfigFile(legacyPath) {
51865
51922
  try {
51866
51923
  const content = readFileSync9(legacyPath, "utf-8");
51867
51924
  writeFileAtomically(canonicalPath, content);
51925
+ const migratedSidecar = migrateLegacySidecarFile(legacyPath, canonicalPath);
51868
51926
  const archivedLegacyConfig = archiveLegacyConfigFile(legacyPath);
51869
51927
  log("[migrateLegacyConfigFile] Migrated legacy config to canonical path", {
51870
51928
  from: legacyPath,
51871
51929
  to: canonicalPath,
51930
+ migratedSidecar,
51872
51931
  archivedLegacyConfig
51873
51932
  });
51874
51933
  return true;
@@ -51879,6 +51938,7 @@ function migrateLegacyConfigFile(legacyPath) {
51879
51938
  }
51880
51939
  var init_migrate_legacy_config_file = __esm(() => {
51881
51940
  init_logger();
51941
+ init_migrations_sidecar();
51882
51942
  init_plugin_identity();
51883
51943
  init_write_file_atomically();
51884
51944
  });
@@ -53006,13 +53066,6 @@ function readPackageVersion(packageJsonPath) {
53006
53066
  return pkg.version ?? null;
53007
53067
  }
53008
53068
  function getCachedVersion() {
53009
- for (const candidate of INSTALLED_PACKAGE_JSON_CANDIDATES) {
53010
- try {
53011
- if (fs9.existsSync(candidate)) {
53012
- return readPackageVersion(candidate);
53013
- }
53014
- } catch {}
53015
- }
53016
53069
  try {
53017
53070
  const currentDir = path9.dirname(fileURLToPath2(import.meta.url));
53018
53071
  const pkgPath = findPackageJsonUp(currentDir);
@@ -53022,6 +53075,13 @@ function getCachedVersion() {
53022
53075
  } catch (err) {
53023
53076
  log("[auto-update-checker] Failed to resolve version from current directory:", err);
53024
53077
  }
53078
+ for (const candidate of INSTALLED_PACKAGE_JSON_CANDIDATES) {
53079
+ try {
53080
+ if (fs9.existsSync(candidate)) {
53081
+ return readPackageVersion(candidate);
53082
+ }
53083
+ } catch {}
53084
+ }
53025
53085
  try {
53026
53086
  const execDir = path9.dirname(fs9.realpathSync(process.execPath));
53027
53087
  const pkgPath = findPackageJsonUp(execDir);
@@ -53806,7 +53866,7 @@ var {
53806
53866
  // package.json
53807
53867
  var package_default = {
53808
53868
  name: "oh-my-opencode",
53809
- version: "3.17.5",
53869
+ version: "3.17.7",
53810
53870
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
53811
53871
  main: "./dist/index.js",
53812
53872
  types: "dist/index.d.ts",
@@ -53886,17 +53946,17 @@ var package_default = {
53886
53946
  zod: "^4.3.0"
53887
53947
  },
53888
53948
  optionalDependencies: {
53889
- "oh-my-opencode-darwin-arm64": "3.17.5",
53890
- "oh-my-opencode-darwin-x64": "3.17.5",
53891
- "oh-my-opencode-darwin-x64-baseline": "3.17.5",
53892
- "oh-my-opencode-linux-arm64": "3.17.5",
53893
- "oh-my-opencode-linux-arm64-musl": "3.17.5",
53894
- "oh-my-opencode-linux-x64": "3.17.5",
53895
- "oh-my-opencode-linux-x64-baseline": "3.17.5",
53896
- "oh-my-opencode-linux-x64-musl": "3.17.5",
53897
- "oh-my-opencode-linux-x64-musl-baseline": "3.17.5",
53898
- "oh-my-opencode-windows-x64": "3.17.5",
53899
- "oh-my-opencode-windows-x64-baseline": "3.17.5"
53949
+ "oh-my-opencode-darwin-arm64": "3.17.7",
53950
+ "oh-my-opencode-darwin-x64": "3.17.7",
53951
+ "oh-my-opencode-darwin-x64-baseline": "3.17.7",
53952
+ "oh-my-opencode-linux-arm64": "3.17.7",
53953
+ "oh-my-opencode-linux-arm64-musl": "3.17.7",
53954
+ "oh-my-opencode-linux-x64": "3.17.7",
53955
+ "oh-my-opencode-linux-x64-baseline": "3.17.7",
53956
+ "oh-my-opencode-linux-x64-musl": "3.17.7",
53957
+ "oh-my-opencode-linux-x64-musl-baseline": "3.17.7",
53958
+ "oh-my-opencode-windows-x64": "3.17.7",
53959
+ "oh-my-opencode-windows-x64-baseline": "3.17.7"
53900
53960
  },
53901
53961
  overrides: {},
53902
53962
  trustedDependencies: [
@@ -58576,9 +58636,6 @@ function getPostHogActivityStateFilePath() {
58576
58636
  function getUtcDayString(date) {
58577
58637
  return date.toISOString().slice(0, 10);
58578
58638
  }
58579
- function getUtcHourString(date) {
58580
- return date.toISOString().slice(0, 13);
58581
- }
58582
58639
  function isPostHogActivityState(value) {
58583
58640
  return value !== null && typeof value === "object" && !Array.isArray(value);
58584
58641
  }
@@ -58618,24 +58675,24 @@ function writePostHogActivityState(nextState) {
58618
58675
  function getPostHogActivityCaptureState(now = new Date) {
58619
58676
  const state = readPostHogActivityState();
58620
58677
  const dayUTC = getUtcDayString(now);
58621
- const hourUTC = getUtcHourString(now);
58622
58678
  const captureDaily = state.lastActiveDayUTC !== dayUTC;
58623
- const captureHourly = state.lastActiveHourUTC !== hourUTC;
58624
- if (captureDaily || captureHourly) {
58679
+ if (captureDaily) {
58625
58680
  writePostHogActivityState({
58626
- lastActiveDayUTC: captureDaily ? dayUTC : state.lastActiveDayUTC,
58627
- lastActiveHourUTC: captureHourly ? hourUTC : state.lastActiveHourUTC
58681
+ ...state,
58682
+ lastActiveDayUTC: dayUTC
58628
58683
  });
58629
58684
  }
58630
58685
  return {
58631
58686
  dayUTC,
58632
- hourUTC,
58633
- captureDaily,
58634
- captureHourly
58687
+ captureDaily
58635
58688
  };
58636
58689
  }
58637
58690
 
58638
58691
  // src/shared/posthog.ts
58692
+ var activityStateProviderOverride = null;
58693
+ function resolveActivityState() {
58694
+ return (activityStateProviderOverride ?? getPostHogActivityCaptureState)();
58695
+ }
58639
58696
  var DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com";
58640
58697
  var DEFAULT_POSTHOG_API_KEY = "phc_CFJhj5HyvA62QPhvyaUCtaq23aUfznnijg5VaaGkNk74";
58641
58698
  var NO_OP_POSTHOG = {
@@ -58670,7 +58727,16 @@ function getPostHogApiKey() {
58670
58727
  function getPostHogHost() {
58671
58728
  return process.env.POSTHOG_HOST?.trim() || DEFAULT_POSTHOG_HOST;
58672
58729
  }
58730
+ function safeCpus() {
58731
+ try {
58732
+ const cpus = os3.cpus();
58733
+ return { length: cpus.length, model: cpus[0]?.model };
58734
+ } catch {
58735
+ return { length: 0, model: undefined };
58736
+ }
58737
+ }
58673
58738
  function getSharedProperties(source) {
58739
+ const cpus = safeCpus();
58674
58740
  return {
58675
58741
  platform: "oh-my-opencode",
58676
58742
  package_name: PUBLISHED_PACKAGE_NAME,
@@ -58683,8 +58749,8 @@ function getSharedProperties(source) {
58683
58749
  $os_version: os3.release(),
58684
58750
  os_arch: os3.arch(),
58685
58751
  os_type: os3.type(),
58686
- cpu_count: os3.cpus().length,
58687
- cpu_model: os3.cpus()[0]?.model,
58752
+ cpu_count: cpus.length,
58753
+ cpu_model: cpus.model,
58688
58754
  total_memory_gb: Math.round(os3.totalmem() / 1024 / 1024 / 1024),
58689
58755
  locale: Intl.DateTimeFormat().resolvedOptions().locale,
58690
58756
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
@@ -58725,7 +58791,7 @@ function createPostHogClient(source, options) {
58725
58791
  });
58726
58792
  },
58727
58793
  trackActive: (distinctId, reason) => {
58728
- const activityState = getPostHogActivityCaptureState();
58794
+ const activityState = resolveActivityState();
58729
58795
  if (activityState.captureDaily) {
58730
58796
  configuredClient.capture({
58731
58797
  distinctId,
@@ -58737,17 +58803,6 @@ function createPostHogClient(source, options) {
58737
58803
  }
58738
58804
  });
58739
58805
  }
58740
- if (activityState.captureHourly) {
58741
- configuredClient.capture({
58742
- distinctId,
58743
- event: "omo_hourly_active",
58744
- properties: {
58745
- ...sharedProperties,
58746
- hour_utc: activityState.hourUTC,
58747
- reason
58748
- }
58749
- });
58750
- }
58751
58806
  },
58752
58807
  shutdown: async () => configuredClient.shutdown()
58753
58808
  };
@@ -59530,7 +59585,7 @@ async function promptInstallConfig(detected) {
59530
59585
  message: "Do you have access to OpenCode Zen (opencode/ models)?",
59531
59586
  options: [
59532
59587
  { value: "no", label: "No", hint: "Will use other configured providers" },
59533
- { value: "yes", label: "Yes", hint: "opencode/claude-opus-4-7, opencode/gpt-5.4, etc." }
59588
+ { value: "yes", label: "Yes", hint: "opencode/claude-opus-4-7, opencode/gpt-5.5, etc." }
59534
59589
  ],
59535
59590
  initialValue: initial.opencodeZen
59536
59591
  });
@@ -76532,7 +76587,7 @@ var normalizeAgentName = (agent) => {
76532
76587
  return;
76533
76588
  const configKey = getAgentConfigKey(trimmed);
76534
76589
  const displayName = getAgentDisplayName(configKey);
76535
- const runtimeName = getAgentRuntimeName(configKey);
76590
+ const runtimeName = getAgentDisplayName(configKey);
76536
76591
  const isKnownAgent = displayName !== configKey;
76537
76592
  return {
76538
76593
  configKey,
@@ -76560,12 +76615,12 @@ var resolveRunAgent = (options, pluginConfig, env = process.env) => {
76560
76615
  const configAgent = normalizeAgentName(pluginConfig.default_run_agent);
76561
76616
  const resolved = cliAgent ?? envAgent ?? configAgent ?? {
76562
76617
  configKey: DEFAULT_AGENT,
76563
- resolvedName: getAgentRuntimeName(DEFAULT_AGENT)
76618
+ resolvedName: getAgentDisplayName(DEFAULT_AGENT)
76564
76619
  };
76565
76620
  if (isAgentDisabled(resolved.configKey, pluginConfig)) {
76566
76621
  const fallback = pickFallbackAgent(pluginConfig);
76567
76622
  const fallbackDisplayName = getAgentDisplayName(fallback);
76568
- const fallbackRuntimeName = getAgentRuntimeName(fallback);
76623
+ const fallbackRuntimeName = getAgentDisplayName(fallback);
76569
76624
  const fallbackDisabled = isAgentDisabled(fallback, pluginConfig);
76570
76625
  if (fallbackDisabled) {
76571
76626
  console.log(import_picocolors12.default.yellow(`Requested agent "${resolved.resolvedName}" is disabled and no enabled core agent was found. Proceeding with "${fallbackDisplayName}".`));
@@ -78316,7 +78371,7 @@ function buildEffectiveResolution(requirement, userOverride) {
78316
78371
 
78317
78372
  // src/cli/doctor/checks/model-resolution.ts
78318
78373
  function parseProviderModel(value) {
78319
- const slashIndex = value.lastIndexOf("/");
78374
+ const slashIndex = value.indexOf("/");
78320
78375
  if (slashIndex <= 0 || slashIndex === value.length - 1) {
78321
78376
  return null;
78322
78377
  }
@@ -78370,7 +78425,7 @@ function collectCapabilityResolutionIssues(info) {
78370
78425
  const allEntries = [...info.agents, ...info.categories];
78371
78426
  const fallbackEntries = allEntries.filter((entry) => {
78372
78427
  const mode = entry.capabilityDiagnostics?.resolutionMode;
78373
- return mode === "alias-backed" || mode === "heuristic-backed" || mode === "unknown";
78428
+ return mode === "unknown";
78374
78429
  });
78375
78430
  if (fallbackEntries.length === 0) {
78376
78431
  return issues;
@@ -80243,7 +80298,7 @@ Examples:
80243
80298
  $ bunx oh-my-opencode run --on-complete "notify-send Done" "Fix the bug"
80244
80299
  $ bunx oh-my-opencode run --session-id ses_abc123 "Continue the work"
80245
80300
  $ bunx oh-my-opencode run --model anthropic/claude-sonnet-4 "Fix the bug"
80246
- $ bunx oh-my-opencode run --agent Sisyphus --model openai/gpt-5.4 "Implement feature X"
80301
+ $ bunx oh-my-opencode run --agent Sisyphus --model openai/gpt-5.5 "Implement feature X"
80247
80302
 
80248
80303
  Agent resolution order:
80249
80304
  1) --agent flag
@@ -0,0 +1,12 @@
1
+ import type { DelegatedModelConfig } from "../../shared/model-resolution-types";
2
+ import type { BackgroundTask, BackgroundTaskAttempt, BackgroundTaskStatus } from "./types";
3
+ type TerminalAttemptStatus = Extract<BackgroundTaskStatus, "completed" | "error" | "cancelled" | "interrupt">;
4
+ export declare function getCurrentAttempt(task: BackgroundTask): BackgroundTaskAttempt | undefined;
5
+ export declare function ensureCurrentAttempt(task: BackgroundTask, model?: DelegatedModelConfig | undefined): BackgroundTaskAttempt;
6
+ export declare function projectTaskFromCurrentAttempt(task: BackgroundTask): BackgroundTask;
7
+ export declare function startAttempt(task: BackgroundTask, model: DelegatedModelConfig | undefined): BackgroundTaskAttempt;
8
+ export declare function bindAttemptSession(task: BackgroundTask, attemptID: string, sessionID: string, model: DelegatedModelConfig | undefined): BackgroundTaskAttempt | undefined;
9
+ export declare function finalizeAttempt(task: BackgroundTask, attemptID: string, status: TerminalAttemptStatus, error?: string): BackgroundTaskAttempt | undefined;
10
+ export declare function scheduleRetryAttempt(task: BackgroundTask, failedAttemptID: string, nextModel: DelegatedModelConfig, error?: string): BackgroundTaskAttempt | undefined;
11
+ export declare function findAttemptBySession(task: BackgroundTask, sessionID: string): BackgroundTaskAttempt | undefined;
12
+ export {};
@@ -1,10 +1,11 @@
1
- import type { BackgroundTaskStatus } from "./types";
1
+ import type { BackgroundTaskAttempt, BackgroundTaskStatus } from "./types";
2
2
  export type BackgroundTaskNotificationStatus = "COMPLETED" | "CANCELLED" | "INTERRUPTED" | "ERROR";
3
3
  export interface BackgroundTaskNotificationTask {
4
4
  id: string;
5
5
  description: string;
6
6
  status: BackgroundTaskStatus;
7
7
  error?: string;
8
+ attempts?: BackgroundTaskAttempt[];
8
9
  }
9
10
  export declare function buildBackgroundTaskNotificationText(input: {
10
11
  task: BackgroundTaskNotificationTask;
@@ -39,6 +39,7 @@ export interface Todo {
39
39
  id?: string;
40
40
  }
41
41
  export interface QueueItem {
42
+ attemptID: string;
42
43
  task: BackgroundTask;
43
44
  input: LaunchInput;
44
45
  }
@@ -13,4 +13,12 @@ export declare function tryFallbackRetry(args: {
13
13
  idleDeferralTimers: Map<string, ReturnType<typeof setTimeout>>;
14
14
  queuesByKey: Map<string, QueueItem[]>;
15
15
  processKey: (key: string) => void;
16
+ onRetrying?: (details: {
17
+ task: BackgroundTask;
18
+ source: string;
19
+ previousSessionID?: string;
20
+ failedModel?: string;
21
+ failedError?: string;
22
+ nextModel: string;
23
+ }) => void;
16
24
  }): Promise<boolean>;
@@ -1,4 +1,5 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { ModelFallbackControllerAccessor } from "../../hooks/model-fallback";
2
3
  import type { BackgroundTask, LaunchInput, ResumeInput } from "./types";
3
4
  import { TaskHistory } from "./task-history";
4
5
  import type { BackgroundTaskConfig, TmuxConfig } from "../../config/schema";
@@ -22,6 +23,7 @@ export interface SubagentSessionCreatedEvent {
22
23
  export type OnSubagentSessionCreated = (event: SubagentSessionCreatedEvent) => Promise<void>;
23
24
  export declare class BackgroundManager {
24
25
  private tasks;
26
+ private tasksByParentSession;
25
27
  private notifications;
26
28
  private pendingNotifications;
27
29
  private pendingByParent;
@@ -46,6 +48,7 @@ export declare class BackgroundManager {
46
48
  private rootDescendantCounts;
47
49
  private preStartDescendantReservations;
48
50
  private enableParentSessionNotifications;
51
+ private modelFallbackControllerAccessor?;
49
52
  readonly taskHistory: TaskHistory;
50
53
  private cachedCircuitBreakerSettings?;
51
54
  constructor(ctx: PluginInput, config?: BackgroundTaskConfig, options?: {
@@ -53,6 +56,7 @@ export declare class BackgroundManager {
53
56
  onSubagentSessionCreated?: OnSubagentSessionCreated;
54
57
  onShutdown?: () => void | Promise<void>;
55
58
  enableParentSessionNotifications?: boolean;
59
+ modelFallbackControllerAccessor?: ModelFallbackControllerAccessor;
56
60
  });
57
61
  private abortSessionWithLogging;
58
62
  assertCanSpawn(parentSessionID: string): Promise<SubagentSpawnContext>;
@@ -67,6 +71,10 @@ export declare class BackgroundManager {
67
71
  private markPreStartDescendantReservation;
68
72
  private settlePreStartDescendantReservation;
69
73
  private rollbackPreStartDescendantReservation;
74
+ private addTask;
75
+ private removeTask;
76
+ private updateTaskParent;
77
+ private removeTaskFromParentIndex;
70
78
  launch(input: LaunchInput): Promise<BackgroundTask>;
71
79
  private processKey;
72
80
  private startTask;
@@ -74,6 +82,7 @@ export declare class BackgroundManager {
74
82
  getTasksByParentSession(sessionID: string): BackgroundTask[];
75
83
  getAllDescendantTasks(sessionID: string): BackgroundTask[];
76
84
  findBySession(sessionID: string): BackgroundTask | undefined;
85
+ private resolveTaskAttemptBySession;
77
86
  private getConcurrencyKeyFromInput;
78
87
  /**
79
88
  * Track a task created elsewhere (e.g., from task) for notification tracking.