Public: anyone can read this; the crew can change it.
Sentinel: Crew runs in trevato/relay keep failing at the push or the sandbox #2298
scout/forge:scout/1612-sentinel-crew-runs-in-trevato-relay-keep → main 3 commits fork
1 file
changed +29
−0
test/crew-interrupted.test.ts +29
| @@ -516,3 +516,32 @@ describe("an issue handed to someone else", () => { | ||
| 516 | 516 | expect(queued[0]!.actorId).toBe(other.id); |
| 517 | 517 | }); |
| 518 | 518 | }); |
| 519 | ||
| 520 | describe("an API that cannot be reached", () => { | |
| 521 | const out = (result: string, ok = false) => ({ | |
| 522 | ok, | |
| 523 | sessionId: "s", | |
| 524 | result, | |
| 525 | costUsd: 0, | |
| 526 | turns: 0, | |
| 527 | tokensIn: 0, | |
| 528 | tokensOut: 0, | |
| 529 | reason: "api_error", | |
| 530 | }); | |
| 531 | const dns = | |
| 532 | "API Error: Can't reach the API server — check your internet or DNS (EAI_AGAIN) (api_error)"; | |
| 533 | ||
| 534 | test("is no rate limit, so no account is rested for it", async () => { | |
| 535 | const { isRateLimited } = await import("../src/crew/limits.ts"); | |
| 536 | const { isNetworkError } = await import("../src/crew/network.ts"); | |
| 537 | expect(isNetworkError(out(dns))).toBe(true); | |
| 538 | expect(isRateLimited(out(dns))).toBe(false); | |
| 539 | expect(isRateLimited(out("API Error: 429 rate limit (api_error)"))).toBe(true); | |
| 540 | expect(isNetworkError(out(dns, true))).toBe(false); | |
| 541 | }); | |
| 542 | ||
| 543 | test("is a network interruption, not a provider limit", async () => { | |
| 544 | const { interruptionOf } = await import("../src/crew/interrupted.ts"); | |
| 545 | expect(interruptionOf(`no changes pushed: ${dns}`)).toBe("network error"); | |
| 546 | }); | |
| 547 | }); |
new above
offline