2 Commits
Author SHA1 Message Date
zhou.han 9e86a2c7b7 proc: a Linux zombie no longer holds a lock (#1198)
yetihan (#1198): a lock whose owner is a Linux zombie was held for
good. process.kill(pid, 0) succeeds on a zombie, so 15 packages' lock
and liveness checks counted an exited, unreaped owner as alive.

- scripts/proc.mjs: processStatus(pid) is dead on ESRCH, and on Linux
  also when /proc/<pid>/stat says Z or X; EPERM is "permission", any
  other error "unknown". processAlive / processExists keep each
  caller's old EPERM and unknown-error meaning.
- scripts/sync-proc.mjs copies it into each package (--check in the
  tests); every package's own check keeps its old semantics, now with
  zombies dead. agent-console's daemon bundle and window-warmup's dist
  are rebuilt.
- 15 packages bumped.

Review run at 28ef6622 (mote, HOME=$(mktemp -d)):
- node scripts/sync-proc.mjs --check: ok.
- bun test (whole repo): 8934 pass, 0 fail.
- bun scripts/check.mjs: every package ok.
- window-warmup's build reproduces its dist/plugin.js byte for byte.
  agent-console's bundle diff read line by line: the proc module plus
  esbuild's renumbered imports, nothing else (esbuild isn't installed
  on mote, so it wasn't rebuilt there).
- Real zombie on Linux (WSL, magpie-desktop): a bash child left
  unreaped by an exec'd sleep, /proc stat "Z": the old kill(0) check
  says alive, processStatus says dead; the running process says alive.

Not tried: each package's lock contention end to end.
2026-11-16 12:19:09 +08:00
Alexhang1314520 090b46ba4f agent-nowledge-mem 0.1.0: pick Nowledge Mem's Default, AI Now and Background models in magpie (#821)
Adds packages/nowledge-mem-agent (@magpie-community/agent-nowledge-mem
0.1.0), a kind: agent registry entry and a row in the README's Agents table.
Picking a magpie model for the "Nowledge Mem / AI Now" agent points
Nowledge's Default, AI Now and Background purposes at one native
`magpie:nowledge-agent` provider instance; disconnecting restores what the
user had. Distinct from packages/nowledge-mem (gateway recall/capture).

The descriptor (nowledge-mem.agent.js) records the selection; a
dependency-free Bun main syncs it through Nowledge's /remote-llm/* routes
with a journal, manual-edit detection, a restore phase, a pid lock and 0600
atomic writes. Remote backends need HTTPS with a key, redirects are
refused, and unchanged remote polls back off to 30s.

Reviewed head d3b6e3937b371dea24839fe602818c4e6aa4d03d, merged onto
origin/main 049295f5 (clean). Run on mote (macOS) and WSL2 Ubuntu 24.04,
Bun 1.4.2, HOME=$(mktemp -d) each run:
- bun test packages/nowledge-mem-agent: 28 pass, 0 fail (both machines)
- bun scripts/check.mjs nowledge-mem-agent: ok (it skips agent hooks)
- bun scripts/check.mjs: exit 0
- repo-root bun test: 6608 pass, 20 skip, 0 fail (479 files)

Broken by hand, one at a time, each red on the named test:
redirect: 'error'; the quiet-period return; the remote backoff skip;
!referenced before provider removal; defaultRestored before turning
Remote off; the native provider_type check; the per-purpose shape check;
the sandbox's XDG containment; the sandbox's agent-home deletes; the
sandbox's HOME check (its two halves together; each alone is covered by
the other).

Not tried by the reviewer: a real Nowledge Mem app or nmem (the author
reports a contract run on Nowledge 0.10.115), the opt-in smoke and
contract scripts, the runtime inside magpie's plugin host, Windows.
2026-11-07 12:45:50 +08:00