tabbit 0.1.2: send a fresh unique-uuid on every call, so web.tabbit.ai's sign-in gate lets chat turns through (#837)

web.tabbit.ai answers a chat turn's runs call with 429, code 492 ("Welcome
to Tabbit Browser...") unless the request carries a unique-uuid header.
Tabbit Browser sends a fresh uuid on every API call (a net-export capture
showed four different values across runs, two joins and usage), and the
gate accepts any well-formed one. headersFor now adds
crypto.randomUUID() as unique-uuid to every request, on both sites.
Version 0.1.2; the README's international-site note describes the gate
instead of saying turns are refused (#834).

Test: tests/unique-uuid.test.mjs posts two runs on each site through a
mocked fetch and asserts a v4 uuid that differs per call. No network.

Run at 1bffccd6 merged onto main d34785ae (mote, Bun 1.4.2 / Node 22,
temp HOME): packages/tabbit node --test 72 pass / 0 fail, bun test 72 / 0;
bun scripts/check.mjs tabbit and whole repo ok; repo-root bun test 6827 pass / 0 fail (6847 run, 314s).
Broken by hand: main's api.mjs under the head's tests turns both new tests
red (0 pass / 2 fail). CI run 42380909152 green.
0.1.2 is not on dist (0.1.0, 0.1.1) or npm.
Not tried: any real call to web.tabbit.ai or web.tabbit.com.
This commit is contained in:
Binyu Wang
2026-11-07 22:36:48 +08:00
committed by GitHub
parent 49d4042e5b
commit 7d84184c32
4 changed files with 32 additions and 6 deletions
+6 -5
View File
@@ -57,11 +57,12 @@ refuses it, `web.tabbit.ai` is asked once, and the site that accepts it serves
that token from then on (a token both refuse is an expired sign-in, as that token from then on (a token both refuse is an expired sign-in, as
before). A `web.tabbit.com` token never asks `web.tabbit.ai` anything. before). A `web.tabbit.com` token never asks `web.tabbit.ai` anything.
> **International site, chat turns:** as of 2026-11-07, `web.tabbit.ai` > **International site, chat turns:** `web.tabbit.ai` answers a turn's
> answers a turn's `runs` call with `429`, code `492` ("Welcome to Tabbit > `runs` call with `429`, code `492` ("Welcome to Tabbit Browser...") unless
> Browser…"), a gate the web app passes from inside the browser (#833). > the request carries a `unique-uuid` header — the browser sends a fresh
> Sign-in, the catalog, usage and the check-in work there; turns pass that > uuid on every API call, and the gate accepts any well-formed one (a
> `429` through until the gate is solved. > net-export capture of Tabbit Browser's own traffic showed the header on
> `runs`, `join` and `usage`). The plugin sends one per call (#834).
There is no refresh endpoint. When the token runs out (7 days), magpie shows There is no refresh endpoint. When the token runs out (7 days), magpie shows
the account as needing a sign-in again and the first method takes one more the account as needing a sign-in again and the first method takes one more
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@magpie-community/opencode-tabbit-auth", "name": "@magpie-community/opencode-tabbit-auth",
"version": "0.1.1", "version": "0.1.2",
"description": "Tabbit (web.tabbit.com and web.tabbit.ai) as a magpie / OpenCode provider: live model catalog, cookie sign-in, chat completions, cycle usage and the daily check-in", "description": "Tabbit (web.tabbit.com and web.tabbit.ai) as a magpie / OpenCode provider: live model catalog, cookie sign-in, chat completions, cycle usage and the daily check-in",
"type": "module", "type": "module",
"main": "./opencode.mjs", "main": "./opencode.mjs",
+6
View File
@@ -158,6 +158,12 @@ function headersFor(creds, site, extra) {
cookie: creds.header, cookie: creds.header,
accept: "application/json", accept: "application/json",
"user-agent": UA, "user-agent": UA,
// web.tabbit.ai's browser sign-in gate (429 code 492 "Welcome to Tabbit
// Browser") refuses a turn whose request carries no `unique-uuid`: the
// browser sends a fresh uuid on every API call, and the gate accepts any
// well-formed one. Measured against a live signed-in session on .ai;
// .com ignores the header.
"unique-uuid": crypto.randomUUID(),
origin: site, origin: site,
referer: `${site}/newtab`, referer: `${site}/newtab`,
...extra, ...extra,
@@ -0,0 +1,19 @@
import test from "node:test"
import assert from "node:assert/strict"
import { runTurn } from "../src/api.mjs"
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
for (const site of ["https://web.tabbit.ai", "https://web.tabbit.com"]) {
test(`runs on ${site} carries unique-uuid`, async () => {
const seen = [], original = globalThis.fetch
globalThis.fetch = async (input, init = {}) => { seen.push(new Headers(init.headers ?? {})); return Response.json({ run_id: "r", status: "QUEUED" }) }
try {
const creds = { token: "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ1LTEifQ.sig", header: "token=[REDACTED_VALUE]", site }
await runTurn(creds, "room-1", { content: "hi", model: "Default" })
await runTurn(creds, "room-1", { content: "hi", model: "Default" })
assert.match(seen[0].get("unique-uuid") ?? "", UUID)
assert.notEqual(seen[0].get("unique-uuid"), seen[1].get("unique-uuid"))
} finally { globalThis.fetch = original }
})
}