Repository navigation
inkstone 0.1.4: the sign-in completes itself off Windows, and the key-list wiring guarded where the query lives - #847
nonamelane wants to merge 2 commits into
Conversation
…-community#840 - the wiring test's key-list step is driven through ensureKey with a fake that refuses a paginated /keys (B05: the query going back now turns it red), chatFetch parses the body once and carries no dead key or empty catch, the fake browser builds under a pid-suffixed temp name and sweeps its sibling hashes, the magpie-community#825 test covers the reuse method, the host-shape copy drops the status the host does not take, the soft-refusal retry checks the key list before it builds a second key, and off Windows the sign-in watches the profile's cookie store for the session so the window closes itself (magpie-community#840)
… key-list wiring is guarded where the query lives
|
Thanks, this is a real improvement to the sign-in, and the wiring tests on step ④ are good. I ran the inkstone tests (106/106), Blocking:
Non-blocking:
The 0.1.4 bump is right; dist has up to 0.1.3. I'd land #841's stricter test first and rebase this on it. |
…le probe backoff (#841) The fake GET /api/tokenplan/v1/keys in keys.test.mjs's serveKeys() now behaves like the live platform: no `uaa-token` cookie gives -10002, and any query parameter gives -15100. A new test covers the third listKeys call site, the 401 cleanup in ensureKey: the probe refuses the new key, and the test checks that the refused key is deleted by name (#839). probeWithRetry takes its delays as an optional third argument, and ensureKey passes `probeDelays` through to the probe of a key it just created. The default delays are unchanged, so nothing outside tests behaves differently. The new test passes [0] and doesn't wait through the ~15s backoff. Because lib/ changed, inkstone goes to 0.1.4. Run at the reviewed head c4ab471, merged onto main 7e01fa8, on mote (Bun 1.4.2) with a temp HOME: - packages/inkstone `bun test`: 102 pass / 0 fail - `bun scripts/check.mjs inkstone`: ok - repo-root `bun test` and the full `bun scripts/check.mjs`: CI run 42476974057 at this head, green. The mote run waited 23 minutes behind 10 queued suites on the machine's suite lock and was dequeued without running. Broken by hand, each red: - query back at keyCount's listKeys: 3 fail (blank-prompt create, ten-key limit, the new cleanup test) - query back at pruneKeys' listKeys: 2 fail (both pruning tests) - query back at the 401 cleanup listKeys: 1 fail (the new test; main's tests stayed green there) - listKeys on the bearer instead of the cookie: 7 fail - probeDelays not passed through: 1 fail (the new test runs past bun's 5s limit at 15.0s) #847 (also inkstone 0.1.4) merges cleanly on top, but it has to move to 0.1.5.
|
#841 landed first as e7af785 (inkstone 0.1.4). It changes This branch still merges cleanly on top ( |
inkstone 0.1.4: the sign-in completes itself off Windows, and the key-list wiring guarded where the query lives
Closes #839. Closes #840.
Follow-up to #832 (0.1.3), covering the B05 gap found in review and the #825
follow-up, plus every nit.
B05 (#839): the wiring test now reaches
keys.mjsThe wiring test's key-list step called
protocol.listKeysdirectly — thequery lives at the
lib/keys.mjscall sites, so putting it back left thepackage green (B05, found reviewing #832). Step ④ is driven through
ensureKeynow, and the fake refuses a paginated/keyswith -15100: withthe query restored at all four call sites (the three originals plus the
new verifier below), the test is red.
#840: the sign-in completes itself off Windows
Off Windows the only completion signal was quitting the browser, and the
headless read showed no progress (HuHong-Tao's #825 log). Two changes:
lib/cookieProbe.mjspolls the profile'sDefault/Cookiessqlite for theuaa-tokenrow (the name column is plaintext; the copy-then-query dancesidesteps Chrome's lock). The wait closes the window itself once the
session lands — the same behavior Windows already had. The probe is
swappable, the old exit-only path stays as the fallback, and the log
carries the progress: watching the cookie store → closing the window →
reading the session → waiting for the cookie → creating the key.
every platform.
The probe is tested against a real (test-built) sqlite database: the row
found, other cookies not matching, a profile without the store, a file that
is not a database, the probe ending the wait, and zero title reads off
Windows. macOS verification itself stays with the #825 reporter, as agreed.
The nits
chatFetchcarries no deadkeyparameter and no empty try/catch.~60 MB directory behind) and builds through a pid-suffixed temp name
(two concurrent runs cannot race on one temp file).
hostShapeRefusedcopy no longer accepts status 226.precheckImages(obj)and the newrewriteBodyObj(obj)share the object (near the 40 MB cap, twice waswaste);
rewriteBody(text)remains as a wrapper.reasoning fields answering 200 with identical output on the free models).
that actually created the key is answered with the -15108 wording (the
plaintext is shown once), never a second
ink-*key. Tested with a fakethat creates on the first POST and refuses with -15100.
Version
0.1.3 → 0.1.4.
What was run
bun test packages/inkstone: 106 pass / 0 fail (600 expects) inAsia/Shanghai, UTC, America/Los_Angeles and Pacific/Kiritimati.
bun scripts/check.mjs: exit 0 (agy-cli's copy rides along).listKeyscall site in
keys.mjs(B05), the cookie probe off (inkstone: macOS/Linux browser sign-in has no completion signal but quitting the browser, and no progress (#825 follow-up) #840), thecreated-key check off (nit 7), and the full battery from inkstone 0.1.3: image-caps preflight, a zero-prompt browser sign-in, and the #824 follow-ups #832's round —
the four caps, the 4/3 formula, the refusal stem, the exclusion word, the
translation, the rewrite, the precheck, the pasted key, the prompt on the
zero-prompt method, the two-hit rule.