opencode-codex-multi-account 0.2.2 → 0.2.3
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/index.js +8 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1112,6 +1112,9 @@ var MAX_RESOLVE_ATTEMPTS = 10;
|
|
|
1112
1112
|
var SERVER_RETRY_BASE_MS = 1e3;
|
|
1113
1113
|
var SERVER_RETRY_MAX_MS = 4e3;
|
|
1114
1114
|
var PERMANENT_AUTH_FAILURE_STATUSES = /* @__PURE__ */ new Set([400, 401, 403]);
|
|
1115
|
+
function isAbortError(error) {
|
|
1116
|
+
return error instanceof Error && error.name === "AbortError";
|
|
1117
|
+
}
|
|
1115
1118
|
function createExecutorForProvider(providerName, dependencies) {
|
|
1116
1119
|
const {
|
|
1117
1120
|
handleRateLimitResponse: handleRateLimitResponse2,
|
|
@@ -1144,6 +1147,7 @@ function createExecutorForProvider(providerName, dependencies) {
|
|
|
1144
1147
|
runtime = await runtimeFactory.getRuntime(accountUuid);
|
|
1145
1148
|
response = await runtime.fetch(input, init);
|
|
1146
1149
|
} catch (error) {
|
|
1150
|
+
if (isAbortError(error)) throw error;
|
|
1147
1151
|
if (await handleRuntimeFetchFailure(manager, runtimeFactory, client, account, error)) {
|
|
1148
1152
|
continue;
|
|
1149
1153
|
}
|
|
@@ -1161,6 +1165,7 @@ function createExecutorForProvider(providerName, dependencies) {
|
|
|
1161
1165
|
try {
|
|
1162
1166
|
serverResponse = await runtime.fetch(input, init);
|
|
1163
1167
|
} catch (error) {
|
|
1168
|
+
if (isAbortError(error)) throw error;
|
|
1164
1169
|
if (await handleRuntimeFetchFailure(manager, runtimeFactory, client, account, error)) {
|
|
1165
1170
|
authFailureDuringServerRetry = true;
|
|
1166
1171
|
break;
|
|
@@ -1189,6 +1194,7 @@ function createExecutorForProvider(providerName, dependencies) {
|
|
|
1189
1194
|
return retryResponse;
|
|
1190
1195
|
}
|
|
1191
1196
|
} catch (error) {
|
|
1197
|
+
if (isAbortError(error)) throw error;
|
|
1192
1198
|
if (await handleRuntimeFetchFailure(manager, runtimeFactory, client, account, error)) {
|
|
1193
1199
|
continue;
|
|
1194
1200
|
}
|
|
@@ -2353,11 +2359,11 @@ function getUsageSummary(account) {
|
|
|
2353
2359
|
const parts = [];
|
|
2354
2360
|
const { five_hour, seven_day } = parsed.output;
|
|
2355
2361
|
if (five_hour) {
|
|
2356
|
-
const reset = five_hour.
|
|
2362
|
+
const reset = five_hour.resets_at ? ` (resets ${formatTimeRemaining(five_hour.resets_at)})` : "";
|
|
2357
2363
|
parts.push(`5h: ${five_hour.utilization.toFixed(0)}%${reset}`);
|
|
2358
2364
|
}
|
|
2359
2365
|
if (seven_day) {
|
|
2360
|
-
const reset = seven_day.
|
|
2366
|
+
const reset = seven_day.resets_at ? ` (resets ${formatTimeRemaining(seven_day.resets_at)})` : "";
|
|
2361
2367
|
parts.push(`7d: ${seven_day.utilization.toFixed(0)}%${reset}`);
|
|
2362
2368
|
}
|
|
2363
2369
|
return parts.length > 0 ? parts.join(", ") : "no usage data";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-codex-multi-account",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "OpenCode plugin for Codex (OpenAI) multi-account management with automatic rate limit switching",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"directory": "packages/codex-multi-account"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"opencode-multi-account-core": "^0.2.
|
|
43
|
+
"opencode-multi-account-core": "^0.2.3",
|
|
44
44
|
"valibot": "^1.2.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|