Commit Graph
6 Commits
Author SHA1 Message Date
yetone efd8da8064 tabbit 0.1.3: the international app's sign-in reads "Tabbit Safe Storage", and Keychain failures say what to do
Signing in with "Read Tabbit Browser sign-in" failed at once, with no
Keychain prompt, as "Command failed: security find-generic-password -s
Tabbit Browser Safe Storage -w" (shiqi_40904, Discord, macOS 27.2).

Cause: Tabbit ships two macOS builds, and the plugin knew only one
Keychain name. Read out of both 1.16.27 installers (Info.plist, and the
framework code that picks the name from a flag set at start-up):
- Tabbit.app (com.tabbit-ai.Tabbit, international): data folder
  ~/Library/Application Support/Tabbit, service "Tabbit Safe Storage",
  account "Tabbit".
- Tabbit Browser.app (com.tab-browser.Tabbit, China): data folder
  "Tabbit Browser", service "Tabbit Browser Safe Storage", account
  "Tabbit Browser".
The plugin found the international store and asked for the China name;
security answered "item not found" (exit 44) with no prompt. The spaces
were never the problem: the name was already one argv entry, and the
message is only Node's way of printing the command.

Now:
- Each store asks its own build's item first, then the other's.
  Not found moves on at once; security only prompts for an item that
  exists, so a not-found never waits for a prompt.
- With both builds installed, the store that is signed in is read.
- The Keychain call is async with a 2-minute timeout (it was a 15 s
  execFileSync that dropped stderr), so the user has time to answer.
- Errors say what to do: not installed or not signed in -> open Tabbit
  and sign in; not in the Keychain under either name (both named);
  prompt denied (128/51) -> click Allow; no answer in time; keychain
  locked (36); anything else carries security's own stderr. Each
  points at "Paste Tabbit token".
- The method is now "Read the Tabbit app's sign-in (macOS)"; README
  lists both builds.

