@opengeni/worker-bundle 0.16.29 → 0.20.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.
- package/dist/activities/agent-run-admission.d.ts +12 -0
- package/dist/activities/agent-turn.d.ts +110 -19
- package/dist/activities/api-integrations.d.ts +21 -0
- package/dist/activities/browser-state-artifact-reaper.d.ts +29 -0
- package/dist/activities/capabilities.d.ts +6 -0
- package/dist/activities/codemode-dispatcher.d.ts +35 -0
- package/dist/activities/codemode-token-renewal.d.ts +23 -0
- package/dist/activities/codex-capacity.d.ts +6 -5
- package/dist/activities/codex-image-generation.d.ts +21 -0
- package/dist/activities/context-compaction.d.ts +1 -0
- package/dist/activities/documents.d.ts +3 -2
- package/dist/activities/environment.d.ts +17 -8
- package/dist/activities/expiring-material-renewal.d.ts +1 -1
- package/dist/activities/file-upload-reaper.d.ts +7 -2
- package/dist/activities/gateway-image-generation.d.ts +39 -0
- package/dist/activities/gateway-video-generation.d.ts +53 -0
- package/dist/activities/generated-images.d.ts +112 -0
- package/dist/activities/git-credential-renewal.d.ts +1 -1
- package/dist/activities/goals.d.ts +2 -2
- package/dist/activities/google-drive-changes.d.ts +99 -0
- package/dist/activities/image-generation-operation.d.ts +74 -0
- package/dist/activities/image-generation-references.d.ts +25 -0
- package/dist/activities/knowledge-source-sync-driver.d.ts +23 -0
- package/dist/activities/knowledge-source-sync.d.ts +75 -0
- package/dist/activities/packs.d.ts +21 -36
- package/dist/activities/parent-wake.d.ts +1 -1
- package/dist/activities/retained-screenshot-reaper.d.ts +2 -2
- package/dist/activities/retained-screenshots.d.ts +36 -0
- package/dist/activities/rig-verification.d.ts +82 -5
- package/dist/activities/run-credential-renewal.d.ts +1 -1
- package/dist/activities/run-input.d.ts +3 -1
- package/dist/activities/sandbox-images.d.ts +14 -0
- package/dist/activities/sandbox-lease.d.ts +47 -9
- package/dist/activities/scheduled-tasks.d.ts +2 -2
- package/dist/activities/session-state.d.ts +7 -5
- package/dist/activities/site-auth-maintenance.d.ts +27 -0
- package/dist/activities/streaming.d.ts +1 -1
- package/dist/activities/types.d.ts +87 -5
- package/dist/activities/video-generation-admission.d.ts +43 -0
- package/dist/activities/video-generation-credential.d.ts +24 -0
- package/dist/activities/video-generation-reconciliation.d.ts +13 -0
- package/dist/activities/video-media-validation.d.ts +34 -0
- package/dist/activities/video-output-retention.d.ts +36 -0
- package/dist/activities/video-reference-staging.d.ts +55 -0
- package/dist/activities/workflow-wake.d.ts +2 -2
- package/dist/activities/workspace-capture.d.ts +10 -1
- package/dist/activities/xai-auth.d.ts +23 -0
- package/dist/activities/xai-image-generation.d.ts +26 -0
- package/dist/activities/xai-video-generation.d.ts +18 -0
- package/dist/activities-control-XURE4VKN.js +7221 -0
- package/dist/activities-control-XURE4VKN.js.map +1 -0
- package/dist/activities-control.d.ts +297 -0
- package/dist/activities-turn-6EBXGGLS.js +16036 -0
- package/dist/activities-turn-6EBXGGLS.js.map +1 -0
- package/dist/activities-turn.d.ts +17 -0
- package/dist/activities.d.ts +138 -150
- package/dist/activity-services.d.ts +10 -0
- package/dist/artifact-materializer-entry.d.ts +6 -0
- package/dist/artifact-materializer-entry.js +2662 -0
- package/dist/artifact-materializer-entry.js.map +1 -0
- package/dist/artifact-outbox-entry.d.ts +2 -0
- package/dist/artifact-outbox-entry.js +681 -0
- package/dist/artifact-outbox-entry.js.map +1 -0
- package/dist/chunk-5GRJIP5H.js +3092 -0
- package/dist/chunk-5GRJIP5H.js.map +1 -0
- package/dist/chunk-GRFQTTSQ.js +448 -0
- package/dist/chunk-GRFQTTSQ.js.map +1 -0
- package/dist/chunk-TYNPCG4U.js +906 -0
- package/dist/chunk-TYNPCG4U.js.map +1 -0
- package/dist/concurrency.d.ts +108 -5
- package/dist/editable-artifact-hint-broker.d.ts +49 -0
- package/dist/editable-artifact-materializer-launcher.d.ts +49 -0
- package/dist/editable-artifact-materializer-service.d.ts +108 -0
- package/dist/editable-artifact-materializer-storage.d.ts +12 -0
- package/dist/editable-artifact-materializer-subprocess.d.ts +50 -0
- package/dist/editable-artifact-materializer.d.ts +262 -0
- package/dist/editable-artifact-outbox-dispatcher.d.ts +44 -0
- package/dist/editable-artifact-outbox-service.d.ts +70 -0
- package/dist/host-export.d.ts +1 -1
- package/dist/index.d.ts +189 -10
- package/dist/index.js +715 -17380
- package/dist/index.js.map +1 -1
- package/dist/memory-pressure-guard.d.ts +57 -0
- package/dist/model-checkpoint-memory-collector.d.ts +23 -0
- package/dist/model-context-contributions.d.ts +40 -0
- package/dist/observability-metrics.d.ts +53 -1
- package/dist/sandbox-reaper-contract.d.ts +40 -0
- package/dist/sandbox-reaper-timeout.d.ts +14 -0
- package/dist/sandbox-resume.d.ts +34 -7
- package/dist/sandbox-routing.d.ts +6 -0
- package/dist/worker-service-lifecycle.d.ts +6 -2
- package/dist/workflow-bundle.js +1094 -370
- package/dist/workflows/activities.d.ts +8 -2
- package/dist/workflows/document-index.d.ts +1 -1
- package/dist/workflows/knowledge-source-sync.d.ts +13 -0
- package/dist/workflows/rig-verification.d.ts +1 -1
- package/dist/workflows/sandbox-reaper.d.ts +8 -0
- package/dist/workflows/scheduled-tasks.d.ts +1 -1
- package/dist/workflows/session.d.ts +2 -2
- package/dist/workflows/site-auth-maintenance.d.ts +2 -0
- package/dist/workflows/video-generation.d.ts +10 -0
- package/dist/workflows/workflow-wake.d.ts +1 -1
- package/dist/workflows.d.ts +10 -7
- package/package.json +35 -15
- package/src/activities/agent-run-admission.ts +76 -0
- package/src/activities/agent-turn.ts +2600 -340
- package/src/activities/api-integrations.ts +138 -0
- package/src/activities/browser-state-artifact-reaper.ts +120 -0
- package/src/activities/capabilities.ts +10 -0
- package/src/activities/codemode-dispatcher.ts +335 -0
- package/src/activities/codemode-token-renewal.ts +64 -0
- package/src/activities/codex-capacity.ts +54 -7
- package/src/activities/codex-image-generation.ts +56 -0
- package/src/activities/context-compaction.ts +38 -3
- package/src/activities/documents.ts +14 -4
- package/src/activities/environment.ts +54 -45
- package/src/activities/expiring-material-renewal.ts +1 -1
- package/src/activities/file-upload-reaper.ts +34 -3
- package/src/activities/gateway-image-generation.ts +146 -0
- package/src/activities/gateway-video-generation.ts +298 -0
- package/src/activities/generated-images.ts +860 -0
- package/src/activities/goals.ts +8 -3
- package/src/activities/google-drive-changes.ts +454 -0
- package/src/activities/image-generation-operation.ts +333 -0
- package/src/activities/image-generation-references.ts +118 -0
- package/src/activities/knowledge-source-sync-driver.ts +27 -0
- package/src/activities/knowledge-source-sync.ts +2840 -0
- package/src/activities/mcp-credentials.ts +1 -0
- package/src/activities/packs.ts +75 -152
- package/src/activities/parent-wake.ts +13 -1
- package/src/activities/retained-screenshot-reaper.ts +2 -2
- package/src/activities/retained-screenshots.ts +453 -28
- package/src/activities/rig-verification.ts +554 -43
- package/src/activities/run-input.ts +22 -6
- package/src/activities/sandbox-images.ts +167 -0
- package/src/activities/sandbox-lease.ts +1065 -483
- package/src/activities/scheduled-tasks.ts +104 -74
- package/src/activities/session-state.ts +22 -4
- package/src/activities/site-auth-maintenance.ts +269 -0
- package/src/activities/streaming.ts +42 -3
- package/src/activities/types.ts +104 -5
- package/src/activities/video-generation-admission.ts +303 -0
- package/src/activities/video-generation-credential.ts +112 -0
- package/src/activities/video-generation-reconciliation.ts +771 -0
- package/src/activities/video-media-validation.ts +332 -0
- package/src/activities/video-output-retention.ts +314 -0
- package/src/activities/video-reference-staging.ts +350 -0
- package/src/activities/workflow-wake.ts +2 -2
- package/src/activities/workspace-capture.ts +44 -10
- package/src/activities/xai-auth.ts +122 -0
- package/src/activities/xai-image-generation.ts +86 -0
- package/src/activities/xai-video-generation.ts +69 -0
- package/src/activities-control.ts +58 -0
- package/src/activities-turn.ts +40 -0
- package/src/activities.ts +53 -124
- package/src/activity-services.ts +62 -0
- package/src/artifact-materializer-entry.ts +35 -0
- package/src/artifact-outbox-entry.ts +29 -0
- package/src/concurrency.ts +484 -6
- package/src/editable-artifact-hint-broker.ts +235 -0
- package/src/editable-artifact-materializer-launcher.ts +515 -0
- package/src/editable-artifact-materializer-service.ts +787 -0
- package/src/editable-artifact-materializer-storage.ts +413 -0
- package/src/editable-artifact-materializer-subprocess.ts +956 -0
- package/src/editable-artifact-materializer.ts +1289 -0
- package/src/editable-artifact-outbox-dispatcher.ts +244 -0
- package/src/editable-artifact-outbox-service.ts +438 -0
- package/src/index.ts +328 -72
- package/src/memory-pressure-guard.ts +489 -0
- package/src/model-checkpoint-memory-collector.ts +123 -0
- package/src/model-context-contributions.ts +159 -0
- package/src/observability-metrics.ts +297 -13
- package/src/sandbox-reaper-contract.ts +73 -0
- package/src/sandbox-reaper-timeout.ts +79 -0
- package/src/sandbox-resume.ts +294 -153
- package/src/sandbox-routing.ts +32 -24
- package/src/worker-service-lifecycle.ts +80 -14
- package/src/workflows/activities.ts +31 -0
- package/src/workflows/file-upload-reaper.ts +9 -1
- package/src/workflows/knowledge-source-sync.ts +83 -0
- package/src/workflows/sandbox-reaper.ts +183 -21
- package/src/workflows/scheduled-tasks.ts +42 -6
- package/src/workflows/session.ts +20 -6
- package/src/workflows/site-auth-maintenance.ts +14 -0
- package/src/workflows/video-generation.ts +36 -0
- package/src/workflows.ts +18 -1
- package/dist/activities/toolspace-token-renewal.d.ts +0 -23
- package/src/activities/toolspace-token-renewal.ts +0 -64
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "@opengeni/contracts";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
getActiveSessionHistoryItemsPaged,
|
|
11
11
|
getFiles,
|
|
12
12
|
getLatestRunState,
|
|
13
13
|
getHumanInputResumeForEvent,
|
|
@@ -80,9 +80,11 @@ export type TurnInputOptions = {
|
|
|
80
80
|
unavailableSandboxFilesNote?: string;
|
|
81
81
|
runCredentialsNote?: string;
|
|
82
82
|
providerApi: HistoryProviderApi;
|
|
83
|
+
projectCanonicalHistory?: ModelHistoryAttachmentProjector;
|
|
83
84
|
materializeModelHistory?: ModelHistoryAttachmentProjector;
|
|
84
85
|
materializeSerializedRunState?: (serialized: string) => Promise<string>;
|
|
85
86
|
projectModelHistory?: ModelHistoryAttachmentProjector;
|
|
87
|
+
loadActiveHistory?: typeof getActiveSessionHistoryItemsPaged;
|
|
86
88
|
};
|
|
87
89
|
|
|
88
90
|
export const MAX_INLINE_MODEL_ATTACHMENT_BYTES = 20 * 1024 * 1024;
|
|
@@ -401,9 +403,14 @@ export async function turnInput(
|
|
|
401
403
|
options.runCredentialsNote,
|
|
402
404
|
);
|
|
403
405
|
if (trigger.type === "user.message") {
|
|
404
|
-
const payload = trigger.payload as {
|
|
405
|
-
|
|
406
|
-
|
|
406
|
+
const payload = trigger.payload as {
|
|
407
|
+
text?: unknown;
|
|
408
|
+
annotations?: unknown;
|
|
409
|
+
resources?: unknown;
|
|
410
|
+
};
|
|
411
|
+
const hasAnnotations = Array.isArray(payload.annotations) && payload.annotations.length > 0;
|
|
412
|
+
if (typeof payload.text !== "string" || (payload.text.trim().length === 0 && !hasAnnotations)) {
|
|
413
|
+
throw new Error("user.message payload is missing text and annotations");
|
|
407
414
|
}
|
|
408
415
|
const resources = Array.isArray(payload.resources) ? (payload.resources as ResourceRef[]) : [];
|
|
409
416
|
const fileAttachments = await resolveUserMessageFileAttachments(
|
|
@@ -421,8 +428,10 @@ export async function turnInput(
|
|
|
421
428
|
joinInternalContext(internalContext, attachmentContext),
|
|
422
429
|
fileAttachments.map((attachment) => attachment.resource),
|
|
423
430
|
options.providerApi,
|
|
431
|
+
options.projectCanonicalHistory,
|
|
424
432
|
options.materializeModelHistory,
|
|
425
433
|
options.projectModelHistory,
|
|
434
|
+
options.loadActiveHistory,
|
|
426
435
|
);
|
|
427
436
|
}
|
|
428
437
|
if (trigger.type === "system.update.delivered") {
|
|
@@ -438,8 +447,10 @@ export async function turnInput(
|
|
|
438
447
|
internalContext,
|
|
439
448
|
[],
|
|
440
449
|
options.providerApi,
|
|
450
|
+
options.projectCanonicalHistory,
|
|
441
451
|
options.materializeModelHistory,
|
|
442
452
|
options.projectModelHistory,
|
|
453
|
+
options.loadActiveHistory,
|
|
443
454
|
);
|
|
444
455
|
}
|
|
445
456
|
if (trigger.type === "user.approvalDecision") {
|
|
@@ -521,13 +532,18 @@ async function messageInput(
|
|
|
521
532
|
internalContext: string | undefined,
|
|
522
533
|
currentAttachmentRefs: FileResourceRef[] = [],
|
|
523
534
|
providerApi: HistoryProviderApi = "responses",
|
|
535
|
+
projectCanonicalHistory?: ModelHistoryAttachmentProjector,
|
|
524
536
|
materializeModelHistory?: ModelHistoryAttachmentProjector,
|
|
525
537
|
projectModelHistory?: ModelHistoryAttachmentProjector,
|
|
538
|
+
loadActiveHistory: typeof getActiveSessionHistoryItemsPaged = getActiveSessionHistoryItemsPaged,
|
|
526
539
|
): Promise<PreparedTurnInput> {
|
|
527
|
-
const stored = await
|
|
540
|
+
const stored = await loadActiveHistory(db, trigger.workspaceId, trigger.sessionId);
|
|
528
541
|
const envelope = await getSandboxSessionEnvelope(db, trigger.workspaceId, trigger.sessionId);
|
|
529
542
|
const canonicalView = projectRejectedProviderArtifacts(stored);
|
|
530
|
-
const
|
|
543
|
+
const canonicalProviderView = projectCanonicalHistory
|
|
544
|
+
? await projectCanonicalHistory(canonicalView)
|
|
545
|
+
: canonicalView;
|
|
546
|
+
const providerView = projectHistoryForProvider(canonicalProviderView, providerApi);
|
|
531
547
|
const referencedHistory = withCurrentUserAttachmentRefs(providerView, currentAttachmentRefs);
|
|
532
548
|
const materializedHistory = materializeModelHistory
|
|
533
549
|
? await materializeModelHistory(referencedHistory)
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { Settings } from "@opengeni/config";
|
|
2
|
+
import type { CapabilityPack, RigVersion, SandboxBackend } from "@opengeni/contracts";
|
|
3
|
+
import {
|
|
4
|
+
rigProviderImageContentHash,
|
|
5
|
+
rigProviderImageMatchesDefinition,
|
|
6
|
+
rigProviderImageProviderBindingKeyHash,
|
|
7
|
+
} from "@opengeni/core";
|
|
8
|
+
import { resolveModalCheckpointProviderBinding } from "@opengeni/runtime/sandbox";
|
|
9
|
+
|
|
10
|
+
export function settingsWithPackSandboxImage(
|
|
11
|
+
settings: Settings,
|
|
12
|
+
sandboxImage: string | null,
|
|
13
|
+
sandboxProviderImages: CapabilityPack["sandboxProviderImages"] | null = null,
|
|
14
|
+
): Settings {
|
|
15
|
+
if (!sandboxImage) return settings;
|
|
16
|
+
return {
|
|
17
|
+
...settings,
|
|
18
|
+
dockerImage: sandboxImage,
|
|
19
|
+
modalImageRef: sandboxImage,
|
|
20
|
+
modalImageId: sandboxProviderImages?.modal?.imageId,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function settingsWithRigImage(settings: Settings, rigImage: string | null): Settings {
|
|
25
|
+
if (!rigImage) return settings;
|
|
26
|
+
return {
|
|
27
|
+
...settings,
|
|
28
|
+
dockerImage: rigImage,
|
|
29
|
+
modalImageRef: rigImage,
|
|
30
|
+
// A logical rig image invalidates a lower-precedence pack/deployment
|
|
31
|
+
// provider ID. A verified version-bound provider ID is applied separately
|
|
32
|
+
// after this precedence step.
|
|
33
|
+
modalImageId: undefined,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function rigProviderImageSourceImage(
|
|
38
|
+
settings: Settings,
|
|
39
|
+
backend: SandboxBackend,
|
|
40
|
+
): string | null {
|
|
41
|
+
if (backend === "modal") return settings.modalImageId ?? settings.modalImageRef ?? null;
|
|
42
|
+
if (backend === "docker") return settings.dockerImage ?? null;
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type RigProviderImageSelectionReason =
|
|
47
|
+
| "selected"
|
|
48
|
+
| "missing"
|
|
49
|
+
| "provider_unsupported"
|
|
50
|
+
| "not_ready"
|
|
51
|
+
| "not_cold_boot_validated"
|
|
52
|
+
| "content_mismatch"
|
|
53
|
+
| "provider_binding_unavailable"
|
|
54
|
+
| "provider_binding_mismatch";
|
|
55
|
+
|
|
56
|
+
export function resolveRigProviderImageSelection(
|
|
57
|
+
settings: Settings,
|
|
58
|
+
version: RigVersion | null,
|
|
59
|
+
backend: SandboxBackend,
|
|
60
|
+
currentProviderBindingKeyHash: string | null,
|
|
61
|
+
): {
|
|
62
|
+
settings: Settings;
|
|
63
|
+
reason: RigProviderImageSelectionReason;
|
|
64
|
+
contentHash: string | null;
|
|
65
|
+
imageId: string | null;
|
|
66
|
+
} {
|
|
67
|
+
if (!version) {
|
|
68
|
+
return { settings, reason: "missing", contentHash: null, imageId: null };
|
|
69
|
+
}
|
|
70
|
+
if (backend !== "modal") {
|
|
71
|
+
return { settings, reason: "provider_unsupported", contentHash: null, imageId: null };
|
|
72
|
+
}
|
|
73
|
+
const image = version.providerImages[backend];
|
|
74
|
+
if (!image) {
|
|
75
|
+
return { settings, reason: "missing", contentHash: null, imageId: null };
|
|
76
|
+
}
|
|
77
|
+
if (image.status !== "ready" || !image.imageId) {
|
|
78
|
+
return {
|
|
79
|
+
settings,
|
|
80
|
+
reason: "not_ready",
|
|
81
|
+
contentHash: image.contentHash,
|
|
82
|
+
imageId: image.imageId,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (image.coldBootValidation?.version !== 1) {
|
|
86
|
+
return {
|
|
87
|
+
settings,
|
|
88
|
+
reason: "not_cold_boot_validated",
|
|
89
|
+
contentHash: image.contentHash,
|
|
90
|
+
imageId: null,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const sourceImage = rigProviderImageSourceImage(settings, backend);
|
|
94
|
+
const expectedContentHash = rigProviderImageContentHash({
|
|
95
|
+
backend,
|
|
96
|
+
sourceImage,
|
|
97
|
+
definition: version,
|
|
98
|
+
});
|
|
99
|
+
if (
|
|
100
|
+
image.sourceImage !== sourceImage ||
|
|
101
|
+
image.contentHash !== expectedContentHash ||
|
|
102
|
+
!rigProviderImageMatchesDefinition(image, version)
|
|
103
|
+
) {
|
|
104
|
+
return {
|
|
105
|
+
settings,
|
|
106
|
+
reason: "content_mismatch",
|
|
107
|
+
contentHash: expectedContentHash,
|
|
108
|
+
imageId: null,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (!image.providerBindingKeyHash || !currentProviderBindingKeyHash) {
|
|
112
|
+
return {
|
|
113
|
+
settings,
|
|
114
|
+
reason: "provider_binding_unavailable",
|
|
115
|
+
contentHash: expectedContentHash,
|
|
116
|
+
imageId: null,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (image.providerBindingKeyHash !== currentProviderBindingKeyHash) {
|
|
120
|
+
return {
|
|
121
|
+
settings,
|
|
122
|
+
reason: "provider_binding_mismatch",
|
|
123
|
+
contentHash: expectedContentHash,
|
|
124
|
+
imageId: null,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
// Keep modalImageRef unchanged: the lease continues to fence the logical
|
|
129
|
+
// rig/pack/deployment image, so a newly available build optimization never
|
|
130
|
+
// rotates an already-warm or archive-backed box. modalImageId affects only
|
|
131
|
+
// genuinely fresh provider creation.
|
|
132
|
+
settings: { ...settings, modalImageId: image.imageId },
|
|
133
|
+
reason: "selected",
|
|
134
|
+
contentHash: expectedContentHash,
|
|
135
|
+
imageId: image.imageId,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export async function settingsWithRigProviderImage(
|
|
140
|
+
settings: Settings,
|
|
141
|
+
version: RigVersion | null,
|
|
142
|
+
backend: SandboxBackend,
|
|
143
|
+
resolveBinding: typeof resolveModalCheckpointProviderBinding = resolveModalCheckpointProviderBinding,
|
|
144
|
+
): Promise<Settings> {
|
|
145
|
+
const image = backend === "modal" ? version?.providerImages.modal : null;
|
|
146
|
+
if (image?.status !== "ready" || !image.providerBindingKeyHash) {
|
|
147
|
+
return resolveRigProviderImageSelection(settings, version, backend, null).settings;
|
|
148
|
+
}
|
|
149
|
+
const structural = resolveRigProviderImageSelection(
|
|
150
|
+
settings,
|
|
151
|
+
version,
|
|
152
|
+
backend,
|
|
153
|
+
image.providerBindingKeyHash,
|
|
154
|
+
);
|
|
155
|
+
if (structural.reason !== "selected") return structural.settings;
|
|
156
|
+
let currentProviderBindingKeyHash: string | null = null;
|
|
157
|
+
try {
|
|
158
|
+
const binding = await resolveBinding(settings);
|
|
159
|
+
currentProviderBindingKeyHash = rigProviderImageProviderBindingKeyHash(binding.key);
|
|
160
|
+
} catch {
|
|
161
|
+
// Provider identity is an authority check, not a reason to fail the turn.
|
|
162
|
+
// Preserve the logical image so fresh creation and runtime setup remain the
|
|
163
|
+
// truthful fallback when the identity lookup is unavailable.
|
|
164
|
+
}
|
|
165
|
+
return resolveRigProviderImageSelection(settings, version, backend, currentProviderBindingKeyHash)
|
|
166
|
+
.settings;
|
|
167
|
+
}
|