@opengeni/worker-bundle 0.2.1 → 0.2.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.
package/dist/index.d.ts CHANGED
@@ -187,6 +187,7 @@ type WorkerOptions = {
187
187
  settings?: Settings;
188
188
  activities?: ReturnType<typeof createActivities>;
189
189
  activityDependencies?: ActivityDependencies;
190
+ workflowsPath?: string;
190
191
  };
191
192
  declare function createOpenGeniWorker(options?: WorkerOptions): Promise<{
192
193
  worker: Worker;
package/dist/index.js CHANGED
@@ -1689,6 +1689,18 @@ async function resolveActiveSandboxBackend(routingOn, loadPointer, loadSandboxKi
1689
1689
  function shouldStartOnTurnRecording(params) {
1690
1690
  return params.recordingEnabled && params.desktopEnabled && desktopCapableBackend2(params.establishedBackendId) && params.effectiveBackend !== "selfhosted";
1691
1691
  }
1692
+ function computerToolModeForTurn(resolvedModel) {
1693
+ if (!resolvedModel) {
1694
+ return "hosted";
1695
+ }
1696
+ if (resolvedModel.provider.kind === "codex-subscription") {
1697
+ return "function-image";
1698
+ }
1699
+ if (resolvedModel.provider.api === "chat") {
1700
+ return "function-text";
1701
+ }
1702
+ return "hosted";
1703
+ }
1692
1704
  async function refreshCappedCodexUsageRows(db, settings, workspaceId, accounts) {
1693
1705
  const nearPct = settings.codexRotationNearExhaustionPct;
1694
1706
  const stale = accounts.filter(
@@ -2193,8 +2205,13 @@ function createRunAgentTurnActivity(services) {
2193
2205
  // (built-in OpenAI/Azure = real hosted support; registry "chat"
2194
2206
  // providers = the SDK's own ChatCompletions detection) keeps the SDK
2195
2207
  // default.
2196
- structuredToolTransport: resolvedModel.provider.kind !== "codex-subscription"
2197
- } : {},
2208
+ structuredToolTransport: resolvedModel.provider.kind !== "codex-subscription",
2209
+ // EXPLICIT computer-use tool transport, derived from the resolved provider's
2210
+ // authoritative wire identity (codex → function-image, chat → function-text,
2211
+ // responses → hosted) so the runtime never string-sniffs the model instance's
2212
+ // constructor name. See {@link computerToolModeForTurn}.
2213
+ computerToolMode: computerToolModeForTurn(resolvedModel)
2214
+ } : { computerToolMode: computerToolModeForTurn(null) },
2198
2215
  ...packRuntime.skills.length > 0 ? { packSkills: packRuntime.skills } : {},
2199
2216
  ...workspaceAgentInstructions ? { instructionsTemplate: workspaceAgentInstructions } : {},
2200
2217
  ...workspaceEnvironment ? {
@@ -3853,7 +3870,7 @@ async function createOpenGeniWorker(options = {}) {
3853
3870
  connection,
3854
3871
  namespace: settings.temporalNamespace,
3855
3872
  taskQueue: settings.temporalTaskQueue,
3856
- workflowsPath: new URL("../src/workflows.ts", import.meta.url).pathname,
3873
+ workflowsPath: options.workflowsPath ?? new URL("../src/workflows.ts", import.meta.url).pathname,
3857
3874
  activities
3858
3875
  });
3859
3876
  return { worker, connection };