@opengeni/runtime 4.3.0-canary.36855269964001 → 4.3.0

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 (51) hide show
  1. package/dist/assets/codemode-client.json +1 -1
  2. package/dist/{chunk-PEEYZDLS.js → chunk-22M75RJF.js} +622 -890
  3. package/dist/chunk-22M75RJF.js.map +1 -0
  4. package/dist/{chunk-BK3S65CI.js → chunk-JUFVYQCY.js} +13 -91
  5. package/dist/chunk-JUFVYQCY.js.map +1 -0
  6. package/dist/claude-subscription-usage.d.ts +1 -3
  7. package/dist/index.d.ts +1 -7
  8. package/dist/index.js +2 -8
  9. package/dist/input-wait-yield.d.ts +0 -4
  10. package/dist/mcp-run-credentials.d.ts +2 -3
  11. package/dist/model-preparation-diagnostics.d.ts +0 -9
  12. package/dist/model-provider-routing.d.ts +0 -4
  13. package/dist/model-provider.d.ts +0 -1
  14. package/dist/model-request-capture.d.ts +0 -9
  15. package/dist/replayable-json-body.d.ts +1 -2
  16. package/dist/sandbox/index.d.ts +1 -1
  17. package/dist/sandbox/index.js +1 -3
  18. package/dist/sandbox/provider-command-session.d.ts +0 -6
  19. package/dist/sandbox/providers/modal-command-router-wire.d.ts +0 -5
  20. package/dist/sandbox/routing/routing-session.d.ts +4 -5
  21. package/dist/workspace-tool-gateway.js +2 -2
  22. package/package.json +12 -12
  23. package/src/bundled_default_skills/opengeni-client/SKILL.md +0 -5
  24. package/src/bundled_default_skills/opengeni-client/references/api-workflows.md +0 -8
  25. package/src/bundled_default_skills/opengeni-client/references/product-shapes-and-ui.md +3 -16
  26. package/src/claude-subscription-usage.ts +4 -23
  27. package/src/index.ts +2 -29
  28. package/src/input-wait-yield.ts +0 -7
  29. package/src/interaction-tools.ts +2 -12
  30. package/src/lazy-tool-transport.ts +14 -22
  31. package/src/mcp-run-credentials.ts +3 -18
  32. package/src/model-preparation-diagnostics.ts +1 -48
  33. package/src/model-provider-client.ts +1 -5
  34. package/src/model-provider-routing.ts +1 -95
  35. package/src/model-provider.ts +0 -1
  36. package/src/model-request-capture.ts +1 -28
  37. package/src/provider-history-adapter.ts +3 -24
  38. package/src/replayable-json-body.ts +2 -19
  39. package/src/sandbox/index.ts +0 -1
  40. package/src/sandbox/provider-command-session.ts +0 -12
  41. package/src/sandbox/providers/modal-command-control.ts +8 -14
  42. package/src/sandbox/providers/modal-command-router-wire.ts +3 -20
  43. package/src/sandbox/providers/modal-command-session.ts +0 -11
  44. package/src/sandbox/providers/modal.ts +1 -5
  45. package/src/sandbox/routing/routing-session.ts +6 -61
  46. package/src/sandbox/turn-tool-cancellation.ts +1 -8
  47. package/dist/chunk-BK3S65CI.js.map +0 -1
  48. package/dist/chunk-PEEYZDLS.js.map +0 -1
  49. package/dist/responses-terminal-error.d.ts +0 -17
  50. package/src/bundled_default_skills/opengeni-client/references/usage-allowances.md +0 -189
  51. package/src/responses-terminal-error.ts +0 -136
@@ -30,17 +30,13 @@
30
30
  import { SandboxWorkspaceReadNotFoundError } from "@openai/agents/sandbox";
31
31
  import { SandboxFilesystemNotFoundError } from "modal";
32
32
  import type { ExposedPortEndpoint } from "../stream-port";
33
- import {
34
- ModalCommandStartPreDispatchUnavailableError,
35
- ModalCommandStartNotDispatchedError,
36
- } from "../providers/modal-command-router-wire";
33
+ import { ModalCommandStartPreDispatchUnavailableError } from "../providers/modal-command-router-wire";
37
34
  import { isDeepStrictEqual } from "node:util";
38
35
  import {
39
36
  withProviderCommandHandle,
40
37
  withCommandSupervisionReady,
41
38
  withSupervisedLaunchReservation,
42
39
  ProviderCommandStartRejectedError,
43
- ProviderCommandStartOutcomeUnknownError,
44
40
  type ProviderCommandPersistence,
45
41
  type ProviderCommandSession,
46
42
  } from "../provider-command-session";
@@ -251,11 +247,11 @@ export interface RoutingSandboxSessionDeps {
251
247
  op: string;
252
248
  backend: ResolvedActiveBackend;
253
249
  admission: unknown;
254
- outcome: "resolved" | "rejected" | "outcome_unknown";
255
- /** Provider result for a resolved call. Absent when Start is unknown. */
250
+ outcome: "resolved" | "rejected";
251
+ /** Provider result for a resolved call. Never present for rejection. */
256
252
  result?: unknown;
257
- /** Exact candidate for a yielded process or a client-chosen unknown Start.
258
- * Unknown Start settlement retains this writer; it does not prove exit. */
253
+ /** Stable candidate generated before durable promotion is attempted. It is
254
+ * supplied only when the provider returned a positive yielded-session id. */
259
255
  retainedProcess?: RoutingRetainedProcess;
260
256
  }) => Promise<void | RoutingMutationSettlementResult>;
