63cd0e4bf92e482cc338a606dea4e208bc20cdb7
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0e3562b25f |
agent-office: frame only fragments unfinished at EOF in cold image scans (#559)
The incremental session scanner frames only fragments still unfinished at
EOF, instead of passing every 64 KiB fragment of a complete cross-chunk
record through the character framer. A framed-part index stops a later
tick from walking text it already framed. Adds regressions for the four
mutation gaps named on #551 and a WebKit CSP diagnostic script.
Reviewed at 5f564b034df26e12b60c40f683922ce0389abdd1 on main
|
||
|
|
7714b617c7 |
agent-office 0.2.0: real 3D office, workbench, incremental session scan
Agent Office 0.2.0 (QingJ01, #551): a real 3D office, the workbench, and the earlier review's fixes. The session scanner now reads growing JSONL logs incrementally. It keeps a saved offset with 128 guard bytes, carries UTF-8 and partial JSON across ticks, applies a record complete at EOF once, and resets on truncation, inode or birthtime change and same-size rewrites. Readers update per kind (Claude response usage replaced, Grok sidecar daily totals replaced, metadata refreshed apart from logs).
Run at the reviewed head 3bf522f, merged on main
|
||
|
|
659967c9bc |
agent-office 0.1.1: an agent another agent killed is stopped, and any agent not at work can be cleared
flying_crp (X, 2026-10-31): when one agent hands work to another and then
interrupts it from the command line, the delegated session hangs in the
Agent Office as abnormal and can't be cleaned up; it only goes once the
session is deleted in magpie.
The cause: a killed agent writes no end of turn. Reproduced in a sandbox
HOME with the real CLIs:
- Codex 0.165 under SIGTERM or SIGKILL: the rollout ends at the
function_call (on SIGINT it writes turn_aborted, which was fine).
- Claude Code 2.1.314 `claude -p` under SIGTERM: a tool_result
("Exit code 137") and no end_turn, and it removes its
sessions/<pid>.json. Under SIGKILL: the file ends at tool_use, and the
pid file stays with a dead pid.
The office read each file as at work, then "error · stuck" once quiet for
ten minutes, until hideAfter (6h, or never; a waiting session never
leaves). The page had no way to take one out.
The fix:
- lib/scan.mjs: for a source with a process folder (Claude Code's
<config>/sessions, also Qoder, WorkBuddy and CodeBuddy), a session
quiet mid-turn for 10s with no live process named in that folder is
read as aborted ("stopped"). A folder that can't be read, a
half-written file, or one that has never held a pid file means
unknown, and nothing changes. A pid file from another pidDomain (WSL)
counts as alive.
- page: Clear (清除) in the panel of any agent not at work (stuck,
error, stopped, done, waiting) hides it until its session moves again.
It is kept in the page's options as {key: at}, pruned to sessions
live.js still has. This covers Codex and every agent with no process
registry.
Run:
- On mote (mote-run): bun test in packages/agent-office gives 54 pass,
0 fail. bun scripts/check.mjs exits 0.
- killed.test.mjs uses the real killed files (test/killed, trimmed and
with paths replaced). With the old scan.mjs, 3 tests fail. With the old
model.js, 2 fail.
- End to end: the real office.hooks.mjs over a sandbox HOME holding the
killed Claude and Codex files and a live lead pid file. live.js had
claude "aborted" and codex "tool". Then the real page in list mode, zh,
at widths 1100 and 420: the Codex row shows 已 N 分 没有动静, its
panel shows 清除, clicking it removes the row, and options.set gets
cleared. Chromium ran on mote. WebKit ran on the Linux box (wsl-run),
because WebKit on mote didn't launch within 180s while ~108 WebKit
processes from other sessions were running. Screenshots were checked
at both widths.
Not tried:
- A Codex liveness signal: its thread-writer-locks are flock-only files,
which Node can't check. Codex relies on Clear.
- Windows: the pidDomain value and process.kill(pid, 0) there.
- Whether Qoder, WorkBuddy or CodeBuddy write pid files at all. Without
them, nothing changes for those agents.
- Gemini, Qwen, dsh and pi killed mid-turn: they have no registry and
rely on Clear.
- The page inside the real magpie window, and WebKitGTK.
|
||
|
|
1e04c1d324 |
agent-office 0.1.0: live agent activity office page (#478)
A new community page plugin by QingJ01: Agent Office, a page in magpie's window that shows each local agent session as a worker in an office (3D/2D) or a list, with status, current step and a resume command.
- Its host part (office.hooks.mjs, an async gateway hook) reads the session files of Claude Code, Codex, dsh, Gemini CLI, Qwen Code, Pi, omp, Qoder, WorkBuddy and CodeBuddy every 1.5 s and writes page/live.js beside the page. It opens no socket and sends nothing off the machine. The page makes no magpie.read calls and loads only its own files.
- Text switch: with text off, the host writes no prompt, reply, error or tool argument (the title falls back to the folder, the step to the tool name), and the page redacts whatever live.js holds.
- Options are read at module load from plugins.json in the host's cwd (magpie's config folder), with the XDG path as a fallback. npm specs are matched with @tag/@version stripped, a path spec by realpath against the package's own folder. It fails closed: text stays off until an install's options or a request's ctx.options turn it on.
- The disclosure (package description, registry summary, root README) says which session files it reads. magpie's install sheet still says "reads nothing" for such a page (yetone/magpie#4187).
Run at the reviewed head e76d1a3, on mote:
- bun test in packages/agent-office: 44 pass, 0 fail.
- The whole repo at origin/main
|