@opengeni/worker-bundle 0.2.0 → 0.2.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/index.js CHANGED
@@ -1686,6 +1686,9 @@ async function resolveActiveSandboxBackend(routingOn, loadPointer, loadSandboxKi
1686
1686
  return void 0;
1687
1687
  }
1688
1688
  }
1689
+ function shouldStartOnTurnRecording(params) {
1690
+ return params.recordingEnabled && params.desktopEnabled && desktopCapableBackend2(params.establishedBackendId) && params.effectiveBackend !== "selfhosted";
1691
+ }
1689
1692
  async function refreshCappedCodexUsageRows(db, settings, workspaceId, accounts) {
1690
1693
  const nearPct = settings.codexRotationNearExhaustionPct;
1691
1694
  const stale = accounts.filter(
@@ -2102,7 +2105,15 @@ function createRunAgentTurnActivity(services) {
2102
2105
  leaseHeartbeatTimer.unref();
2103
2106
  }
2104
2107
  }
2105
- if (resolvedSandbox && settings.sandboxDesktopEnabled && settings.recordingEnabled && desktopCapableBackend2(resolvedSandbox.established.backendId)) {
2108
+ if (resolvedSandbox && shouldStartOnTurnRecording({
2109
+ recordingEnabled: settings.recordingEnabled,
2110
+ desktopEnabled: settings.sandboxDesktopEnabled,
2111
+ establishedBackendId: resolvedSandbox.established.backendId,
2112
+ // EFFECTIVE (active) backend, not the session home: a machine-primary turn
2113
+ // resolves to "selfhosted" and skips; a swap back to the cloud group box
2114
+ // resolves to undefined and records as before.
2115
+ effectiveBackend: activeSandboxBackend
2116
+ })) {
2106
2117
  try {
2107
2118
  const begun = await beginRecording({
2108
2119
  settings,