28ba3639436cc116a9d7700de3ec3b6ef69a8921
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
1823ff3a13 |
proc: deepzora and gumloop ask the shared proc.mjs whether a lock's owner lives (#1164)
#1198 (yetihan) moved 15 packages' liveness checks onto scripts/proc.mjs, so a Linux zombie no longer holds a lock. Two were left on a bare kill(pid, 0), which answers for a zombie as for a live process: - deepzora's bridge lock (bridge.mjs lock(), the same code as reasonix-desktop's, which #1198 fixed): a zombie owner left "Another bridge operation is running" until the zombie was reaped. - gumloop's ledger lock peers (gumloop.mjs isAlive): a zombie peer was counted live, so its ticket was waited on. Both now import a synced proc.mjs (scripts/sync-proc.mjs lists 17 copies; both package.json files ship it). gumloop's crash-window test writes its instrumented copy into a temp dir, so proc.mjs is copied beside it. A new guard in scripts/proc.test.mjs fails when any package file outside tests and proc.mjs calls kill(pid, 0). deepzora 0.2.1, gumloop 0.1.2. Run (mote, HOME=$(mktemp -d)): - bun test scripts/proc.test.mjs packages/deepzora packages/gumloop: 111 pass, 0 fail. node --test scripts/proc.test.mjs: 9 pass. - deepzora node --test deepzora.test.mjs: 13 pass. - node scripts/sync-proc.mjs --check: ok. bun scripts/check.mjs: ok. Broken by hand: main's bridge.mjs and gumloop.mjs with the new tests: the guard names both files, and the copies test fails on deepzora. Not tried: a real zombie owner for these two (#1198's fork-based zombie check covers proc.mjs itself); a real Gumloop or DeepZora account. gumloop under node --test fails 3 of 3 on bun:test imports, the same on origin/main. |
||
|
|
edc6dbcd6e |
gumloop 0.1.1: two hosts' charges are never lost (#1011)
Cause: the bakery lock's wait for a peer is bounded at LOCK_WAIT_MS (250ms). When it ran out, Store.change returned undefined and the charge's callback never ran: the chat succeeded and its charge was dropped. Two hosts charging back to back on a busy runner (a GC or scheduling stall in the holder, or many contenders) hit that, which is the 199 of 200 in publish run 43040437938. An unreadable ledger dropped the change the same way. Mutual exclusion itself held: an instrumented copy logged one lock timeout per missing charge and no unexplained loss. Fix: Store.update. A change whose lock wait runs out, or whose read fails, hasn't run, so it is kept in memory (capped at 1000) and runs once, in order, the next time the store holds the lock and can read the ledger: on its next update, from an unref'd retry timer (25ms doubling to 5s, each waiting 25ms), or from the exit hook, which waits up to 2s. A failed read still never writes. A throwing callback still leaves the disk as it was. change, anchor and setPrices go through it. charge and the credit refusal date their record when the call ended, not when a kept change runs. The crash-phase tests' instrumented module goes to a file: as a data: URL on the command line it passed Windows' 32K limit. Tests: the live-owner, leftover-record and choosing tests now hold that the waiting changes land (they asserted the drop). New: a Node and a Bun host that exits while its charge waits for a busy peer still writes it. Ran (worktree at |
||
|
|
7ebab07c2a |
gumloop 0.1.0: API key sign-in, account models and credit estimates (#967)
Gumloop as a provider for magpie and OpenCode: API key + user ID sign-in, the
account's own model list (bare catalog ids mapped back to provider routes, per
account), streaming and tool calls, a missing system prompt supplied for Muse
and MiniMax M3.1 Flash, and a locally calibrated credit estimate (an estimate,
not an invoice). The ledger is written only under magpie's config directory
(kept in memory in OpenCode), a failed read is unknown and never written over,
and updates go through a filesystem ticket lock (bakery) across plugin hosts.
Only a 403 that names the key reads as an expired sign-in, and only Gumloop's
assumed 403 credit_limit_exceeded reads as out of credits. The last change
checks lock contention at least once after a stall, so an uncontended update
that took more than 250 ms to publish its ticket is no longer dropped.
Ran, at the reviewed head 2173d784 (WSL magpie-desktop, Bun 1.4.2, fresh
HOME; Windows 11, Bun 1.4.2, fresh HOME and USERPROFILE):
- bun test packages/gumloop: 87 pass, 0 fail (3x WSL, 2x Windows); the
200-charge overlap test 10x WSL and 5x Windows green; check.mjs exit 0.
- Merged with origin/main
|