@kradle/cli 0.0.14 → 0.0.16
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/lib/evaluation/runner.js +12 -3
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const DEFAULT_MAX_CONCURRENT = 5;
|
|
2
|
-
const RATE_LIMIT_BACKOFF_MS =
|
|
2
|
+
const RATE_LIMIT_BACKOFF_MS = 15000;
|
|
3
3
|
const STATUS_POLL_INTERVAL_MS = 2000;
|
|
4
4
|
export class Runner {
|
|
5
5
|
runs;
|
|
@@ -135,7 +135,13 @@ export class Runner {
|
|
|
135
135
|
/**
|
|
136
136
|
* Start a single run
|
|
137
137
|
*/
|
|
138
|
-
async startRun(index) {
|
|
138
|
+
async startRun(index, tries = 0) {
|
|
139
|
+
if (tries > 5) {
|
|
140
|
+
this.updateState(index, { status: "error", error: "Failed to start run after 3 tries" });
|
|
141
|
+
this.completedRuns.add(index);
|
|
142
|
+
this.activeRuns.delete(index);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
139
145
|
const state = this.states[index];
|
|
140
146
|
this.activeRuns.add(index);
|
|
141
147
|
this.updateState(index, { status: "initializing", startTime: Date.now() });
|
|
@@ -158,11 +164,14 @@ export class Runner {
|
|
|
158
164
|
catch (error) {
|
|
159
165
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
160
166
|
// Check for rate limiting
|
|
161
|
-
if (errorMessage.includes("429") ||
|
|
167
|
+
if (errorMessage.includes("429") ||
|
|
168
|
+
errorMessage.toLowerCase().includes("rate limit") ||
|
|
169
|
+
errorMessage.toLowerCase().includes("you may need to stop or wait")) {
|
|
162
170
|
// Re-queue for later
|
|
163
171
|
this.updateState(index, { status: "queued", error: undefined });
|
|
164
172
|
this.activeRuns.delete(index);
|
|
165
173
|
await this.delay(RATE_LIMIT_BACKOFF_MS);
|
|
174
|
+
await this.startRun(index, tries + 1);
|
|
166
175
|
return;
|
|
167
176
|
}
|
|
168
177
|
this.updateState(index, { status: "error", error: errorMessage });
|
package/oclif.manifest.json
CHANGED