deepline 0.1.155 → 0.1.157
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/apps/play-runner-workers/src/entry.ts +146 -14
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/map-chunk-plan.ts +53 -1
- package/dist/bundling-sources/sdk/src/play.ts +4 -2
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +8 -4
- package/dist/bundling-sources/shared_libs/play-runtime/execution-plan.ts +159 -42
- package/dist/bundling-sources/shared_libs/play-runtime/map-chunk-limits.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +0 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +19 -3
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +464 -226
- package/dist/cli/index.js +76 -29
- package/dist/cli/index.mjs +100 -49
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/plays/bundle-play-file.mjs +318 -181
- package/package.json +3 -1
|
@@ -6,10 +6,12 @@ import {
|
|
|
6
6
|
|
|
7
7
|
export const TOOL_EXECUTE_TRANSIENT_HTTP_MAX_ATTEMPTS = 2;
|
|
8
8
|
export const TOOL_EXECUTE_RATE_LIMIT_MAX_ATTEMPTS = 8;
|
|
9
|
+
export const TOOL_EXECUTE_BARE_RATE_LIMIT_MAX_ATTEMPTS = 2;
|
|
9
10
|
export const TOOL_EXECUTE_TRANSPORT_MAX_ATTEMPTS = 3;
|
|
10
11
|
export const TOOL_EXECUTE_TRANSPORT_RETRY_DELAY_MS = 1_000;
|
|
11
12
|
export const TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS = 1_000;
|
|
12
13
|
export const TOOL_EXECUTE_RETRY_DELAY_MAX_MS = 5_000;
|
|
14
|
+
export const TOOL_EXECUTE_BARE_RATE_LIMIT_BACKPRESSURE_MS = 60_000;
|
|
13
15
|
|
|
14
16
|
export type ToolExecuteHttpRetryDecision = {
|
|
15
17
|
retryable: boolean;
|
|
@@ -43,6 +45,7 @@ export type ToolExecuteHttpFailureAttemptTracker = {
|
|
|
43
45
|
function decideToolExecuteHttpRetry(input: {
|
|
44
46
|
status: number;
|
|
45
47
|
hardBillingFailure?: boolean;
|
|
48
|
+
hasRetryAfterHeader?: boolean;
|
|
46
49
|
transientHttpRetrySafe?: boolean;
|
|
47
50
|
}): ToolExecuteHttpRetryDecision {
|
|
48
51
|
if (input.status === 429) {
|
|
@@ -53,6 +56,13 @@ function decideToolExecuteHttpRetry(input: {
|
|
|
53
56
|
reason: 'hard_billing_error',
|
|
54
57
|
};
|
|
55
58
|
}
|
|
59
|
+
if (!input.hasRetryAfterHeader) {
|
|
60
|
+
return {
|
|
61
|
+
retryable: true,
|
|
62
|
+
attemptCap: TOOL_EXECUTE_BARE_RATE_LIMIT_MAX_ATTEMPTS,
|
|
63
|
+
reason: 'rate_limit',
|
|
64
|
+
};
|
|
65
|
+
}
|
|
56
66
|
return {
|
|
57
67
|
retryable: true,
|
|
58
68
|
attemptCap: TOOL_EXECUTE_RATE_LIMIT_MAX_ATTEMPTS,
|
|
@@ -96,6 +106,7 @@ export function createToolExecuteHttpFailureAttemptTracker(): ToolExecuteHttpFai
|
|
|
96
106
|
next(input) {
|
|
97
107
|
const decision = decideToolExecuteHttpRetry({
|
|
98
108
|
status: input.status,
|
|
109
|
+
hasRetryAfterHeader: true,
|
|
99
110
|
transientHttpRetrySafe: input.transientHttpRetrySafe === true,
|
|
100
111
|
});
|
|
101
112
|
attemptsByReason[decision.reason] += 1;
|
|
@@ -130,8 +141,12 @@ export function classifyToolExecuteHttpFailure(input: {
|
|
|
130
141
|
nowMs?: number;
|
|
131
142
|
}): ToolExecuteHttpFailureOutcome {
|
|
132
143
|
const transientHttpRetrySafe = input.transientHttpRetrySafe === true;
|
|
144
|
+
const hasRetryAfterHeader =
|
|
145
|
+
typeof input.retryAfterHeader === 'string' &&
|
|
146
|
+
input.retryAfterHeader.trim().length > 0;
|
|
133
147
|
const initialRetryDecision = decideToolExecuteHttpRetry({
|
|
134
148
|
status: input.status,
|
|
149
|
+
hasRetryAfterHeader,
|
|
135
150
|
transientHttpRetrySafe,
|
|
136
151
|
});
|
|
137
152
|
const error = normalizeToolHttpErrorMessage({
|
|
@@ -144,6 +159,7 @@ export function classifyToolExecuteHttpFailure(input: {
|
|
|
144
159
|
const retryDecision = decideToolExecuteHttpRetry({
|
|
145
160
|
status: input.status,
|
|
146
161
|
hardBillingFailure: isHardBillingToolHttpError(error),
|
|
162
|
+
hasRetryAfterHeader,
|
|
147
163
|
transientHttpRetrySafe,
|
|
148
164
|
});
|
|
149
165
|
const shouldRetry =
|
|
@@ -176,10 +192,10 @@ export function classifyToolExecuteHttpFailure(input: {
|
|
|
176
192
|
: 'settle_row_failure',
|
|
177
193
|
retryDelayMs,
|
|
178
194
|
backpressureDelayMs:
|
|
179
|
-
input.status === 429
|
|
180
|
-
? retryAfterMs > 0
|
|
195
|
+
input.status === 429 && retryDecision.reason !== 'hard_billing_error'
|
|
196
|
+
? hasRetryAfterHeader && retryAfterMs > 0
|
|
181
197
|
? retryAfterMs
|
|
182
|
-
:
|
|
198
|
+
: TOOL_EXECUTE_BARE_RATE_LIMIT_BACKPRESSURE_MS
|
|
183
199
|
: null,
|
|
184
200
|
chargeRetryBudget: shouldRetry,
|
|
185
201
|
};
|