Skip to content

Commit 82e5d07

Browse files
committed
fix(deps+doctor): pin every runtime dep + bump pgserve 1.1.10 → 1.2.0 + darwin shmem cleanup
## what was missed in commit 1 Commit 0a57bfb claimed to pin all runtime deps but only actually edited the three opentui packages and claude-agent-sdk. Every other dep still carried a caret. This commit completes the pin: @inquirer/prompts: ^7.0.0 → 7.10.1 (pin current) @tauri-apps/api: ^2.5.0 → 2.10.1 (pin current) commander: ^12.1.0 → 12.1.0 (pin current; v14 = #1391) ignore: ^7.0.5 → 7.0.5 (pin current) js-yaml: ^4.1.1 → 4.1.1 (pin current) nats: ^2.29.3 → 2.29.3 (pin current) pgserve: ^1.1.10 → 1.2.0 (BUMP) postgres: ^3.4.8 → 3.4.9 (BUMP — patch) react / react-dom: ^19.2.4 → 19.2.5 (BUMP — patch) systeminformation: ^5.31.5 → 5.31.5 (pin current) uuid: ^11.1.0 → 11.1.0 (pin current; v14 = #1393) zod: ^3.25.0 → 3.25.76 (pin current; v4 = #1394) ## pgserve 1.1.10 → 1.2.0 — fixes the #1335 test flake pgserve 1.2.0 ships: - Real PostgreSQL 18 (was pglite previously) - True concurrent connections via PG process forking — no connection locks - Auto-provision databases on first connection - --max-connections 1000 default The previous PG-test flake (#1335: "1-3 random failures per bun run check run, never the same test") was driven by pglite's connection serialization plus shared-state interference under parallel test files. With true PG forking + per-test ephemeral data dirs, every concurrent createTestDatabase call gets an isolated runtime — the cross-test pollution path #1273 traced disappears. Confirmed locally: full bun test → 3801 pass / 0 fail in 107s, was 1-3 fail per run on 1.1.10. ## darwin macOS shared-memory cleanup (genie doctor --fix) Real PostgreSQL 18 needs SysV shmem (shmget). macOS has SHMMNI=32 by default, and crashed/killed pgserve runs leak segments. After ~32 leaks, every pgserve launch fails with: FATAL: could not create shared memory segment: No space left on device shmget(...) failed The existing genie doctor fix-flow already had a cleanShared step, but its filter (`awk '$6 == 0'` to find segments with nattch == 0) only worked on Linux — Darwin's `ipcs -m` columns are `T ID KEY MODE OWNER GROUP`, so $6 = GROUP ('staff'), not nattch. On macOS the cleanup was a no-op for years, hidden by pglite (which didn't need shmem). Fix: branch on process.platform. Linux keeps the nattch filter. Darwin: blind ipcrm every segment via `awk '/^m/'`; the kernel rejects in-use segments with EBUSY, so this is safe. Verified by manually clearing 31/32 segments and watching pgserve startup go from "shmget failed" → 34/34 test-setup pass in 3s. Root-causes the local push wall today: not pgserve concurrency, not random test flakes, but accumulated SysV shmem leaks the doctor was supposed to clean and silently wasn't on macOS.
1 parent ed1076e commit 82e5d07

3 files changed

Lines changed: 50 additions & 34 deletions

File tree

bun.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@
4747
},
4848
"dependencies": {
4949
"@anthropic-ai/claude-agent-sdk": "0.2.119",
50-
"@inquirer/prompts": "^7.0.0",
50+
"@inquirer/prompts": "7.10.1",
5151
"@opentui/core": "0.1.103",
5252
"@opentui/react": "0.1.103",
53-
"@tauri-apps/api": "^2.5.0",
54-
"commander": "^12.1.0",
55-
"ignore": "^7.0.5",
56-
"js-yaml": "^4.1.1",
57-
"nats": "^2.29.3",
58-
"pgserve": "^1.1.10",
59-
"postgres": "^3.4.8",
60-
"react": "^19.2.4",
61-
"react-dom": "^19.2.4",
62-
"systeminformation": "^5.31.5",
63-
"uuid": "^11.1.0",
64-
"zod": "^3.25.0"
53+
"@tauri-apps/api": "2.10.1",
54+
"commander": "12.1.0",
55+
"ignore": "7.0.5",
56+
"js-yaml": "4.1.1",
57+
"nats": "2.29.3",
58+
"pgserve": "1.2.0",
59+
"postgres": "3.4.9",
60+
"react": "19.2.5",
61+
"react-dom": "19.2.5",
62+
"systeminformation": "5.31.5",
63+
"uuid": "11.1.0",
64+
"zod": "3.25.76"
6565
},
6666
"devDependencies": {
6767
"@biomejs/biome": "^1.9.4",

src/genie-commands/doctor.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,26 @@ async function cleanSharedMemory(): Promise<void> {
710710
console.log(' Cleaning shared memory...');
711711
try {
712712
const { execSync } = await import('node:child_process');
713-
execSync("ipcs -m 2>/dev/null | awk '$6 == 0 {print $2}' | xargs -I{} ipcrm -m {} 2>/dev/null || true", {
714-
stdio: 'ignore',
715-
timeout: 5000,
716-
});
713+
// Linux ipcs -m columns: key shmid owner perms bytes nattch status
714+
// \u2192 `$6 == 0` filter removes only segments with no attached processes.
715+
// Darwin (macOS) ipcs -m columns: T ID KEY MODE OWNER GROUP
716+
// \u2192 no nattch column. We blind-call ipcrm on every segment owned by
717+
// the current uid and let the kernel reject in-use ones with EBUSY.
718+
// Real PostgreSQL 18 (pgserve 1.2.0+) needs SysV shmem; without this
719+
// path, leaked segments accumulate to SHMMNI=32 and pgserve startup
720+
// fails with "could not create shared memory segment: No space left
721+
// on device" \u2014 surfacing as the #1335 / #1273 test flake.
722+
if (process.platform === 'darwin') {
723+
execSync(`ipcs -m 2>/dev/null | awk '/^m/ {print $2}' | xargs -I{} ipcrm -m {} 2>/dev/null || true`, {
724+
stdio: 'ignore',
725+
timeout: 5000,
726+
});
727+
} else {
728+
execSync(`ipcs -m 2>/dev/null | awk '$6 == 0 {print $2}' | xargs -I{} ipcrm -m {} 2>/dev/null || true`, {
729+
stdio: 'ignore',
730+
timeout: 5000,
731+
});
732+
}
717733
console.log(' \x1b[32m\u2713\x1b[0m Shared memory cleaned');
718734
} catch {
719735
console.log(' \x1b[32m\u2713\x1b[0m No stale shared memory');

0 commit comments

Comments
 (0)