Tabbit runs two sites with one API: web.tabbit.com (China) and
web.tabbit.ai (international). Each site refuses the other's tokens.
The plugin only knew .com, so every international account was refused
with 401 "invalid bearer". The reporter saw this as a lost sign-in.
The site is now picked by the account, with nothing to set:
- A desktop sign-in reads the token from whichever host's cookie has
it, web.tabbit.com or web.tabbit.ai. The host's own hash prefix
unseals it, and the site is recorded in the account's metadata.site.
- A pasted token, or an account from before this change, starts on
.com. If .com refuses it, the same request is sent once to .ai.
- If .ai accepts it, the token is remembered as .ai's for the process.
- If both sites refuse it, it stays on .com and is reported as an
expired sign-in, as before.
- If .ai can't be reached, nothing is settled.
- A 429 or 5xx settles nothing either.
- The catalog answers any token, so it settles nothing. The model list
asks usage first to learn the site, so an international account gets
.ai's catalog.
- Origin and Referer follow the site.
Not fixed here: .ai answers a chat run with 429 code 492 ("Welcome to
Tabbit Browser"), its browser sign-in gate. Sign-in, the model list,
usage and check-in work on .ai. Turns get the 429 passed through as it
is, not marked as a lost sign-in. The README says so.
Run on mote (Bun 1.4.2, Node 22, HOME=$(mktemp -d)):
- packages/tabbit: bun test 70 pass, 0 fail; node --test 70 pass, 0 fail.
- bun scripts/check.mjs tabbit: ok.
- Repo-wide bun test: 6797 pass, 20 skip, 0 fail (6817 tests, 492 files).
The new tests use the reporter's literal bodies from #833 (the 401
"invalid bearer" and the 492 gate JSON) against a stubbed fetch, so
nothing reaches the network.
- Against the old src (the new tests kept), 8 of the 9 site tests
fail on their assertions, and so do both new cookie tests ("not
signed in to web.tabbit.com"). The one that passes is the .com
regression test, as it should.
Broken by hand, each change red in exactly the test meant for it:
- (a) no learning when both sites refuse: "a token both sites refuse".
- (b) an unreachable site settles .com: "web.tabbit.ai out of reach".
- (c) no usage probe before the catalog: "an international token's
model list".
- (d) learning on any non-refused answer: "a 5xx or the catalog
settles no site".
Not tried:
- a real web.tabbit.ai or web.tabbit.com account;
- a real Tabbit Browser cookie store holding a web.tabbit.ai row (its
host_key is assumed to be web.tabbit.ai);
- getting past the 492 gate on .ai.
No magpie-side change is needed: magpie has no tabbit mover or min.
Reported-by: Beyfish