Run on mote (macOS, Node 22.22.0, Bun):
- node --test tests/*.test.mjs: 83 pass, 0 fail. bun test (temp HOME):
  83 pass. bun scripts/check.mjs: exit 0.
- Broken by hand: safeStorageNames returning only the China name (the
  old behaviour) turned 3 tests red, among them "the international
  build signs in with its Tabbit Safe Storage item (the report)".
- Again after rebasing onto ff9d3a64 (the pushed parent; it changed only
  system-prompt and trae): tabbit node --test 83 pass, whole-repo
  bun test (temp HOME) 7588 pass 0 fail, check exit 0.
- Tests use a fake security and fixture cookie stores; nothing reads
  this machine's Keychain or browser profiles.

Not tried: a real Tabbit account or a real Keychain prompt (none here),
so the prompt's exit codes come from Security.framework's OSStatus
values, not a recorded run. Dev builds' "TabbitDev ..." names are not
tried. magpie pins no min for tabbit (git grep finds none).

Reported-by: shiqi_40904 (Discord)
2026-11-09 17:17:41 +08:00
Binyu Wang 7d84184c32 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.
2026-11-07 22:36:48 +08:00
我是一条没有名字的区 087c36123d inkstone 0.1.3: image-caps preflight, a zero-prompt browser sign-in, key calls on the session cookie (#832)
inkstone 0.1.3 (#832, yunwang2442-creator):

- Image requests are prechecked before they leave: 8 images, 10MB each, 40MB in all.
  - A request over a cap gets a local 400 shape refusal, so magpie asks the next account and rests none.
  - The plan's invalid_media / media_fetch_failed / unsupported_media_type errors become the same kind of refusal.
- The body rewrite strips the reasoning fields and sets image detail to auto.
- A zero-prompt browser sign-in comes first, and a second browser method reuses a pasted key.
  - Neither browser method is offered when no Chromium-family browser is found (#825).
- The /keys calls ride the session cookie, without the pagination query. Key creation retries the console's -15100 "refresh page and retry".
- The #826 metadata token read is kept, and its test is back.
- The fake browser is built once per user and source hash (#824), and the title wait reads only on Windows.
- maxConcurrency is 4.
- The doubled comment line is dropped from every opencode2.mjs copy, agy-cli's included.

Reviewed at 88e66bde, on mote (macOS, Bun 1.4.2) with a temp HOME:
- full bun test: 6853 pass / 0 fail; both checks exit 0
- bun scripts/check.mjs and bun scripts/check.mjs inkstone: exit 0
- 21 hand breaks: 20 red, 1 not caught (the /keys pagination test calls protocol.listKeys directly; follow-up filed)

Not tried: a real InkStone account or sign-in, Windows and Linux runs.
2026-11-07 22:24:56 +08:00
yetone 50bb3f5ad2 tabbit 0.1.1: international accounts are served by web.tabbit.ai (#833)
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
2026-11-07 19:57:13 +08:00
我是一条没有名字的区 e7004d9354 inkstone 0.1.0: Intern InkStone (书生·端砚) Token Plan, browser sign-in, credit card and ink-* key chat (#775)
New package @magpie-community/opencode-inkstone-auth 0.1.0 for Intern
InkStone (书生·端砚, Shanghai AI Lab) Token Plan, provider id
`intern-inkstone`. Community package by yunwang2442-creator.

What it does:
- Browser sign-in (Edge/Chrome, its own profile under
  $XDG_CONFIG_HOME or ~/.config/magpie/inkstone-browser, or
  %LOCALAPPDATA%\magpie\inkstone-browser). The login window has no
  debugging port. A headless CDP read takes the uaa-token cookie, and the
  same read renews it silently later.
- Usage card: ink-credit balance, 5-hour and 7-day windows, credit packs.
- Chat: a pasted ink-* API key, or one the sign-in creates, named
  ink-<host4>-<acct4>-<rand4> (18 of the console's 20 characters). An
  idempotency clash (-15109) retries with a fresh name, up to three times.
  Pruning is on by default. It only touches this machine's and account's
  prefix, keeps the newest two and the key this sign-in created, and never
  deletes manual keys or keys of unknown age.
- Closing on Unix: SIGTERM, then SIGKILL only after a 15s grace. Leftover
  browsers are matched by --user-data-dir=<escaped profile>, and Windows
  uses .Contains().
- The login wait comes from an injected waitForLogin in tests. No env
  hook is left in production code.
- Hosts: discovery.intern-ai.org.cn, discovery-api.intern-ai.org.cn,
  127.0.0.1 (CDP).

Outside the package: scripts/opencode2.mjs lets a prompt with
`required: false` stay optional (`p.required !== false`). Every package's
copy is synced byte for byte, so all 39 copies in the merged tree are blob
afe074cb. No other package sets `required: false` on a prompt, so this
changes nothing for them. Also a root README row and a registry entry.

Review at 36412a15, on mote, HOME=$(mktemp -d), Bun 1.4.2:
- bun test packages/inkstone: 68 pass, 0 fail in Asia/Shanghai, UTC,
  America/Los_Angeles and Pacific/Kiritimati.
- bun scripts/check.mjs inkstone and bun scripts/check.mjs: ok.
- bun test (repo), on 36412a15 merged with origin/main e7cb9dc5:
  6743 pass, 20 skip, 0 fail. main has since moved by cline 0.1.14 and
  zcode 0.1.55 only, and none of the adapter copies changed.
- Broken by hand, each red: no protectName protection; prune_keys default
  off; no post-sign-in prune; no SIGTERM on close; the -15109 retry keeping
  its name.

Not tried: a real InkStone account sign-in on macOS, Linux or Windows (no
account here); a live chat request; magpie end to end with the plugin.
2026-11-07 15:07:06 +08:00
hclhcl 7ea611975a tabbit: Tabbit (web.tabbit.com) as a provider, with live catalog, check-in and cycle usage (#673)
Adds @magpie-community/opencode-tabbit-auth 0.1.0 (packages/tabbit) and its
registry.json entry. Tabbit (web.tabbit.com) becomes a provider:
- A live model catalog.
- Turns run as room -> run -> SSE join. Each turn has its own stream
  timeout (TABBIT_STREAM_TIMEOUT_MS, default 300 s), and the 30 s request
  timeout no longer covers join.
- A run is stopped through /proxy/v0/chat/stop/ when the client aborts or
  the stream times out.
- A cut turn ends as an error event (streaming) or a 502, never as a
  "stop" finish, and its room is not reused.
- Rooms are keyed by account and session, with a 30 min TTL and a cap of 256.
- 400/401/403/404/429 pass through with retry-after.
- The daily desktop_pet check-in is free.
- Cycle usage.
- macOS desktop sign-in reads the Tabbit Browser cookie store from a temp
  copy that is removed in a finally. Windows and Linux paste the token.

Run at 5be6e90 on mote (macOS):
- bun test: 58 pass. node --test tests/*.test.mjs: 58 pass.
  bun scripts/check.mjs: ok.
- Broken by hand, and each change turned its test red:
  - no rmSync of the cookie copy;
  - 429 not passed through;
  - room keyed by session only;
  - stop sent on an already-aborted signal;
  - no abort listener on the request;
  - streaming truncation ignored;
  - the old truncation rule;
  - totalTimeout back on join;
  - no wake of a quiet reader;
  - onTimeout not called;
  - no room pruning.
- Probes against a local SSE server:
  - A 35 s turn gives 200 under Bun (streaming and non-streaming) and under
    Node.
  - A silent stream with TABBIT_STREAM_TIMEOUT_MS=3000 ends at 3 s under
    Bun and Node (an error event, or a 502 non-streaming), and the server
    sees the stop at 3 s.
- tabbit-* temp dirs in TMPDIR: the same count before and after the bun and
  node runs.

Not tried: a real Tabbit account.
2026-11-03 21:39:56 +08:00