deepline 0.3.504 → 0.3.506
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/bundling-sources/sdk/src/client-core.ts +121 -5
- package/dist/bundling-sources/sdk/src/index.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +5 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/issues.ts +176 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +17 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/overview.ts +118 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +29 -1
- package/dist/bundling-sources/shared_libs/monitors/legacy-radar-retirement.ts +29 -10
- package/dist/bundling-sources/shared_libs/monitors/package.json +4 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +9 -9
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +52 -5
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +48 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +157 -47
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +36 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-gateway-egress.ts +55 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +66 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +18 -0
- package/dist/bundling-sources/shared_libs/product-notifications/onboarding-unsubscribe.ts +23 -0
- package/dist/cli/auth-MMHG2OFE.js +43 -0
- package/dist/cli/{auth-3L5AA5AX.mjs → auth-ZHFONT2D.mjs} +5 -5
- package/dist/cli/{billing-HOGXVE2V.js → billing-3Z7N4WTL.js} +101 -91
- package/dist/cli/{billing-E7EASVPO.mjs → billing-B2YEMNHE.mjs} +27 -17
- package/dist/cli/{chunk-UXQQPMYO.js → chunk-26DJ4BDY.js} +2 -2
- package/dist/cli/{chunk-3MLFFWDM.mjs → chunk-2CFTDVEP.mjs} +2 -2
- package/dist/cli/{chunk-QOLX2O2S.mjs → chunk-2IXXB7OA.mjs} +93 -34
- package/dist/cli/{chunk-6JNBMTCZ.js → chunk-2OY5DXTC.js} +1 -1
- package/dist/cli/{chunk-SVFTZTCI.mjs → chunk-3BFZEHBH.mjs} +1 -1
- package/dist/cli/{chunk-67OI26OE.js → chunk-3F676QXJ.js} +96 -37
- package/dist/cli/{chunk-KCKAFTPY.js → chunk-5ARG7J7A.js} +6 -6
- package/dist/cli/{chunk-5CHBIJIM.mjs → chunk-6RYVIZRP.mjs} +2 -2
- package/dist/cli/{chunk-QKKU2FH4.js → chunk-75NAFY36.js} +7 -7
- package/dist/cli/{chunk-7P2QVMBP.js → chunk-AD2WJUZA.js} +91 -48
- package/dist/cli/{chunk-UFYJTRSF.mjs → chunk-AFSYNOG4.mjs} +42 -7
- package/dist/cli/{chunk-VJVJWZ6I.mjs → chunk-BJ5OX62J.mjs} +5 -5
- package/dist/cli/{chunk-HUX5DZO6.mjs → chunk-BQBPVUFJ.mjs} +3 -3
- package/dist/cli/{chunk-MLMWM5DV.mjs → chunk-CHGRURBN.mjs} +5 -5
- package/dist/cli/{chunk-22OCKCYS.mjs → chunk-D7OCORZ7.mjs} +1 -1
- package/dist/cli/{chunk-SMSQVRHE.js → chunk-DB54ROPH.js} +5 -5
- package/dist/cli/{chunk-KGUGNEKL.js → chunk-E554XCJI.js} +96 -96
- package/dist/cli/{chunk-GGBXNQCR.mjs → chunk-EN7GXLFX.mjs} +4 -4
- package/dist/cli/{chunk-2W77YCKH.js → chunk-F53SGS3C.js} +5 -5
- package/dist/cli/{chunk-6SMR7LU7.js → chunk-F7IQQYKV.js} +2 -2
- package/dist/cli/chunk-FFGQR5J3.mjs +405 -0
- package/dist/cli/{chunk-UJMBG5JU.js → chunk-FWSEGIT6.js} +4 -4
- package/dist/cli/{chunk-GJ2DA35C.js → chunk-GDHLL5EQ.js} +42 -7
- package/dist/cli/{chunk-XHZSPMNC.mjs → chunk-GJNIC2CO.mjs} +84 -441
- package/dist/cli/chunk-GRESJ3H3.js +405 -0
- package/dist/cli/{chunk-WZSFIJMG.js → chunk-HINTYT5H.js} +113 -470
- package/dist/cli/{chunk-A6LA42JY.js → chunk-LRSRJJPD.js} +16 -16
- package/dist/cli/{chunk-WBIDPDKJ.js → chunk-MHRR47VQ.js} +3 -3
- package/dist/cli/{chunk-FTRVCIGC.js → chunk-N7G36GXB.js} +26 -26
- package/dist/cli/{chunk-BTWUNKKX.mjs → chunk-ND4WPLTE.mjs} +2 -2
- package/dist/cli/{chunk-NZ7Z7WNM.mjs → chunk-O4DZG4VA.mjs} +2 -2
- package/dist/cli/{chunk-LHXYCZYO.js → chunk-OD6TASBP.js} +8 -8
- package/dist/cli/{chunk-GRAGUYIE.js → chunk-OHNMJ5XQ.js} +41 -41
- package/dist/cli/{chunk-OX2D6BG4.mjs → chunk-ONBXTEFQ.mjs} +46 -3
- package/dist/cli/{chunk-7F4OEHQK.mjs → chunk-OPBXKB57.mjs} +1 -1
- package/dist/cli/{chunk-Y7VEHKID.mjs → chunk-OUGJUM5X.mjs} +6 -6
- package/dist/cli/{chunk-USTJEEND.js → chunk-PRIHD5XS.js} +9 -9
- package/dist/cli/{chunk-IGNQKOWT.mjs → chunk-QAY5AS2H.mjs} +12 -12
- package/dist/cli/{chunk-5Z6EULD5.js → chunk-QP333GFE.js} +7 -7
- package/dist/cli/{chunk-JPR2546F.js → chunk-SUJIVF6L.js} +16 -16
- package/dist/cli/{chunk-DEAJVQEG.mjs → chunk-TEMORCEE.mjs} +1 -1
- package/dist/cli/{chunk-YOQ2NNDO.mjs → chunk-TS4KFQKS.mjs} +1 -1
- package/dist/cli/{chunk-4CC67XH5.mjs → chunk-XUY7WQ2R.mjs} +3 -3
- package/dist/cli/{chunk-Z6FXUDIL.mjs → chunk-YEX6RPUO.mjs} +1 -1
- package/dist/cli/{chunk-MJTK6Q3G.js → chunk-YJKKOSXS.js} +3 -3
- package/dist/cli/{chunk-Y6XKCEPK.mjs → chunk-YVOS5KSG.mjs} +1 -1
- package/dist/cli/{chunk-2ABRDH3B.mjs → chunk-YWZEBPXK.mjs} +2 -2
- package/dist/cli/{chunk-BX45XMXZ.mjs → chunk-Z7EHY2MF.mjs} +2 -2
- package/dist/cli/{chunk-FISP4LCK.js → chunk-ZM5BJ5MP.js} +53 -53
- package/dist/cli/{chunk-IPAMOMGP.js → chunk-ZZDTWVCQ.js} +21 -21
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-2XWGPITO.js → csv-7K7LK63Y.js} +13 -13
- package/dist/cli/{csv-433JEHLQ.mjs → csv-ARHQ54HA.mjs} +4 -4
- package/dist/cli/{db-K747DH43.mjs → db-JBX24NJY.mjs} +6 -6
- package/dist/cli/{db-PJJMD4VH.js → db-V4Z2I6DY.js} +27 -27
- package/dist/cli/describe-AYXVS6DZ.js +50 -0
- package/dist/cli/{describe-VEDDYW4P.mjs → describe-RBDSGSZ7.mjs} +18 -17
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/{executions-JWRX3XCT.mjs → executions-BAZEU63W.mjs} +6 -6
- package/dist/cli/{executions-HM5T72H6.js → executions-XEZKV5QU.js} +8 -8
- package/dist/cli/{feedback-34UG4BO3.js → feedback-LOERESRU.js} +8 -8
- package/dist/cli/{feedback-MNSIA63Y.mjs → feedback-YDSWBHCO.mjs} +4 -4
- package/dist/cli/{git-ZKEOXV3A.mjs → git-4Z3W2CQU.mjs} +5 -5
- package/dist/cli/git-T6WKO7EA.js +25 -0
- package/dist/cli/index.js +146 -148
- package/dist/cli/index.mjs +53 -55
- package/dist/cli/{legacy-noops-YXSI4FVU.js → legacy-noops-4QIQPVE5.js} +8 -8
- package/dist/cli/{legacy-noops-5M4T4ZVT.mjs → legacy-noops-E4HH7S5O.mjs} +5 -5
- package/dist/cli/{monitors-C65OC4AW.mjs → monitors-FPDW5DDM.mjs} +305 -8
- package/dist/cli/{monitors-O25GDOYE.js → monitors-QBHDSDA7.js} +423 -126
- package/dist/cli/{org-2GSPLY2A.js → org-JO4GGSAH.js} +72 -72
- package/dist/cli/{org-ZRMG5NS2.mjs → org-UCDHIHAD.mjs} +6 -6
- package/dist/cli/{pages-TZZUFBRO.mjs → pages-6V52IZXY.mjs} +6 -6
- package/dist/cli/{pages-45DPADK6.js → pages-FJAAXAWO.js} +18 -18
- package/dist/cli/{play-RCGMND6X.js → play-F3AENS6W.js} +317 -316
- package/dist/cli/{play-3D7HH273.mjs → play-MF4DWROJ.mjs} +18 -17
- package/dist/cli/{providers-PSAKV6CJ.mjs → providers-NJJLTECA.mjs} +6 -6
- package/dist/cli/{providers-3N3ECMTY.js → providers-XXOQLPX7.js} +9 -9
- package/dist/cli/{quickstart-6R6AIXM6.js → quickstart-JCE3XGQG.js} +6 -6
- package/dist/cli/{quickstart-2A35SMGC.mjs → quickstart-Z5MSMI7S.mjs} +4 -4
- package/dist/cli/{run-F3TLDGUO.mjs → run-56UGPIRL.mjs} +23 -22
- package/dist/cli/{run-F6ZXTASZ.js → run-X2DNIW3F.js} +41 -40
- package/dist/cli/search-B753RTKC.js +33 -0
- package/dist/cli/{search-CZLCY3D2.mjs → search-SZYI4NBB.mjs} +8 -7
- package/dist/cli/{search-output-R5XDNILW.js → search-output-7UNT6EMP.js} +6 -6
- package/dist/cli/{search-output-MQTSTLN5.mjs → search-output-T35QNZUF.mjs} +4 -4
- package/dist/cli/{secrets-DCJYHDSY.js → secrets-JMUAVIVC.js} +15 -15
- package/dist/cli/{secrets-D3GF4B2Z.mjs → secrets-Q36VC35L.mjs} +6 -6
- package/dist/cli/{sessions-QGEQ2UYZ.mjs → sessions-HG6I3HMY.mjs} +5 -5
- package/dist/cli/{sessions-Z4JYJSDP.js → sessions-SUXU7OM7.js} +6 -6
- package/dist/cli/{settings-UVXXAT4A.js → settings-UIELQ5CV.js} +106 -78
- package/dist/cli/{settings-G7QEXA4N.mjs → settings-Z76XW4KF.mjs} +39 -11
- package/dist/cli/{setup-5I42W7D4.js → setup-2L7H5P2O.js} +50 -49
- package/dist/cli/{setup-QHJU3DUI.mjs → setup-OXNYAOQ4.mjs} +10 -9
- package/dist/cli/skills-DEVXYGYH.js +37 -0
- package/dist/cli/{skills-5LRF4UKX.mjs → skills-XSNLXJGI.mjs} +8 -7
- package/dist/cli/tools-SCGHABDL.js +57 -0
- package/dist/cli/{tools-PUT6STVG.mjs → tools-SUSFAYFH.mjs} +17 -16
- package/dist/cli/update-BSIILGO3.js +35 -0
- package/dist/cli/{update-CJ2GA64X.mjs → update-ENSTG3QO.mjs} +10 -9
- package/dist/cli/{workflow-O67MEBCP.js → workflow-FMBZNY4F.js} +17 -17
- package/dist/cli/{workflow-HVEWRTXD.mjs → workflow-Z33QE6VT.mjs} +7 -7
- package/dist/{client-DYAfJpaN.d.mts → client-BDbouy3Y.d.mts} +1 -1
- package/dist/{client-CIwenMFS.d.ts → client-Cx0420fs.d.ts} +1 -1
- package/dist/{client-core-CRjtyMAI.d.ts → client-core-B4hq0-m2.d.ts} +56 -4
- package/dist/{client-core-DlzP8vEs.d.mts → client-core-CwiVaMZ5.d.mts} +56 -4
- package/dist/{compiler-manifest-DaJrA2KV.d.mts → compiler-manifest-BeURaD5Y.d.mts} +2 -0
- package/dist/{compiler-manifest-DaJrA2KV.d.ts → compiler-manifest-BeURaD5Y.d.ts} +2 -0
- package/dist/{errors-KLga4bLr.d.ts → errors-BoPXPrSy.d.ts} +1 -1
- package/dist/{errors-BKnSYueU.d.mts → errors-kBuT4kGK.d.mts} +1 -1
- package/dist/{index-C5nAZ-VS.d.ts → index-D0crdGM1.d.ts} +1 -1
- package/dist/{index-C-8AFpWy.d.mts → index-DC7oRAAC.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +116 -110
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-UPK4IIIN.js +0 -43
- package/dist/cli/describe-OYS7LZJD.js +0 -49
- package/dist/cli/git-5YQJSJFR.js +0 -25
- package/dist/cli/search-R5VEWJO2.js +0 -32
- package/dist/cli/skills-FB6TV52O.js +0 -36
- package/dist/cli/tools-L2364RPA.js +0 -56
- package/dist/cli/update-ESYJGYVZ.js +0 -34
|
@@ -34,6 +34,10 @@
|
|
|
34
34
|
"./deactivation-reasons": "./deactivation-reasons.ts",
|
|
35
35
|
"./deactivation-reasons.js": "./deactivation-reasons.ts",
|
|
36
36
|
"./fleets/errors": "./fleets/errors.ts",
|
|
37
|
+
"./fleets/issues": "./fleets/issues.ts",
|
|
38
|
+
"./fleets/overview": "./fleets/overview.ts",
|
|
39
|
+
"./fleets/overview.js": "./fleets/overview.ts",
|
|
40
|
+
"./fleets/issues.js": "./fleets/issues.ts",
|
|
37
41
|
"./fleets/errors.js": "./fleets/errors.ts",
|
|
38
42
|
"./fleets/plan": "./fleets/plan.ts",
|
|
39
43
|
"./fleets/plan.js": "./fleets/plan.ts",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"successDefinition": "Snapshots are complete, marts validate, and the versioned serving pointer advances atomically.",
|
|
104
104
|
"failureDefinition": "A snapshot, dbt/mart validation, artifact, or pointer publish fails.",
|
|
105
105
|
"startGraceMs": 600000,
|
|
106
|
-
"runTimeoutMs":
|
|
106
|
+
"runTimeoutMs": 10800000,
|
|
107
107
|
"failureAlert": "github_workflow_run",
|
|
108
108
|
"domainReportRequired": true
|
|
109
109
|
},
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
"id": "github.log-triage",
|
|
332
332
|
"name": "Scheduled Log Triage",
|
|
333
333
|
"scheduler": "github_actions",
|
|
334
|
-
"cadence": "29 */
|
|
334
|
+
"cadence": "29 */2 * * 1-5;29 */6 * * 0,6",
|
|
335
335
|
"timezone": "UTC",
|
|
336
336
|
"source": ".github/workflows/log-triage-scheduled.yml",
|
|
337
337
|
"locator": "schedule:",
|
|
@@ -422,8 +422,8 @@
|
|
|
422
422
|
"id": "github.provider-dashboard",
|
|
423
423
|
"name": "Tool health dashboard nightly",
|
|
424
424
|
"scheduler": "github_actions",
|
|
425
|
-
"cadence": "0 14
|
|
426
|
-
"timezone": "
|
|
425
|
+
"cadence": "0 14 * * *;0 15 * * *",
|
|
426
|
+
"timezone": "UTC",
|
|
427
427
|
"source": ".github/workflows/provider-dashboard-nightly.yml",
|
|
428
428
|
"locator": "schedule:",
|
|
429
429
|
"owner": "integrations",
|
|
@@ -554,15 +554,15 @@
|
|
|
554
554
|
"id": "github.runtime-latency-daily",
|
|
555
555
|
"name": "Daily Runtime Latency Budgets",
|
|
556
556
|
"scheduler": "github_actions",
|
|
557
|
-
"cadence": "0 5 * * *",
|
|
557
|
+
"cadence": "0 5 * * *;0 3 * * *",
|
|
558
558
|
"timezone": "America/New_York",
|
|
559
559
|
"source": ".github/workflows/runtime-latency-daily.yml",
|
|
560
560
|
"locator": "schedule:",
|
|
561
561
|
"owner": "runtime",
|
|
562
562
|
"criticality": "operational",
|
|
563
|
-
"purpose": "Run the
|
|
564
|
-
"successDefinition": "
|
|
565
|
-
"failureDefinition": "Target preparation, the
|
|
563
|
+
"purpose": "Run the runtime latency budgets that left the PR gate at 05:00 and the billing load proofs at 03:00 against a fresh exact-SHA Preview of main, and retain their timings.",
|
|
564
|
+
"successDefinition": "Every scenario in the run's plan meets its budget or assertions and the Preview target is settled, released, and scaled to zero.",
|
|
565
|
+
"failureDefinition": "Target preparation, any scenario in the run's plan, or settlement and release of the Preview estate fails.",
|
|
566
566
|
"startGraceMs": 600000,
|
|
567
567
|
"runTimeoutMs": 7200000,
|
|
568
568
|
"failureAlert": "github_workflow_run",
|
|
@@ -1058,7 +1058,7 @@
|
|
|
1058
1058
|
"id": "convex.observe-large-usage-charges",
|
|
1059
1059
|
"name": "Observe unusually large usage charges",
|
|
1060
1060
|
"scheduler": "convex_scheduled_action",
|
|
1061
|
-
"cadence": "runAfter(0) from each consumed
|
|
1061
|
+
"cadence": "runAfter(0) from each consumed usage-notification batch with a charge above the $10 message threshold",
|
|
1062
1062
|
"timezone": "UTC",
|
|
1063
1063
|
"source": "packages/convex/scheduledJobsNode.ts",
|
|
1064
1064
|
"locator": "observeLargeUsageCharges",
|
|
@@ -363,7 +363,7 @@ import {
|
|
|
363
363
|
isAlwaysFreshIntegrationTool,
|
|
364
364
|
isAlwaysFreshIntegrationWriteTool,
|
|
365
365
|
} from './tool-cache-policy';
|
|
366
|
-
import { isRowIsolationExemptError } from './row-isolation';
|
|
366
|
+
import { isAbortLikeError, isRowIsolationExemptError } from './row-isolation';
|
|
367
367
|
import {
|
|
368
368
|
replayTrackedMarkerReceiptKey,
|
|
369
369
|
replayUnsafeMarkerReceiptKey,
|
|
@@ -388,6 +388,7 @@ import {
|
|
|
388
388
|
} from './output-size-limits';
|
|
389
389
|
import {
|
|
390
390
|
RuntimeReceiptWriter,
|
|
391
|
+
RuntimeReceiptWriterBufferLimitError,
|
|
391
392
|
type RuntimeReceiptWriterRetryEvent,
|
|
392
393
|
writeRuntimeReceiptWithBackpressure,
|
|
393
394
|
} from './runtime-receipt-writer';
|
|
@@ -4144,6 +4145,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
4144
4145
|
completedAt?: (value: T) => number | undefined;
|
|
4145
4146
|
sharesResult?: (value: T) => boolean;
|
|
4146
4147
|
publishLatestOnRefresh?: true;
|
|
4148
|
+
/** Names the tool in the shared-cache skip log. */
|
|
4149
|
+
toolId?: string;
|
|
4147
4150
|
onOutcome?: (value: T, metadata: CallFreshnessMetadata) => T;
|
|
4148
4151
|
}): Promise<T> {
|
|
4149
4152
|
const orgId = this.#options.orgId?.trim();
|
|
@@ -4157,6 +4160,12 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
4157
4160
|
semanticKey: input.semanticKey,
|
|
4158
4161
|
invocationId: input.invocationId,
|
|
4159
4162
|
runId: this.historyRunId,
|
|
4163
|
+
receiptOwnerRunId: this.currentReceiptOwnerRunId,
|
|
4164
|
+
onLatestPublishSkipped: (event) =>
|
|
4165
|
+
this.reportSharedReadCachePublishSkipped({
|
|
4166
|
+
...event,
|
|
4167
|
+
...(input.toolId ? { toolId: input.toolId } : {}),
|
|
4168
|
+
}),
|
|
4160
4169
|
requestedStaleAfterSeconds: input.policy.requested,
|
|
4161
4170
|
effectiveStaleAfterSeconds: input.policy.effective,
|
|
4162
4171
|
store: this.durableReceiptExecutionStore(),
|
|
@@ -6732,18 +6741,55 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
6732
6741
|
assertNoSecretTaint(input.result, 'Shared read cache result');
|
|
6733
6742
|
await publish({
|
|
6734
6743
|
key: input.access.key,
|
|
6735
|
-
runId: this.
|
|
6744
|
+
runId: this.currentReceiptOwnerRunId,
|
|
6736
6745
|
output: latestCacheResultOutput(
|
|
6737
6746
|
completedCallForResult(input.result, 0, input.storedResultReceiptKey),
|
|
6738
6747
|
),
|
|
6739
6748
|
});
|
|
6740
6749
|
} catch (error) {
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6750
|
+
// Cancellation is the run stopping, not a publish failure.
|
|
6751
|
+
if (isAbortLikeError(error)) throw error;
|
|
6752
|
+
this.reportSharedReadCachePublishSkipped({
|
|
6753
|
+
key: input.access.key,
|
|
6754
|
+
reason:
|
|
6755
|
+
error instanceof RuntimeReceiptWriterBufferLimitError
|
|
6756
|
+
? 'too_large'
|
|
6757
|
+
: 'error',
|
|
6758
|
+
error,
|
|
6759
|
+
toolId: input.toolId,
|
|
6760
|
+
});
|
|
6744
6761
|
}
|
|
6745
6762
|
}
|
|
6746
6763
|
|
|
6764
|
+
#sharedReadCachePublishSkips = 0;
|
|
6765
|
+
|
|
6766
|
+
/**
|
|
6767
|
+
* A shared-cache publish is an optimization, so a skip never fails the run.
|
|
6768
|
+
* It is still reported: a structured line for the first skip and then each
|
|
6769
|
+
* power-of-two count, so a run that skips thousands of publishes stays quiet.
|
|
6770
|
+
*/
|
|
6771
|
+
private reportSharedReadCachePublishSkipped(event: {
|
|
6772
|
+
key: string;
|
|
6773
|
+
reason: 'too_large' | 'error';
|
|
6774
|
+
error: unknown;
|
|
6775
|
+
toolId?: string;
|
|
6776
|
+
}): void {
|
|
6777
|
+
const count = ++this.#sharedReadCachePublishSkips;
|
|
6778
|
+
if ((count & (count - 1)) !== 0) return;
|
|
6779
|
+
this.runtimeLog(
|
|
6780
|
+
JSON.stringify({
|
|
6781
|
+
event: 'shared_read_cache_publish_skipped',
|
|
6782
|
+
reason: event.reason,
|
|
6783
|
+
...(event.toolId ? { toolId: event.toolId } : {}),
|
|
6784
|
+
skippedCount: count,
|
|
6785
|
+
message:
|
|
6786
|
+
event.error instanceof Error
|
|
6787
|
+
? event.error.message
|
|
6788
|
+
: String(event.error),
|
|
6789
|
+
}),
|
|
6790
|
+
);
|
|
6791
|
+
}
|
|
6792
|
+
|
|
6747
6793
|
private async resolveToolAuthScopeDigest(
|
|
6748
6794
|
toolId: string,
|
|
6749
6795
|
): Promise<string | null> {
|
|
@@ -14511,6 +14557,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
14511
14557
|
semanticKey,
|
|
14512
14558
|
invocationId,
|
|
14513
14559
|
policy,
|
|
14560
|
+
toolId,
|
|
14514
14561
|
...(publishLatestOnRefresh
|
|
14515
14562
|
? { publishLatestOnRefresh: true as const }
|
|
14516
14563
|
: {}),
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
type DurableReceiptExecutionStore,
|
|
10
10
|
} from './durable-receipt-execution';
|
|
11
11
|
import { DURABLE_RUNS_ROLLOUT } from './durable-runs-rollout';
|
|
12
|
+
import { RuntimeReceiptWriterBufferLimitError } from './runtime-receipt-writer';
|
|
12
13
|
import { assertNoSecretTaint } from './secret-capability';
|
|
13
14
|
import {
|
|
14
15
|
deserializeToolExecuteResult,
|
|
@@ -152,6 +153,17 @@ export function completedCallForResult(
|
|
|
152
153
|
};
|
|
153
154
|
}
|
|
154
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Matches `isAbortLikeError` (row-isolation.ts), which this module cannot
|
|
158
|
+
* import without a cycle through durable-receipt-execution.
|
|
159
|
+
*/
|
|
160
|
+
function isCancellationError(error: unknown): boolean {
|
|
161
|
+
return (
|
|
162
|
+
error instanceof Error &&
|
|
163
|
+
(error.name === 'WorkflowAbort' || error.name === 'AbortError')
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
155
167
|
/** The `publish_latest_cache_result` output; the receiver stamps the time. */
|
|
156
168
|
export function latestCacheResultOutput(
|
|
157
169
|
call: CompletedCall,
|
|
@@ -229,6 +241,21 @@ export async function executeWithFreshnessReceipt<T>(input: {
|
|
|
229
241
|
* an authored 0 never publish.
|
|
230
242
|
*/
|
|
231
243
|
publishLatestOnRefresh?: true;
|
|
244
|
+
/**
|
|
245
|
+
* Run identity of the executor token. The shared-cache publish is checked
|
|
246
|
+
* against it by the gateway, so it must not be the history run ID, which
|
|
247
|
+
* differs for an inline child. Defaults to `runId` (a root run: identical).
|
|
248
|
+
*/
|
|
249
|
+
receiptOwnerRunId?: string;
|
|
250
|
+
/**
|
|
251
|
+
* Reports a shared-cache publish that was skipped or failed. The publish is
|
|
252
|
+
* an optimization, so the run proceeds; the caller makes this observable.
|
|
253
|
+
*/
|
|
254
|
+
onLatestPublishSkipped?: (event: {
|
|
255
|
+
key: string;
|
|
256
|
+
reason: 'too_large' | 'error';
|
|
257
|
+
error: unknown;
|
|
258
|
+
}) => void;
|
|
232
259
|
onOutcome: (value: T, metadata: CallFreshnessMetadata) => T;
|
|
233
260
|
withHydration: <Result>(
|
|
234
261
|
read: (
|
|
@@ -482,11 +509,27 @@ export async function executeWithFreshnessReceipt<T>(input: {
|
|
|
482
509
|
) {
|
|
483
510
|
// The receiver stamps the time and keeps only the newer entry. An
|
|
484
511
|
// older receiver reports `unavailable`; either outcome is final.
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
512
|
+
try {
|
|
513
|
+
await input.store.publishLatestCacheResult({
|
|
514
|
+
key: latestCacheKey,
|
|
515
|
+
runId: input.receiptOwnerRunId ?? input.runId,
|
|
516
|
+
output: latestCacheResultOutput(completed),
|
|
517
|
+
});
|
|
518
|
+
} catch (error) {
|
|
519
|
+
// Cancellation is the run stopping, not a publish failure.
|
|
520
|
+
if (isCancellationError(error)) throw error;
|
|
521
|
+
// Best effort: the result was produced and stored; a failed or
|
|
522
|
+
// oversized shared-cache publish must not fail the customer's run.
|
|
523
|
+
// The payload is never truncated; an oversized result is not shared.
|
|
524
|
+
input.onLatestPublishSkipped?.({
|
|
525
|
+
key: latestCacheKey,
|
|
526
|
+
reason:
|
|
527
|
+
error instanceof RuntimeReceiptWriterBufferLimitError
|
|
528
|
+
? 'too_large'
|
|
529
|
+
: 'error',
|
|
530
|
+
error,
|
|
531
|
+
});
|
|
532
|
+
}
|
|
490
533
|
}
|
|
491
534
|
// Each overlapping miss owns its live result even if the immutable receipt
|
|
492
535
|
// insert loses to a sibling. The stored winner is for later recovery.
|
package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { resolve4 } from 'node:dns/promises';
|
|
2
1
|
import type { CreateSandboxFromSnapshotParams, Sandbox } from '@daytonaio/sdk';
|
|
3
2
|
import {
|
|
4
3
|
boundedDaytonaProviderTextForLog,
|
|
@@ -18,6 +17,7 @@ import type {
|
|
|
18
17
|
PlayRunnerResult,
|
|
19
18
|
} from '../../protocol';
|
|
20
19
|
import { isIsolatedRuntimeSchedulerSchema } from '../../runtime-scheduler-topology';
|
|
20
|
+
import { withRuntimeGatewayEgressCidrs } from '../../runtime-gateway-egress';
|
|
21
21
|
import { PLAY_RUNNER_TIMEOUT_SECONDS } from '../../runtime-constants';
|
|
22
22
|
import {
|
|
23
23
|
STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS,
|
|
@@ -65,6 +65,20 @@ const DAYTONA_TIMED_OUT_CREATE_RECONCILE_DELAYS_MS = [
|
|
|
65
65
|
// It is not a fence: a stalled owner can outlast it, so name uniqueness and the
|
|
66
66
|
// attempt fences on abandon and promotion keep custody safe.
|
|
67
67
|
const DAYTONA_ABSENT_OPERATION_RECREATE_AFTER_MS = 3 * 60_000;
|
|
68
|
+
// A named create still `creating` this long after its operation was reserved
|
|
69
|
+
// is stuck on its runner, not slow. On 2026-11-11 Preview, 1,222 healthy
|
|
70
|
+
// creates returned in p99 3.4 s and at most 16 s, and Daytona's runner fails
|
|
71
|
+
// its own container start after 120 s ("sysbox container start timed out
|
|
72
|
+
// after 120s"). One runner whose VM boot hung instead held every sandbox
|
|
73
|
+
// placed on it in `creating` for 11+ minutes before reporting `error`. Past
|
|
74
|
+
// this age the create's own reconcile ladder, or a resumed recovery, hands
|
|
75
|
+
// that exact sandbox to durable cleanup and reports a provider start timeout
|
|
76
|
+
// before customer code, so the placement policy moves the run to Modal where
|
|
77
|
+
// it allows that transition; otherwise recovery retries on Daytona once the
|
|
78
|
+
// cleanup settles. The sandbox has never started: its operation is still
|
|
79
|
+
// `reserved`, and `deleting` can never be promoted to `live`, so no runner
|
|
80
|
+
// command can reach it afterwards.
|
|
81
|
+
export const DAYTONA_STUCK_CREATING_REPLACE_AFTER_MS = 2 * 60_000;
|
|
68
82
|
// Explicit runner deadline + scheduler GC own the normal lifecycle. Daytona's
|
|
69
83
|
// inactivity stop is a wider crash backstop measured from sandbox creation, so
|
|
70
84
|
// setup time cannot consume the terminal-flush grace.
|
|
@@ -550,15 +564,10 @@ export function filterIpv4CidrAllowList(raw: string | null): string | null {
|
|
|
550
564
|
}
|
|
551
565
|
|
|
552
566
|
/**
|
|
553
|
-
*
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
* CIDR list. So when egress is already restricted, add the /24 around each
|
|
558
|
-
* IPv4 address the pinned host resolves to, to that same list: the sandbox
|
|
559
|
-
* resolves the same name and may be answered with a different address in the
|
|
560
|
-
* same Vercel range. An unrestricted sandbox needs nothing (a list would
|
|
561
|
-
* restrict it), and an unpinned run is returned unchanged.
|
|
567
|
+
* Daytona's form of the shared pinned-host egress rule
|
|
568
|
+
* (`withRuntimeGatewayEgressCidrs`): its `networkAllowList` is one
|
|
569
|
+
* comma-separated CIDR string. An unrestricted sandbox and an unpinned run
|
|
570
|
+
* are returned unchanged, without resolving.
|
|
562
571
|
*/
|
|
563
572
|
export async function runtimeGatewayDaytonaNetworkAllowList(input: {
|
|
564
573
|
credentialScope:
|
|
@@ -567,37 +576,15 @@ export async function runtimeGatewayDaytonaNetworkAllowList(input: {
|
|
|
567
576
|
networkAllowList: string | null;
|
|
568
577
|
resolveIpv4?: (hostname: string) => Promise<string[]>;
|
|
569
578
|
}): Promise<string | null> {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
const hostname = new URL(scope.origin).hostname;
|
|
573
|
-
if (!hostname) {
|
|
574
|
-
throw new Error('Runtime gateway credential scope has no hostname.');
|
|
579
|
+
if (!input.credentialScope || !input.networkAllowList) {
|
|
580
|
+
return input.networkAllowList;
|
|
575
581
|
}
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
(octets) =>
|
|
583
|
-
octets.length === 4 &&
|
|
584
|
-
octets.every((octet) => /^\d{1,3}$/.test(octet)),
|
|
585
|
-
)
|
|
586
|
-
.map((octets) => `${octets[0]}.${octets[1]}.${octets[2]}.0/24`),
|
|
587
|
-
),
|
|
588
|
-
];
|
|
589
|
-
if (networks.length === 0) {
|
|
590
|
-
throw new Error(
|
|
591
|
-
`Runtime gateway host ${hostname} resolved to no IPv4 address; refusing to start a pinned sandbox that could not reach it.`,
|
|
592
|
-
);
|
|
593
|
-
}
|
|
594
|
-
const existing = input.networkAllowList
|
|
595
|
-
.split(',')
|
|
596
|
-
.map((entry) => entry.trim());
|
|
597
|
-
return [
|
|
598
|
-
...existing,
|
|
599
|
-
...networks.filter((network) => !existing.includes(network)),
|
|
600
|
-
].join(',');
|
|
582
|
+
const cidrs = await withRuntimeGatewayEgressCidrs({
|
|
583
|
+
credentialScope: input.credentialScope,
|
|
584
|
+
cidrs: input.networkAllowList.split(','),
|
|
585
|
+
...(input.resolveIpv4 ? { resolveIpv4: input.resolveIpv4 } : {}),
|
|
586
|
+
});
|
|
587
|
+
return cidrs ? cidrs.join(',') : null;
|
|
601
588
|
}
|
|
602
589
|
|
|
603
590
|
export function resolveDaytonaSandboxNetworkPolicy(input: {
|
|
@@ -720,10 +707,55 @@ type TimedOutDaytonaSandboxReconcileObserved = {
|
|
|
720
707
|
type TimedOutDaytonaSandboxReconciliation = (
|
|
721
708
|
| { kind: 'started'; sandbox: DaytonaSandbox }
|
|
722
709
|
| { kind: 'deleted' }
|
|
710
|
+
/** Past the replacement age in `creating`; durable cleanup now owns it. */
|
|
711
|
+
| {
|
|
712
|
+
kind: 'stuck_creating';
|
|
713
|
+
sandbox: DaytonaSandbox;
|
|
714
|
+
operationAgeMs: number;
|
|
715
|
+
}
|
|
723
716
|
| { kind: 'not_found' }
|
|
724
717
|
| { kind: 'transition_pending' }
|
|
725
718
|
) & { observed: TimedOutDaytonaSandboxReconcileObserved };
|
|
726
719
|
|
|
720
|
+
/**
|
|
721
|
+
* A create stuck in `creating` past DAYTONA_STUCK_CREATING_REPLACE_AFTER_MS was
|
|
722
|
+
* handed to durable cleanup. Report it as a provider start timeout before
|
|
723
|
+
* customer code, the same failure the placement policy already moves to Modal.
|
|
724
|
+
* The log line feeds the Slack notice naming the runner.
|
|
725
|
+
*/
|
|
726
|
+
function daytonaStuckCreatingUnavailable(input: {
|
|
727
|
+
daytona: DaytonaClient;
|
|
728
|
+
context: DaytonaExecutionContext;
|
|
729
|
+
phase: 'create_reconcile' | 'resume';
|
|
730
|
+
providerAttempt: number;
|
|
731
|
+
reconciliation: Extract<
|
|
732
|
+
TimedOutDaytonaSandboxReconciliation,
|
|
733
|
+
{ kind: 'stuck_creating' }
|
|
734
|
+
>;
|
|
735
|
+
}): DaytonaSandboxAcquisitionUnavailableError {
|
|
736
|
+
const { sandbox, operationAgeMs } = input.reconciliation;
|
|
737
|
+
const placement = input.daytona.placementForLog?.(sandbox) ?? {};
|
|
738
|
+
console.warn('[play-runner.daytona.stuck_creating]', {
|
|
739
|
+
event: 'play_runner.daytona.stuck_creating',
|
|
740
|
+
runId: input.context.runId ?? null,
|
|
741
|
+
workflowId: input.context.workflowId ?? null,
|
|
742
|
+
phase: input.phase,
|
|
743
|
+
providerAttempt: input.providerAttempt,
|
|
744
|
+
sandboxId: sandbox.id,
|
|
745
|
+
operationAgeMs,
|
|
746
|
+
runnerId: placement.runnerId ?? null,
|
|
747
|
+
target: placement.target ?? null,
|
|
748
|
+
runtimeEnvironment:
|
|
749
|
+
process.env.DEEPLINE_RUNTIME_ENVIRONMENT === 'preview'
|
|
750
|
+
? 'preview'
|
|
751
|
+
: 'production',
|
|
752
|
+
});
|
|
753
|
+
return new DaytonaSandboxAcquisitionUnavailableError(
|
|
754
|
+
'daytona_sandbox_start_timeout',
|
|
755
|
+
`Daytona sandbox ${sandbox.id} stayed in creating for ${Math.round(operationAgeMs / 1_000)} s and was handed to cleanup before customer code started.`,
|
|
756
|
+
);
|
|
757
|
+
}
|
|
758
|
+
|
|
727
759
|
async function reconcileAndDeleteTimedOutDaytonaSandbox(input: {
|
|
728
760
|
daytona: DaytonaClient;
|
|
729
761
|
sandboxName: string;
|
|
@@ -738,6 +770,13 @@ async function reconcileAndDeleteTimedOutDaytonaSandbox(input: {
|
|
|
738
770
|
recordCleanupIntent?: (
|
|
739
771
|
intent: PlayRunnerDaytonaCleanupIntent,
|
|
740
772
|
) => Promise<void>;
|
|
773
|
+
/**
|
|
774
|
+
* Age of the reserved operation when this ladder started: the database
|
|
775
|
+
* clock on resume, or time since the create was sent in the creating
|
|
776
|
+
* process. Absent when it is unknown (a lease that expired), and then a
|
|
777
|
+
* `creating` sandbox is never replaced.
|
|
778
|
+
*/
|
|
779
|
+
operationAgeAtStartMs?: number;
|
|
741
780
|
}): Promise<TimedOutDaytonaSandboxReconciliation> {
|
|
742
781
|
const reconcileStartedAt = Date.now();
|
|
743
782
|
let last = NO_DAYTONA_NAMED_SANDBOX_LOOKUP;
|
|
@@ -753,6 +792,10 @@ async function reconcileAndDeleteTimedOutDaytonaSandbox(input: {
|
|
|
753
792
|
deleteTimeouts,
|
|
754
793
|
elapsedMs: Date.now() - reconcileStartedAt,
|
|
755
794
|
});
|
|
795
|
+
const operationAgeMs = (): number | null =>
|
|
796
|
+
input.operationAgeAtStartMs === undefined
|
|
797
|
+
? null
|
|
798
|
+
: input.operationAgeAtStartMs + (Date.now() - reconcileStartedAt);
|
|
756
799
|
if (!input.daytona.get) return { kind: 'not_found', observed: observed() };
|
|
757
800
|
let lastDeleteConflict: unknown = null;
|
|
758
801
|
let sawDeleteTimeout = false;
|
|
@@ -813,14 +856,44 @@ async function reconcileAndDeleteTimedOutDaytonaSandbox(input: {
|
|
|
813
856
|
}
|
|
814
857
|
// Keep an in-progress create under its original reservation. A late start
|
|
815
858
|
// belongs to the same operation, unless a prior DELETE timed out and made
|
|
816
|
-
// that sandbox's future state ambiguous
|
|
817
|
-
|
|
859
|
+
// that sandbox's future state ambiguous, or the create has outlived any
|
|
860
|
+
// healthy runner (DAYTONA_STUCK_CREATING_REPLACE_AFTER_MS). Only the
|
|
861
|
+
// durable cleanup owner may take a stuck create: deleting a creating
|
|
862
|
+
// sandbox in process turned failed deletes into terminal Play failures
|
|
863
|
+
// (docs/incidents/2026-11-03-daytona-create.md).
|
|
864
|
+
const ageMs = operationAgeMs();
|
|
865
|
+
const stuckCreatingAgeMs =
|
|
866
|
+
sandbox.state === 'creating' &&
|
|
867
|
+
input.recordCleanupIntent !== undefined &&
|
|
868
|
+
Boolean(input.operationIdentity?.runId) &&
|
|
869
|
+
Boolean(sandbox.organizationId?.trim()) &&
|
|
870
|
+
ageMs !== null &&
|
|
871
|
+
ageMs >= DAYTONA_STUCK_CREATING_REPLACE_AFTER_MS
|
|
872
|
+
? ageMs
|
|
873
|
+
: null;
|
|
874
|
+
const creatingPastReplacementAge = stuckCreatingAgeMs !== null;
|
|
875
|
+
if (
|
|
876
|
+
sandbox.state === 'creating' &&
|
|
877
|
+
!sawDeleteTimeout &&
|
|
878
|
+
!creatingPastReplacementAge
|
|
879
|
+
) {
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
818
882
|
if (sandbox.state === 'started' && !sawDeleteTimeout) {
|
|
819
883
|
return { kind: 'started', sandbox, observed: observed() };
|
|
820
884
|
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
885
|
+
if (creatingPastReplacementAge) {
|
|
886
|
+
input.emitStage?.('create:stuck_creating_cleanup', {
|
|
887
|
+
sandboxId: sandbox.id,
|
|
888
|
+
operationAgeMs: ageMs,
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
// Persist the exact identity before handing stable, stuck-creating, or
|
|
892
|
+
// ambiguously-deleted resources to the cleanup worker. A sandbox that is
|
|
893
|
+
// still creating stays with its create until it is past the replacement
|
|
894
|
+
// age: before then it may complete and be safely resumed. The intent moves
|
|
895
|
+
// the operation from `reserved` to `deleting`, which no writer promotes to
|
|
896
|
+
// `live`, so a late start of this sandbox can never receive a command.
|
|
824
897
|
if (input.operationIdentity && input.recordCleanupIntent) {
|
|
825
898
|
if (!input.operationIdentity.runId || !sandbox.organizationId?.trim()) {
|
|
826
899
|
throw new Error(
|
|
@@ -835,6 +908,14 @@ async function reconcileAndDeleteTimedOutDaytonaSandbox(input: {
|
|
|
835
908
|
sandboxId: sandbox.id,
|
|
836
909
|
routingDomain: sandbox.organizationId,
|
|
837
910
|
});
|
|
911
|
+
if (stuckCreatingAgeMs !== null) {
|
|
912
|
+
return {
|
|
913
|
+
kind: 'stuck_creating',
|
|
914
|
+
sandbox,
|
|
915
|
+
operationAgeMs: stuckCreatingAgeMs,
|
|
916
|
+
observed: observed(),
|
|
917
|
+
};
|
|
918
|
+
}
|
|
838
919
|
return { kind: 'transition_pending', observed: observed() };
|
|
839
920
|
}
|
|
840
921
|
// After a DELETE timed out, never run the sandbox until this same named
|
|
@@ -950,9 +1031,15 @@ async function createRetriedOneShotDaytonaSandbox(input: {
|
|
|
950
1031
|
if (!reservation.providerOperationToken) {
|
|
951
1032
|
throw new DaytonaSandboxTransitionPendingError(sandboxName);
|
|
952
1033
|
}
|
|
953
|
-
// Recovery must converge when the timed-out create has stopped
|
|
954
|
-
//
|
|
1034
|
+
// Recovery must converge when the timed-out create has stopped, failed,
|
|
1035
|
+
// or stayed `creating` past any healthy runner, using the same
|
|
1036
|
+
// provider-confirmed cleanup path as its initial observer.
|
|
955
1037
|
const reconciliation = await reconcileAndDeleteTimedOutDaytonaSandbox({
|
|
1038
|
+
...(reservation.existingProviderOperationAgeMs === undefined
|
|
1039
|
+
? {}
|
|
1040
|
+
: {
|
|
1041
|
+
operationAgeAtStartMs: reservation.existingProviderOperationAgeMs,
|
|
1042
|
+
}),
|
|
956
1043
|
daytona: input.daytona,
|
|
957
1044
|
sandboxName,
|
|
958
1045
|
cancellationSignal: input.cancellationSignal,
|
|
@@ -987,6 +1074,17 @@ async function createRetriedOneShotDaytonaSandbox(input: {
|
|
|
987
1074
|
'The resumed timed-out Daytona sandbox was reconciled and deleted before fallback.',
|
|
988
1075
|
);
|
|
989
1076
|
}
|
|
1077
|
+
// Cleanup owns the stuck sandbox and its capacity lease until Daytona
|
|
1078
|
+
// confirms it gone; the operation is `deleting` and never runs the Play.
|
|
1079
|
+
if (reconciliation.kind === 'stuck_creating') {
|
|
1080
|
+
throw daytonaStuckCreatingUnavailable({
|
|
1081
|
+
daytona: input.daytona,
|
|
1082
|
+
context: input.context,
|
|
1083
|
+
phase: 'resume',
|
|
1084
|
+
providerAttempt: attempt,
|
|
1085
|
+
reconciliation,
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
990
1088
|
// Neither absence nor an ongoing transition proves that create cannot
|
|
991
1089
|
// commit, so inside the create window retain the durable identity and
|
|
992
1090
|
// its capacity reservation. The detail only records which of the two
|
|
@@ -1088,6 +1186,9 @@ async function createRetriedOneShotDaytonaSandbox(input: {
|
|
|
1088
1186
|
let reconciliation: TimedOutDaytonaSandboxReconciliation;
|
|
1089
1187
|
try {
|
|
1090
1188
|
reconciliation = await reconcileAndDeleteTimedOutDaytonaSandbox({
|
|
1189
|
+
// The create was sent at attemptStartedAt, just after its
|
|
1190
|
+
// reservation committed.
|
|
1191
|
+
operationAgeAtStartMs: Date.now() - attemptStartedAt,
|
|
1091
1192
|
daytona: input.daytona,
|
|
1092
1193
|
sandboxName,
|
|
1093
1194
|
cancellationSignal: input.cancellationSignal,
|
|
@@ -1141,6 +1242,15 @@ async function createRetriedOneShotDaytonaSandbox(input: {
|
|
|
1141
1242
|
};
|
|
1142
1243
|
}
|
|
1143
1244
|
await recordCreateFailure();
|
|
1245
|
+
if (reconciliation.kind === 'stuck_creating') {
|
|
1246
|
+
throw daytonaStuckCreatingUnavailable({
|
|
1247
|
+
daytona: input.daytona,
|
|
1248
|
+
context: input.context,
|
|
1249
|
+
phase: 'create_reconcile',
|
|
1250
|
+
providerAttempt: attempt,
|
|
1251
|
+
reconciliation,
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1144
1254
|
// Same decision as before; the detail records what the ladder saw.
|
|
1145
1255
|
const reconcileObserved = reconciliation.observed;
|
|
1146
1256
|
const reconcilePending = (): DaytonaSandboxTransitionPendingError =>
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
withModalCallSignal,
|
|
27
27
|
} from '../../modal-runtime-config';
|
|
28
28
|
import type { PlaySandboxRuntimeLimits } from '../../../plays/sandbox-runtime-limits';
|
|
29
|
+
import { withRuntimeGatewayEgressCidrs } from '../../runtime-gateway-egress';
|
|
29
30
|
import { validateDaytonaExecutionContext } from './daytona-lifecycle';
|
|
30
31
|
import {
|
|
31
32
|
stageRunnerPayload,
|
|
@@ -340,6 +341,21 @@ async function persistLateModalSandboxResource(input: {
|
|
|
340
341
|
);
|
|
341
342
|
}
|
|
342
343
|
|
|
344
|
+
/** DNS failures that a later attempt can outrun (not "no such record"). */
|
|
345
|
+
const TRANSIENT_RESOLVER_ERROR_CODES: ReadonlySet<string> = new Set([
|
|
346
|
+
'EAI_AGAIN',
|
|
347
|
+
'ETIMEOUT',
|
|
348
|
+
'ESERVFAIL',
|
|
349
|
+
'ECONNREFUSED',
|
|
350
|
+
'ECONNRESET',
|
|
351
|
+
'ECANCELLED',
|
|
352
|
+
]);
|
|
353
|
+
|
|
354
|
+
function isTransientResolverError(error: unknown): boolean {
|
|
355
|
+
const code = (error as { code?: unknown } | null)?.code;
|
|
356
|
+
return typeof code === 'string' && TRANSIENT_RESOLVER_ERROR_CODES.has(code);
|
|
357
|
+
}
|
|
358
|
+
|
|
343
359
|
export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
344
360
|
async execute(config, callbacks) {
|
|
345
361
|
let runtimeResourceRegistrationError: unknown;
|
|
@@ -372,6 +388,25 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
372
388
|
runtimeSchedulerSchema: config.context.runtimeSchedulerSchema,
|
|
373
389
|
limits: config.context.sandboxRuntimeLimits,
|
|
374
390
|
});
|
|
391
|
+
// A run pinned to an app-hosted Runtime gateway must reach that host
|
|
392
|
+
// through a restricted sandbox's CIDR list, by the same rule as Daytona.
|
|
393
|
+
// Only a pinned, already-restricted sandbox resolves anything; every
|
|
394
|
+
// other run keeps the exact list and path it had before.
|
|
395
|
+
const credentialScope = config.context.runtimeGatewayCredentialScope;
|
|
396
|
+
const outboundCidrAllowlist =
|
|
397
|
+
credentialScope && modalConfig.outboundCidrAllowlist
|
|
398
|
+
? await withRuntimeGatewayEgressCidrs({
|
|
399
|
+
credentialScope,
|
|
400
|
+
cidrs: modalConfig.outboundCidrAllowlist,
|
|
401
|
+
}).catch((error: unknown) => {
|
|
402
|
+
// A resolver hiccup is not the run's fault and no sandbox exists
|
|
403
|
+
// yet: defer like any runner that could not reach its gateway.
|
|
404
|
+
// A host with no IPv4 address still fails loudly.
|
|
405
|
+
throw isTransientResolverError(error)
|
|
406
|
+
? recoveryForRunnerStartupNotLive(error)
|
|
407
|
+
: error;
|
|
408
|
+
})
|
|
409
|
+
: modalConfig.outboundCidrAllowlist;
|
|
375
410
|
const resources = modalSandboxResourcesForPlay(modalConfig.limits);
|
|
376
411
|
const memoryPolicy = resolveModalSandboxMemoryPolicy({
|
|
377
412
|
limits: modalConfig.limits,
|
|
@@ -460,9 +495,7 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
460
495
|
idleTimeoutMs: modalSandboxLifetimeMs(modalConfig.limits),
|
|
461
496
|
workdir: modalConfig.workdir,
|
|
462
497
|
tags: createTags,
|
|
463
|
-
...(
|
|
464
|
-
? { outboundCidrAllowlist: modalConfig.outboundCidrAllowlist }
|
|
465
|
-
: {}),
|
|
498
|
+
...(outboundCidrAllowlist ? { outboundCidrAllowlist } : {}),
|
|
466
499
|
}),
|
|
467
500
|
onLateSuccess: async (lateSandbox) => {
|
|
468
501
|
logSandboxCreateOutcome({
|