-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(account-pool): display threshold summary with strategy and warn on drained switch (#4521, #4524) #4567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fba389a
e2bd153
62f1459
e828568
27fa312
5289f08
0b91f1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1394,6 +1394,7 @@ export const de: Record<TKey, string> = { | |
| "codexAuth.switchTitle": "Aktives Konto wechseln?", | ||
| "codexAuth.switchDesc": "Wird sofort wirksam. Bereits laufende Anfragen behalten ihr Konto; alles andere wechselt zu diesem Konto, wobei Konten mit derselben Auswahlreihenfolge sich weiterhin abwechseln.", | ||
| "codexAuth.cacheWarning": "Prompt-Cache wird beim Kontowechsel zurückgesetzt. Neue Sitzung startet mit leerem Cache.", | ||
| "codexAuth.switchExceedsThresholdWarning": "Dieses Konto hat die Wechselschwelle ({threshold}%) erreicht oder überschritten. Die Fixierung wird freigegeben, wenn kein Kontingent-Puffer verfügbar ist.", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: sed -n '1380,1410p' gui/src/i18n/de.ts
sed -n '1455,1485p' gui/src/i18n/de.ts
rg -n ' %|%|Proaktiver Wechsel' gui/src/i18n/de.ts | head -80
find . -name 'AGENTS.md' -o -name 'CONTRIBUTING.md' -o -iname '*i18n*' | head -40Repository: lidge-jun/opencodex Length of output: 10111 🏁 Script executed: sed -n '1,220p' gui/AGENTS.md
printf '\n--- root guidance ---\n'
sed -n '1,180p' AGENTS.md
printf '\n--- focused German entries ---\n'
sed -n '1390,1478p' gui/src/i18n/de.ts
printf '\n--- locale validation guidance ---\n'
rg -n -i 'percent|prozent|spacing|space|German|de\.ts|translation|locale|i18n' gui/AGENTS.md AGENTS.md CONTRIBUTING.md gui/.eslint gui/tests/i18n-locales.test.ts gui/tests/i18n-language-switch.test.tsx 2>/dev/null | head -120Repository: lidge-jun/opencodex Length of output: 33383 Use the local German percent-spacing convention for threshold labels. The nearby Codex quota descriptions use Proposed fix- "codexAuth.switchExceedsThresholdWarning": "Dieses Konto hat die Wechselschwelle ({threshold}%) erreicht oder überschritten. Die Fixierung wird freigegeben, wenn kein Kontingent-Puffer verfügbar ist.",
+ "codexAuth.switchExceedsThresholdWarning": "Dieses Konto hat die Wechselschwelle ({threshold} %) erreicht oder überschritten. Die Fixierung wird freigegeben, wenn kein Kontingent-Puffer verfügbar ist.",
- "accountPool.switchAtThreshold": "Wechsel bei {threshold}%",
- "accountPool.drainAtThreshold": "Entleeren bei {threshold}%",
- "accountPool.resetBelowThreshold": "nächster Reset unter {threshold}%",
+ "accountPool.switchAtThreshold": "Wechsel bei {threshold} %",
+ "accountPool.drainAtThreshold": "Entleeren bei {threshold} %",
+ "accountPool.resetBelowThreshold": "nächster Reset unter {threshold} %",🤖 Prompt for AI Agents |
||
| "codexAuth.setAsNext": "Dieses Konto als Nächstes verwenden", | ||
| "codexAuth.cancel": "Abbrechen", | ||
| "codexAuth.switchBack": "Zurück zum Hauptkonto?", | ||
|
|
@@ -1465,6 +1466,11 @@ export const de: Record<TKey, string> = { | |
| "accountPool.stickyLimitInvalid": "Gib eine ganze Zahl von 1 bis 100 ein", | ||
| "accountPool.strategyLoadFailed": "Rotationsstrategie konnte nicht geladen werden.", | ||
| "accountPool.strategyUpdateFailed": "Rotationsstrategie konnte nicht gespeichert werden.", | ||
| "accountPool.switchAtThreshold": "Wechsel bei {threshold}%", | ||
| "accountPool.drainAtThreshold": "Entleeren bei {threshold}%", | ||
| "accountPool.resetBelowThreshold": "nächster Reset unter {threshold}%", | ||
| "accountPool.thresholdNotUsed": "Schwelle nicht verwendet", | ||
| "accountPool.proactiveSwitchingOff": "Proaktiver Wechsel aus", | ||
|
|
||
| "accountPool.quotaWindow": "Kontingentfenster", | ||
| "accountPool.quotaWindowDesc": "Welcher zwischengespeicherte Nutzungsbalken die kontingentbasierte Auswahl neuer Sitzungen, Fill-first-Schwellenprüfungen und geeignete 429-Ersatzkonten steuert.", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 27369
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 50375
Align terminal short-window scoring with the server.
src/codex/routing/cooldown-math.ts:153-168treats a short-only 100% quota as exhausted only whenshortResetAt, normalized byresetAtToMs(), is future, orshortObservedAtis no older than five minutes.gui/src/codex-quota-utils.ts:81-87instead uses the generalupdatedAtfor five hours and compares reset timestamps without unit normalization.This can make
CodexAccountSwitchModalwarn for a quota whose server score is unknown when a credit-only update refreshedupdatedAtbut the short observation is stale. A future reset stored in Unix seconds can also make the GUI miss a quota that the server treats as exhausted.src/codex/auth-api/account-list.ts:31-48also dropsshortObservedAtfor 30-day plans, whileAccountQuotadoes not declare it.Carry
shortObservedAtthrough the account-list DTO, add it toAccountQuota, normalize reset timestamps with the same seconds/milliseconds rule, and apply the server’s five-minute freshness rule before the modal evaluates the threshold.🤖 Prompt for AI Agents