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.
kimi-desktop 0.1.6: separate reasoning effort and an optional context input budget for the primary and secondary roles.
The change (f07e7f4a..1d14a185, since the round-6 approval):
- The settings page and API save `<role>ReasoningEffort` and `<role>ContextTokens` for each role. Only efforts and context limits the catalog publishes are offered; an unknown limit allows no custom budget.
- Inference drops Kimi's top-level `thinking`, `reasoning` and `reasoning_effort`, and sends the chosen effort, or none for the provider default. Kimi's native menu aliases no longer choose the model.
- A custom budget counts a copy of the request through magpie's `/v1/messages/count_tokens`. Over the budget gives 400 `context_length_exceeded`; a failed count gives fixed 503 `context_count_unavailable`. No generation is sent in either case. Without a budget, nothing extra is sent.
- Role-scoped worker profiles (`v2:[model, role]`) tell primary from secondary even on the same model. Older roleless profiles keep their binding and use defaults.
- 1d14a185 removes blank lines only.
Run at 1d14a1859f63fd4bb512d492d1de419ad3e6c79a on mote (macOS, Bun 1.4.2, HOME/TMPDIR/XDG in the run's own folder):
- `bun test` in packages/kimi-desktop: 626 pass, 0 fail, 29 files.
- `bun scripts/check.mjs kimi-desktop`: exit 0.
- 14 hand breaks, each red in the package suite:
- drop `applyReasoningOptions`;
- strip thinking fields only when an effort is set;
- drop the budget check, or make it `>=`;
- `useFresh` false, or without its model check;
- a legacy roleless profile treated as primary;
- a profile name without its role;
- no `registerRoles`;
- no `optionsMatch` in save;
- no `refreshLiveModelOptions`;
- count with `redirect: 'follow'`, or with no reply size limit;
- a 131072 fallback for an unknown catalog context.
- CI at the head: test and on-npm pass. The PR merges onto main f379bf90+ with no conflicts.
Not blocking, left for a follow-up:
- Each inference now reads connection.json (adapter.mjs:547) with no fallback to the live connection. An unreadable file turns every request into 502, even without a budget.
- The comment above `applyReasoningOptions` ("Preserve the legacy connection untouched…") no longer matches the always-strip policy.
Kimi Work's 429/503 through the desktop adapter now keep the upstream
Retry-After (seconds and HTTP-date); no other upstream header is copied.
The adapter's owner record is written whole to a temp file and published with
an exclusive hard link, so a crash mid-write can no longer leave an empty
adapter-owner.json that blocks every later host. A malformed record reports
adapter_lock_invalid (and an access failure adapter_lock_unavailable) in
status.json and the log, instead of failing silently; the README says how to
recover.
Review merge: main (kimi-desktop 0.1.4) merged in, package.json the only
conflict, version 0.1.5.
Run at 3f65c63 (HOME=$(mktemp -d)):
- mote: bun test packages/kimi-desktop 36 pass, 0 fail.
- Windows (xiaomi-gpu, win-run): 36 pass, 0 fail (hard links on NTFS).
- Broken by hand, each reverted: Retry-After not forwarded -> its test red;
the owner record written in place instead of linked -> 3 lock tests red;
a malformed record silently returning false -> the malformed-record test red.
Not tried with the real Kimi desktop app.
Kimi 3.2.21 on Windows, installed on another drive than %APPDATA%'s,
keeps daimon-share at <install drive>\KimiData\daimon-share and writes
%APPDATA%\kimi-desktop\daimon-storage.json ({"version":1,"shareDir":...})
to point there. It writes the same pointer on any system when the user
moves its storage. Both packages read only
%APPDATA%\kimi-desktop\daimon-share, so the sign-in was "not found".
Read from Kimi's own code: Kimi-Setup-3.2.21.exe's app.asar,
out/main/index.js (string table decoded): the shareDir getter is
readPointer(userData) ?? join(userData, "daimon-share"); the pointer
reader takes an absolute shareDir and otherwise the default; the
"install-drive seed" writes the pointer on win32 when installRoot's drive
differs from userData's; driveDataDirName is "KimiData".
Both packages now follow the pointer the same way (unreadable, non-JSON
or non-absolute -> default, as Kimi does). kimi-work's sign-in failure
names the file it looked for, and a failed Work check (network, HTTP)
no longer says no sign-in was found.
Run at this tree (base fc2866f):
- Windows 11 box: installed Kimi 3.2.21 silently to D:\Kimi425, launched
it once (no sign-in): it wrote daimon-storage.json with shareDir
D:\KimiData\daimon-share and no daimon-share under %APPDATA%. Under
bun 1.4.2 there the new desktopFile() is
D:\KimiData\daimon-share\daimon\config.json; 0.1.11's path does not
exist. Kimi uninstalled and its folders removed afterwards.
- New tests force win32, darwin and linux paths (tests/desktop-path.test.mjs,
kimi-desktop/kimi-dir.test.mjs). Broken by hand (pointer ignored):
3 of 6 kimi-work tests red.
- TMPDIR/HOME sandbox `bun test`: 2791 pass, 3 skip, 0 fail;
`bun scripts/check.mjs`: ok.
Not tried: a signed-in Kimi on the other drive (no credentials were
entered), so a real Work request from D:\KimiData is untested. The
kimi-desktop adapter reads the folder once when it starts; storage moved
while it runs is seen on the next start.
The adapter puts the user's shared instructions in a system message of
their own, and its tag went upstream with every prompt naming the app.
This tag is the adapter's own (Kimi's client has no such message), so a
neutral one was picked: <shared-instructions>. A history holding the old
tag from turns before 0.1.3 has that message taken out as before, so no
prompt carries two copies or the old name.
Left as they are, and why: the menu alias magpie-local-<hash> and the
" · Magpie" display name live in Kimi's model menu; the adapter replaces
the alias with the real model id before a request leaves it, so neither
reaches the model.
Run:
- no-magpie.test.mjs: with shared instructions and an old tagged turn in
history the prompt holds no "magpie", one <shared-instructions> message,
and applying twice changes nothing (red on the old code); with no
instructions the old turn is still taken out.
- bun test (package): 26 pass. scripts/check.mjs skips agent packages
(exit 0).
Not tried live: no Kimi Work account here, and Kimi isn't installed on
this Mac or the Windows box.
A model whose catalog lists every reasoning level magpie knows, none of
them "none", is declared always_thinking to Kimi desktop, in its runtime
entry and its menu. Kimi then stops sending an old Off choice to a model
that can't turn thinking off. A model that offers none, lists no levels or
lists an unknown one keeps its old declaration.
Run at the reviewed head fa08b22: bun test packages/kimi-desktop
packages/kimi-work, 65 pass. catalog-thinking.test.mjs against main's
catalog.mjs: 4 of 9 fail (the always_thinking cases), so the test holds the
change. The author's real Kimi 3.2.18.13 runs on Windows are in the PR; not
tried on macOS here.
Ordinary Kimi (agent-kimi-desktop) becomes a Library target: agent.library
names ~/.config/magpie-kimi/AGENTS.md, library-native/mcp.json (format kimi)
and library-skills. bootstrap() links library-native to Kimi's
daimon/runtime/kimi-code/home and library-skills to daimon/skills (junction on
Windows, dir symlink elsewhere); a different object at either path stops with
library_path_conflict. The adapter reads AGENTS.md on every inference request
and inserts one separate system message after the leading system/developer
ones; an unreadable or non-UTF-8 file answers 503 instructions_unavailable.
Run at the reviewed head 5b9f445 (by the reviewer, sandbox HOME, no real
credentials):
- bun test packages/kimi-desktop: 14 pass, 0 fail (95 expects), bun 1.4.2.
- bun scripts/check.mjs: every package ok (agent packages are skipped there).
- Against magpie's own Library code (origin/main e085d6e92): a throwaway Go
test in internal/library loaded this kimi-desktop.agent.js through
agentplug, ran prepareLibrary on a fake Kimi tree, then SaveInstructions,
SaveServer and InstallSkills to the kimi-desktop target. The MCP server
landed in the native runtime mcp.json beside the existing entry, the skill
in daimon/skills, library-native stayed a symlink; applyInstructions put
the written block in as a second system message. RemoveServer,
RemoveSkill and clearing the instructions left the existing MCP entry and
skill, and applyInstructions then added nothing.
- CI on the PR: test and on-npm green.
Not tried: a real Kimi desktop (the author's COMPATIBILITY.md records it on
Windows 11 and macOS). agent-kimi-desktop is not on npm yet; it is served
from the dist branch until the owner's first publish.
Adds agent-kimi-desktop 0.1.0 (kupakupar): Kimi desktop Work on magpie's
Agents page. It moves the runtime's daimon-kimi-code baseUrl to a
loopback bridge and back, through Kimi's local control API.
Re-reviewed at dd8ed2c against the last review at 6c584bb:
1. menu-hook.cjs and selection.mjs are removed; no injected code ships.
2. No full config backup is written. Only before-menu-models.json (the
model list and current choice) is kept, and it is removed on a clean
disconnect.
3. providers.json and settings.json are never opened. The catalog comes
from the gateway's /v1/models with the agent's key and its registered
UA "Desktop Kimi Work".
4. No signal handlers and no process.exit. Restore runs on the 'exit'
event, which fires when magpie closes the host's stdin (host.js
rl.on("close") -> process.exit(0)). The README gives manual recovery
after a SIGKILL.
5. macOS record: COMPATIBILITY.md (macOS 26.6.2 arm64, Kimi 3.2.17
build 3.2.17.4, magpie 0.1.1276, Bun 1.4.3). All four control methods
succeeded, a streamed request returned 200, and a restore followed.
The README says what happens when a private method fails.
6. Search and fetch pass Kimi's own request, with its own key, to Kimi's
own origin, unchanged. This is the user's own account used by that
user, the same rule as #171, so it is accepted.
Run at dd8ed2c, and merged onto origin/main 2ea25b9 together with #171:
- HOME=$(mktemp -d) bun test: 1660 pass, 0 fail (merged: 1668 pass, 0 fail).
- bun test packages/kimi-desktop: 12 pass.
- bun scripts/check.mjs: ok (it skips agent packages).
- git diff --check, npm pack --dry-run (8 files), node scripts/dist.mjs
(packs agent-kimi-desktop@0.1.0).
- Broken by hand: re-adding a SIGTERM handler and a full config backup
turns 3 tests red.
- No CI ran on the PR. No real Kimi or credential was used.