ac4af582301a4e8a29245dbba767eba31334ddf9
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ec7a18d124 |
gui: the account options' tooltips say what they do in a sentence or two
B3TT3R on Discord (#feedback) found the tooltip on Codex's "Only switch
Codex's sign-in" hard to read: one run-on sentence of three clauses, then
two more caveats. Its siblings in the same account list were the same
kind. Each now says what the option does in one short sentence, and at
most one caveat, in every language (zh, zh-TW, ja, de rewritten, not
machine-shortened from the old text).
- Codex, Only switch sign-in: "When an account is used up, magpie signs
{agent} in to the next one, and requests go straight to OpenAI. Open
{agent} sessions keep their account until reopened." (zh: 账号额度用完时,
magpie 把 {agent} 切到下一个账号,请求直连 OpenAI。已打开的 {agent} 会话重新
打开后才换账号。) The third caveat, that a Codex connected to magpie
still sends its requests through it, is dropped: the option is for a
Codex not connected (Agents row "Not connected · switching accounts
only"), and a connected one is unchanged by it.
- Claude Code, Only switch sign-in: "When an account is used up, magpie
signs {agent} in to the next one. Requests on these accounts don't go
through magpie."
- Keep signed in to: "{agent} stays on this account even when it runs
low. Requests through magpie still follow Routing."
- The account it stays on (picker): "The account {agent} stays signed
in to".
- Check usage again near a cap: "On: an account near its cap has its
usage read again before a request. One whose usage can't be read is
held." (the 5 points, 15s/5m and 10s wait stay in
docs/subsystems/providers-accounts.md).
Restart-the-app and Stop-at-cap were already one or two short sentences
and are unchanged.
Run (on mote, through mote-run, at
|
||
|
|
41b5c0f19a |
accounts: Claude Code stays on the account it moved to till that is spent too (hxy920830 on X)
hxy920830 on X wants Claude Code to use one account to 98%, move to the next and use that one to 98%, not jump back the moment the first resets. No setting gave that. NextLogin (#408) signed the agent back in to the first account as soon as it was under 90% again, under every routing. KeepLogin pins one account, In order goes back too, and switch only went back as well. Where the sign-in is what spends the accounts (Claude Code, whose own requests never pass the gateway, and Codex under switch only), the sign-in now stays on the account it moved to until that one is spent or fails, then moves on to the next ticked account with room. It goes back to the first only where the user said the first comes first: routing In order, or KeepLogin. Codex through the gateway keeps going back, because Smart routing sends its requests to the first account (#209) and the sign-in follows it. This is returnsToFirst in codex_switch.go. The return record is still written, so turning In order on later goes back as before. An old record is ignored otherwise, and its "First again" label (logins.go) is hidden. No user setting is overridden: In order and KeepLogin keep their meaning. GUI: the Routing note for Claude Code (and Codex under switch only) now says it stays on the account till that one is 98% used too. The two switch-only tooltips no longer promise going back. New and changed strings are in zh, zh-TW, ja and de. app.js lost a 3-line comment so the core script budget holds without a raise (core 1,531,108 of 1,533,105). Run on mote at 94cd5edde (base |
||
|
|
ce8b67de37 |
gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called page.goto with no timeout of its own, so Playwright held the first load of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a busy box (a whole-suite run at load 130-160) that load took longer and goto timed out. The same pattern is in 988 GUI test files (1174 pages): every one of them now also sets setDefaultNavigationTimeout(60000) on the same page, right after its default, so goto, reload and waitForURL wait on the load itself with room, while clicks and waits keep their short bar. group-from-model-add's own 20s navigation bar is raised to the same minute. claude-switch-only also gives its first provider row (drawn from the page's first reads) a minute before clicking it. nav-timeout.test.cjs (no browser) reads every GUI test file and names each page given a default under a minute without a navigation timeout of at least a minute, so a new file can't bring the pattern back. What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from other sessions): - node --check on every file in internal/gui/tests: all parse. - nav-timeout.test.cjs against origin/main's test files: red (names the 1174 pages); against this tree: its only reds were my own probe copies of the old files, since removed. - By hand: claude-switch-only with app.js served 7s late (a busy box's first load), --test-name-pattern "1100 en": origin/main's file 4 of 4 red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green. - claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420: 32 of 32. group-from-model-add, usage-access-key-card and i18n-keys: green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red on a 5s waitForFunction at line 115 (a wait after load, not the navigation), at load ~230. Not tried: the whole GUI suite (about 1000 files; the change is one mechanical line per page), Windows or mote (mote's browsers, #4125). |
||
|
|
d6fd9b3a36 |
provider, agent, gui, cli: Codex can switch only its own sign-in between accounts, never through the gateway (#1907, foobra)
foobra wants Codex Desktop and the CLI kept on their own ChatGPT subscription, moved to the next saved account when the signed-in one is used up and back when it resets, without magpie's gateway in the way. magpie already did the switch (codex_switch.go: 98%, 100% In order, back under 90%, unknown usage never switches), but with more than one Codex account on it also wrote openai_base_url into config.toml so a refused request fails over through the gateway (codexFailover). There was no way to have the first without the second. Now Codex's subscription has SwitchOnly (providers.json "switchOnly", opt-in, off by default so nothing changes for anyone who doesn't tick it): - provider.SetSwitchOnly / provider.SwitchOnly; only Codex's own subscription takes it. An unreadable providers.json reads as on, so magpie's own failover is never written on a guess. - agent.codexFailover is false when it is on: no openai_base_url, no failover note, no magpie models in Codex's list. A base URL the user wrote stays. - The account Save copy keeps it. - GUI: "Only switch Codex's sign-in" tick under Providers > Codex's accounts (with more than one on), posting provider/switchonly; the Agents row's failover title points at it. zh, zh-TW, ja, de. - CLI: magpie accounts switch-only codex [on|off]. - docs/reference.md and providers-accounts.md say what it does and that an open Codex app or app-server stays on its account until reopened. Run (darwin, sandbox HOME, -tags nogui): - go test ./internal/provider -run 'TestCodexSwitchOnly|TestCodexSwitchedWhenUsedUp|KeepLogin' - go test ./internal/agent -run 'TestCodexSwitchOnly|TestCodexFailover|TestCodexOwnModelThroughMagpie|TestCodexHandWritten' - Broken by hand, each red: codexFailover guard removed (agent test), SwitchOnly dropped from the Save copy, SwitchOnly reading false on an unreadable file (provider test), the tick drawn unticked (GUI, 16/16). - GUI: switch-only (new), keep-login, agent-failover, gui-ja, gui-de, gui-zh-tw in Chromium and WebKit, en/zh/ja/de at 1100 and 420: 77 pass. - The built binary's `accounts switch-only` in an empty sandbox HOME: reads off, refuses on with no Codex provider, refuses claude. - gofmt -l clean; darwin go vet. Reviewed and rerun after rebasing onto |