261
257
  /** Admit one model/user-visible stdin mutation under the already-durable
@@ -525,15 +521,6 @@ export class RoutingRetainedProcessNotFoundError extends Error {
525
521
  }
526
522
  }
527
523
 
528
- export function renderRoutingMutationOutcomeUnknownToolResult(
529
- error: RoutingMutationOutcomeUnknownError,
530
- ): string {
531
- const locator = error.retainedProcess
532
- ? ` Inspect the exact invocation with write_stdin using session_id ${error.retainedProcess.providerSessionId} and empty chars.`
533
- : " Inspect state before deciding how to proceed.";
534
- return `Sandbox operation outcome unknown; the operation was not replayed. Do not blindly retry the command.${locator} Error: ${error}`;
535
- }
536
-
537
524
  type PendingParentPromotion = Parameters<
538
525
  NonNullable<RoutingSandboxSessionDeps["afterMutation"]>
539
526
  >[0];
@@ -1083,8 +1070,7 @@ export class RoutingSandboxSession implements RoutableBackendSession {
1083
1070
  { cause: error },
1084
1071
  );
1085
1072
  }
1086
- if (pending.result !== undefined)
1087
- await this.captureRetainedOutput(record, formatExecResult(pending.result));
1073
+ await this.captureRetainedOutput(record, formatExecResult(pending.result));
1088
1074
  }
1089
1075
 
1090
1076
  private confirmDurableRejectedPromotion(
@@ -1724,50 +1710,9 @@ export class RoutingSandboxSession implements RoutableBackendSession {
1724
1710
  );
1725
1711
  }
1726
1712
  } catch (error) {
1727
- if (
1728
- !reservedProcess &&
1729
- error instanceof ProviderCommandStartOutcomeUnknownError &&
1730
- mutatesWorkspace &&
1731
- this.deps.afterMutation
1732
- ) {
1733
- const handle = this.deps.providerCommandHandle?.(admission);
1734
- if (!handle) throw error;
1735
- const process: RoutingRetainedProcess = {
1736
- id: crypto.randomUUID(),
1737
- providerSessionId: handle,
1738
- providerCommand: error.command,
1739
- };
1740
- const record = this.registerRetainedProcess(process, backend);
1741
- const settlement: PendingParentPromotion = {
1742
- op,
1743
- backend,
1744
- admission,
1745
- outcome: "outcome_unknown",
1746
- retainedProcess: process,
1747
- };
1748
- record.pendingParentPromotion = settlement;
1749
- try {
1750
- const rejected = await this.deps.afterMutation(settlement);
1751
- if (rejected) this.confirmDurableRejectedPromotion(record, rejected);
1752
- else record.durable = true;
1753
- record.pendingParentPromotion = null;
1754
- } catch (cause) {
1755
- throw new RoutingMutationOutcomeUnknownError(
1756
- op,
1757
- "Command Start outcome is unknown and exact invocation promotion remains unresolved; it was not replayed",
1758
- { cause: new AggregateError([error, cause]), retainedProcess: process },
1759
- );
1760
- }
1761
- throw new RoutingMutationOutcomeUnknownError(
1762
- op,
1763
- "Command Start outcome is unknown; its exact invocation is retained and was not replayed",
1764
- { cause: error, retainedProcess: process },
1765
- );
1766
- }
1767
1713
  if (reservedProcess) {
1768
1714
  if (
1769
1715
  (error instanceof ProviderCommandStartRejectedError ||
1770
- error instanceof ModalCommandStartNotDispatchedError ||
1771
1716
  error instanceof ModalCommandStartPreDispatchUnavailableError) &&
1772
1717
  reservedProcess.providerCommand?.kind === "modal-router-v1"
1773
1718
  ) {
@@ -5,10 +5,7 @@ import {
5
5
  parseExecBannerExitCode,
6
6
  parseExecBannerSessionId,
7
7
  } from "./exec-banner";
8
- import {
9
- RoutingMutationOutcomeUnknownError,
10
- renderRoutingMutationOutcomeUnknownToolResult,
11
- } from "./routing/routing-session";
8
+ import { RoutingMutationOutcomeUnknownError } from "./routing/routing-session";
12
9
  import { sendCommandInput } from "./command-input";
13
10
  import {
14
11
  withPendingCommandSupervision,
@@ -636,8 +633,6 @@ export function renderDirectToolFault(error: unknown, retainedProcessSessionId?:
636
633
  } catch {
637
634
  // A hostile error Proxy must not replace the original safe fault renderer.
638
635
  }
639
- if (error instanceof RoutingMutationOutcomeUnknownError)
640
- return renderRoutingMutationOutcomeUnknownToolResult(error);
641
636
  const details = error instanceof Error ? error.toString() : String(error);
642
637
  return `An error occurred while running the tool. Please try again. Error: ${details}`;
643
638
  }
@@ -1231,8 +1226,6 @@ class TurnToolCancellationControllerImpl implements TurnToolCancellationControll
1231
1226
  });
1232
1227
  }
1233
1228
  pendingStart?.settle();
1234
- if (error instanceof RoutingMutationOutcomeUnknownError)
1235
- return renderRoutingMutationOutcomeUnknownToolResult(error);
1236
1229
  throw error;
1237
1230
  } finally {
1238
1231
  remoteExec?.settle();