@foxden-app/foxclaw 0.4.4 → 0.4.5
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.
|
@@ -4408,13 +4408,19 @@ export class BridgeSessionCore {
|
|
|
4408
4408
|
return;
|
|
4409
4409
|
}
|
|
4410
4410
|
await this.messaging.answerCallback(event.callbackQueryId, t(locale, 'auth_choice_recorded'));
|
|
4411
|
-
this.pendingAuthChoiceLists.delete(localId);
|
|
4412
4411
|
const switchLabels = await this.readCodexAuthSwitchLabels(candidate);
|
|
4413
4412
|
const switchingMessage = t(locale, 'auth_switching', this.codexAuthSwitchParams(locale, switchLabels.fromLabel, switchLabels.toLabel));
|
|
4414
4413
|
if (record.messageId !== null) {
|
|
4415
4414
|
await this.editMessage(event.scopeId, record.messageId, switchingMessage, []);
|
|
4416
4415
|
}
|
|
4417
|
-
await this.switchCodexAuthAndRestart(event.scopeId, locale, candidate, false);
|
|
4416
|
+
await this.switchCodexAuthAndRestart(event.scopeId, locale, candidate, false, false);
|
|
4417
|
+
const state = await this.listCodexAuthState();
|
|
4418
|
+
await this.refreshCurrentCodexAuthQuota(state);
|
|
4419
|
+
record.candidates = state.candidates;
|
|
4420
|
+
record.createdAt = Date.now();
|
|
4421
|
+
if (record.messageId !== null) {
|
|
4422
|
+
await this.editMessage(event.scopeId, record.messageId, renderAuthListMessage(locale, state, this.authDisplayBotLabel(), parseWeixinBridgeScope(event.scopeId) !== null), authChoiceKeyboard(locale, record));
|
|
4423
|
+
}
|
|
4418
4424
|
}
|
|
4419
4425
|
async maybeRunPendingAuthRotation() {
|
|
4420
4426
|
if (!this.pendingAuthRotation || this.authRotationInProgress) {
|
|
@@ -4551,7 +4557,7 @@ export class BridgeSessionCore {
|
|
|
4551
4557
|
to: toLabel,
|
|
4552
4558
|
};
|
|
4553
4559
|
}
|
|
4554
|
-
async switchCodexAuthAndRestart(scopeId, locale, candidate, automatic) {
|
|
4560
|
+
async switchCodexAuthAndRestart(scopeId, locale, candidate, automatic, sendResult = true) {
|
|
4555
4561
|
const recovered = await this.recoverCodexAuthCandidate(candidate.name);
|
|
4556
4562
|
const result = await switchCodexAuth(candidate.path, this.resolveAuthDir());
|
|
4557
4563
|
this.authRotationFailedTargets.delete(candidate.path);
|
|
@@ -4559,6 +4565,9 @@ export class BridgeSessionCore {
|
|
|
4559
4565
|
this.attachedThreads.clear();
|
|
4560
4566
|
await this.app.restart();
|
|
4561
4567
|
await this.syncCodexAuthCandidate(candidate.name);
|
|
4568
|
+
if (!sendResult) {
|
|
4569
|
+
return;
|
|
4570
|
+
}
|
|
4562
4571
|
const lines = [t(locale, automatic ? 'auth_auto_done' : 'auth_switch_done', this.codexAuthSwitchParams(locale, result.fromLabel, result.toLabel))];
|
|
4563
4572
|
if (recovered) {
|
|
4564
4573
|
lines.push(t(locale, 'auth_recovered_newer_candidate', { value: candidate.name }));
|
package/docs/user-manual.md
CHANGED
|
@@ -408,7 +408,7 @@ Quota remaining: 5h|7d|auth
|
|
|
408
408
|
[🔄 Reload auth]
|
|
409
409
|
```
|
|
410
410
|
|
|
411
|
-
The right-side `✅` / `⏸️` button shows the current state. Tapping it toggles enabled/disabled, and the refreshed list shows the new state. `--|--` means no quota snapshot has been observed for that candidate yet.
|
|
411
|
+
The right-side `✅` / `⏸️` button shows the current state. Tapping it toggles enabled/disabled, and the refreshed list shows the new state. Tapping a candidate switches auth, restarts that runtime, and refreshes the same panel with its buttons intact so you can switch again immediately. `--|--` means no quota snapshot has been observed for that candidate yet.
|
|
412
412
|
|
|
413
413
|
Equivalent commands:
|
|
414
414
|
|
package/docs/zh/user-manual.md
CHANGED
|
@@ -408,7 +408,7 @@ Candidates: 2
|
|
|
408
408
|
[🔄 Reload auth]
|
|
409
409
|
```
|
|
410
410
|
|
|
411
|
-
右侧 `✅` / `⏸️`
|
|
411
|
+
右侧 `✅` / `⏸️` 表示当前状态。点一下会切换启用/禁用,列表刷新后图标会随状态变化。点击候选会切换 auth、重启对应 runtime,并在原消息上刷新面板且保留按钮,因此可以立即连续切换。`--|--` 表示该候选还没有额度历史快照。
|
|
412
412
|
|
|
413
413
|
命令等价用法:
|
|
414
414
|
|