28ba3639436cc116a9d7700de3ec3b6ef69a8921
13
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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. |
||
|
|
14296209ea |
agent-console 1.3.8: scrolling up near the bottom leaves it at once, open the project in an IDE, reveal in the file manager (#1108)
Scrolling up near the bottom of the timeline now leaves stick-to-bottom at once. The project can be opened in the first IDE found (Cursor, VS Code, Windsurf, Zed, IntelliJ IDEA, WebStorm, Sublime Text) through argv arrays with shell:false, and a file or folder can be revealed in Explorer, Finder or the file manager. Reveal refuses absolute paths and "..", and checks the target's realpath against the project's real root. By qingnian108. Run at the reviewed head ad88364f4 on Linux (WSL magpie-desktop, Node 22), in a standalone copy of the package: - npm ci; npm run check (daemon + web tsconfig): clean - vitest run: 75 files, 585 passed, 21 skipped - npm run verify:build: app/* and daemon/dist/main.js(.map) match a rebuild from source byte for byte - bun scripts/check.mjs agent-console: ok Broken by hand: with files.reveal's realpath containment check removed, "files.reveal refuses a symlink that resolves outside the project" is red (1 failed, 14 passed); restored, 15/15. Not tried: a real IDE launch or reveal on Windows or macOS (the Windows branches ran only through injected-deps tests), and the scroll change in a real window. |
||
|
|
86778e6646 |
agent-console 1.3.7: auto-detect unlabelled code blocks, html-only sanitize, Windows desktop reconnect through Magpie's Try again (#792)
Code blocks are drawn in the same pass as the Markdown, so a streaming reply no longer flickers. Two fixes from the review on 40eb3027:
- An unlabelled fence is detected by highlight.js again (`highlightAuto`, behind a 128-entry LRU). Only a fence that is still open at the end of a streaming message stays plain "text" (`isClosedFence`, which follows marked's fence rule).
- DOMPurify is back to the html profile only. The code-block icons are per-load random placeholders until after sanitize, and `codeBlockKey` is gone.
The Windows desktop reconnect is also fixed. `safeBackUrl` (gate, wrapper and web) takes loopback Magpie pages only, never `http://wails.localhost`. WebView2 can't route a 127.0.0.1 frame's request there, so it showed its gray error page. In the desktop window the wrapper, or an unwrapped daemon page, posts `{magpie:1, method:"error"}` instead, and Magpie's pluginpages.js answers with its Try again card. A stale stored wails back URL is dropped.
Reviewed at c520fa46 (merge base
|
||
|
|
654d3bea1c |
agent-console 1.3.6: keep chat pinned to the bottom on tall virtualized replies (#787)
agent-console 1.3.6: the chat stays stuck to the bottom as virtualized rows measure taller than their estimate, while a reply streams, and when a hidden view becomes visible. Only an upward scroll during a user gesture leaves the bottom, and jump follows rows as they measure. An ACP default model the session skipped is no longer recorded as synced, so the next idle send tries it again. Reviewed at baf6475e on mote (HOME=$(mktemp -d), Node 22, npm ci --workspaces=false): tsc daemon+web ok; verify:build byte for byte; vitest 73 files, 544 passed, 17 skipped, with chat-scroll-browser run in Chromium 1248 rather than skipped; bun scripts/check.mjs agent-console ok. With origin/main's Chat.tsx and manager.ts put back and app/ rebuilt, the browser test fails (gap 760 > 2) and both new manager tests fail. 1.3.6 is the next version after dist's 1.3.5. Not tried: the real magpie webviews. PR CI green. |
||
|
|
856ad934a2 |
agent-console 1.3.5: Windows reconnect, per-provider model refresh, Magpie per-agent filter (#786)
agent-console 1.3.5: Windows reconnect through wails.localhost (Windows, http, no port only), model picker refresh keyed on a per-provider fingerprint of magpie's and the agent's own files, Magpie per-agent model filter, explicit picks forced past the snapshot, gateway URL anchored after the port.
Reviewed at 44661c8 on mote (fresh HOME, npm ci --ignore-scripts, Node 22): npm run check ok; vitest 535 passed, 17 skipped, 1 known flake also on main
|
||
|
|
39f5427420 |
agent-console 1.3.4: Stop ends the turn at once on ACP, Claude and Codex (#768)
Stop now ends the turn at once, and a resend right after it is safe, on all three paths: - ACP (Devin, Cursor, Copilot, OpenCode, Pi, dsh): session/cancel goes as a notification, the local turn ends at once, and a resend waits for the cancel and the previous prompt to settle. - Claude: the result FIFO (turnGen, awaitingResult, skipResultGens) lives on each CLI process, and a replaced CLI's leftover stdout is ignored. After a crash the queue stays open, so the next send resumes with --resume. - Codex: a turn whose turn/start response arrives after Stop is interrupted by its own response id. Run at 0cf12a96 on mote with HOME=$(mktemp -d): - root bun test: 6171 pass, 0 fail; - bun scripts/check.mjs agent-console: ok; - in packages/agent-console: npm ci, npm run check (tsc) and npm run build are ok, daemon/dist is byte-identical to the committed one, and verify:build is OK; - npx vitest run: 68 files, 507 passed, 17 skipped. Broken by hand, then acp-interrupt, claude-cli and codex-interrupt were run again. Each mutant was red: - codex: wasCancelled forced false: 1 fail; - codex: interrupt() no longer ends the local turn: 5 fail; - acp: pendingCancelSettle not awaited: 1 fail; - acp: the late prompt settle ends the turn without the activeTurnId guard: 1 fail; - claude: a replaced CLI's stdout no longer ignored: 1 fail; - claude: interrupt no longer marks its gen in skipResultGens: 2 fail; - claude: a crash closes the queue instead of setting needsRestart: 2 fail. Not tried: a real Claude or Codex CLI. The PR says Devin 3000.11.3 was tried live. Not blocking: a Codex turn/start response that arrives after turn/completed sends an extra turn/interrupt and leaves one staleCodexTurns entry. |
||
|
|
41e90a18d3 |
agent-console 1.3.3: reconnect on return, sidebar dots, permission-wait, chat icon (#760)
qingnian108's follow-up to #747 and #758, on top of 1.3.2.
- A permission request still open when its turn ends is cancelled by the
daemon (manager and ACP session both), and an ACP request the Agent
withdraws ($/cancel_request, through the handler's AbortSignal) closes
as cancelled. The page waits only on cards that still show buttons, so
a finished turn no longer leaves 等待授权 with nothing to click. The
等待授权 pill scrolls to the waiting card.
- 添加到对话 uses a speech-bubble icon.
- Sidebar dot: blinks while running, green after a completed turn, red
on failure, amber while waiting.
- Wrapper: every disconnect / invalid-link end state offers Reconnect;
the last safe back URL is kept in sessionStorage (safeBack re-checked
on read). Coming back to the page (visible / focus) probes the child
for 4 s instead of waiting out timers pushed back while hidden.
Review (head 0c8ee32b): every changed source line read. 1.3.2's Codex
model_catalog_json change is kept (codex/provider.ts untouched, rebuilt
dist still carries it). No new network in tests, page text set through
textContent/React, no new timers in the page or daemon; the wrapper's
sessionStorage back passes the same loopback check (tested with an evil
stored value).
Run (mote, macOS), standalone copy of packages/agent-console:
- npm ci; npm run check OK.
- vitest: 65 files, 489 passed / 17 skipped.
- npm run build, then verify:build: committed app/ and daemon/dist
identical to the rebuild.
On the PR merged onto main
|
||
|
|
7e70a23ca3 |
agent-console 1.3.2: Codex's picker lists model_catalog_json's models (#758)
With a custom Codex provider, listModels read only config.toml's `model` and `[model_providers.<p>].models`, so a config whose models live in `model_catalog_json` (as magpie writes it) showed one "Default" row (wwenc6621, #758). parseCodexConfig now reads `model_catalog_json` (a profile's first), and the picker lists that file's models: slug as the id, display_name as the label, supported_reasoning_levels/default_reasoning_level as the levels. Entries whose visibility isn't "list" are left out, as Codex's own picker does. The path is resolved as Codex's AbsolutePathBuf does it (checked in openai/codex codex-rs/utils/absolute-path): "~" and "~/..." are home, a relative path is taken from config.toml's folder. Codex doesn't expand environment variables; a leading $HOME / ${HOME}, as in the reporter's config, is expanded here too. The configured model stays the default; `models = [...]` entries missing from the catalog are kept after it. A missing or unparsable catalog logs a warning and keeps the old list. Run (mote, macOS): - vitest: 62 files, 466 passed / 17 skipped; `npm run check` OK. - `npm run build`, then `verify:build`: committed dist identical. - root `bun test packages/agent-console` 6/6; `bun scripts/check.mjs` OK. - A real magpie-written catalog (33 entries, 31 listed): 31 rows with display names and levels. Broken by hand: the new test file against main's provider.ts: 4 of 5 tests red (the reporter's config gives only the one model); the fifth, missing/broken catalog, passes on both by design. Not tried: the console UI itself with a live Codex, and Windows/Linux. |
||
|
|
2c4e76dbba |
agent-console 1.3.1: 全部自动同意 (Auto-approve all), split out of #727 (#747)
Auto-approve all (全部自动同意) ships in agent-console 1.3.1, split out of #727 (qingnian108).
The mode is off by default. In it, Codex runs with its sandbox off and Claude Code skips its checks. Cursor, OpenCode and dsh requests are answered allow-once by the console, never allow_always or acceptForSession. Each auto answer is saved with `auto: true` before the Agent goes on, and a banner shows while the mode is on. Plan confirmations and questions still ask. A 1.2 默认 of 全部放行 is not silently upgraded to real auto-approve. Pi keeps the `default` mode id ("Pi never asks"), so switching Agents before the first message never carries auto-approve into an Agent the user didn't pick.
Reviewed at 7e55c87ca merged onto main
|
||
|
|
5703c9f18a |
agent-console 1.3: reviewed features from #727 and timeline polish (#733)
This carries #727's reviewed part forward, without auto-approve (that comes as its own PR). Permission behaviour is the same as 1.2. - Windows Git Bash detection, never the WSL System32 bash. It can be overridden in Settings and is passed per spawn only. - GBK / system code page decoding of raw process output. - Folded tool steps that don't wrap at ~600px. - Select-to-quote, and copy/edit under the user bubble. - Instant send with the echo replacing the bubble in place, and retry when a send fails. - `/app` heals itself after sleep/wake. `frame-ancestors` is limited to loopback and Magpie's window. - Grayscale timeline polish: one-line tool rows, a task-list pill, a reply footer and code blocks. - Test fixes: - The `initializing` push is awaited. - `afterEach` waits for the thread store's writes. - `runtimeInfo().starting` is exposed, and the steer test waits on it. - "idle recycling" waits for closed. Run on mote (macOS) at 65ab7c94: - `npm ci`, `npm run check` and `build` are ok; `verify:build` gives 5/5 OK. - Full `vitest run` x5: 4 green (427 passed). One red, "send while running → queued", is a race that is on main too. - Cause: `setStatus(idle)` runs before `queue.shift()`. - A 300ms pause injected there makes it red 3/3 on main and on this head. - Filed on #585 with the cause and the repro. - Focused send-latency + manager runs: 12/12. `e2e:v1`: 25/25, with no pageerror or console error. - Broken by hand: - With the old steer wait and the mock send held 400ms, the test is red 3/3; the new wait passes 3/3. - With `recycleIdle` made a no-op, "idle recycling" goes red. - Playwright render: - Chromium and WebKit × zh/en × light/dark × 1280/420. - No gradients, no coloured left borders, no `<select>`, no page errors. - At 420 the page scrolls sideways (scrollWidth 480), the same as main. Not tried: Windows (Git Bash detection, GBK decoding) and a real agent, rather than the mock. |
||
|
|
270b228a96 |
agent-console 1.2.0: Preview tab, chat links, file chips, font size/width settings, live magpie theme (#582)
agent-console 1.2.0 by qingnian108 (#582): Preview tab, chat links, file chips, font size/width settings, live magpie theme. Reviewed and run at c459773107caa20f7063d12b2133c230f91c066c (mote, macOS, Node 22, sandbox HOME): - npm ci --workspaces=false; npm run check ok; npm test: 48 files, 339 passed, 17 skipped; npm run verify:build 5/5 OK; bun scripts/check.mjs agent-console ok. - Only test/v1/ws.test.ts changed since the last reviewed head 66d1070 (the new "preview.open returns host from previewHost()" test, through registerMethods). - Broke by hand: methods.ts `return { ...r, host: previewHost() }` -> `return r;` turns that test red (1 of 5); restored, green. Changing previewHost's body alone stays green, as the test compares to previewHost(); fix582.test.ts covers its values. - Earlier reviews' findings (per-listener key host, nonce/canary, gateway port + identity check, mentions path, Darwin major from the daemon) were checked in the earlier rounds. The proxy listens on 127.0.0.1 only and answers only the keyed Host. - Not run: preview-attack.mjs browser half at this head, Windows box. |
||
|
|
08ad5e3956 |
page-agent-console 1.1.0: QA fixes, neutral accent, own dropdown menus, self-heal after a host restart, by qingnian108 (#569)
page-agent-console 1.1.0, by qingnian108 (#569). QA fixes B1-B21, a reworked UI, a new logo, and self-heal after a plugin host restart. In this version: - Accent: a fixed neutral grey (charcoal in light mode, light grey in dark mode). Magpie's accent tokens are dropped on purpose. Surfaces, text, lines, fonts and semantic colours still follow magpie. - Every native <select> (composer effort/mode/Cursor fast, Settings, Debug) is now the page's own SelectMenu, a button plus a listbox. - The registry summary again discloses the 127.0.0.1 service and its lifecycle, that only its own page gets the token, the ~46 MB first install, and that Claude Code isn't bundled (en, zh). - session.js is written once at bind with beat:false, and beats every 4s only after the first /open. A new host deletes a dead host's session.js at startup (owner pid in session-owner.json, outside the page folder). - The daemon swallows console EPIPE after a hard host kill and handles a lifeline close once. Run at 930c6e2 on macOS (mote, Node 22), in a fresh copy: - npm ci, then npm run check (tsc daemon + web): ok - npx vitest run: 46 files, 288 passed, 17 skipped - npm run verify:build: app.js, app.css, index.html and daemon/dist/main.js(.map) rebuild byte-identical - bun scripts/check.mjs agent-console: ok - Playwright Chromium and WebKit, light and dark, sandbox HOME, page served under /_magpie/plugin/<id>/page with a stub bridge passing accent #ff0000: - accent: --accent and the primary button stay grey (rgb(38,38,38) light, rgb(229,229,229) dark); no <select> anywhere. - Settings menus: click opens the menu inside the window; ArrowDown+Enter picks, closes and refocuses the trigger; the pick persists through the daemon. - Esc closes the menu, not the dialog, and then closes the dialog. Clicking an option keeps the dialog open; a click outside closes the menu. - A host that was never opened writes beat:false and doesn't rewrite session.js. SIGKILL it, start a new host: the stale file is removed and the page reaches the new daemon. - After an open, session.js beats. SIGKILL the host: the page heals in ~5.3s and stays. A daemon-only crash heals in ~5.3s. - Daemon logs: no uncaughtException or EPIPE, one lifeline line per daemon exit. Not tried: the composer pickers in a browser (they need a thread with an installed agent; same SelectMenu component), magpie's real sandboxed frame, Windows and Linux. |
||
|
|
a431798fe1 |
agent-console 1.0.0: a page plugin that drives the local Agent CLIs (#535)
Adds Agent Console (@magpie-community/page-agent-console 1.0.0), a community page plugin that drives the Agent CLIs on this computer (Claude Code, Codex, ACP agents) through a local daemon on 127.0.0.1, with its source in packages/agent-console and a registry entry. Claude Code is the user's own `claude` CLI driven over stream-json (daemon/src/providers/claude/cli.ts); no Anthropic SDK is installed, bundled or in the branch's history. Cold install ~45 MB (node-pty ~26 MB), stated in the README and registry summary in en and zh. By qingnian108 (#535). What was run at 8e8f910 (mote, macOS, throwaway HOME, no real accounts): - packages/agent-console: `npm ci --ignore-scripts --workspaces=false`; `node scripts/verify-build.mjs`: all five bundles byte-identical (daemon/dist/main.js 08c95aa3…, app/app.js 9a6911f3…); `vitest run`: 45 files, 254 passed, 17 skipped; `npm run check` clean. - Real Claude Code 2.1.316 (npm @anthropic-ai/claude-code, sandbox HOME/CLAUDE_CONFIG_DIR, local fake Messages API): `AC_REAL_CLAUDE=… vitest run --config vitest.real.config.ts test/real/claude-cli.real.test.ts`: 4 of 4 (initialize lists 51 slash commands, streaming turn, Bash permission approved and denied, interrupt, --resume with set_model). - Probe: the driver's exact argv with `--permission-mode bypassPermissions --allow-dangerously-skip-permissions`: the tool runs with no can_use_tool request. - Repo root: `HOME=$(mktemp -d) bun test`: 4006 tests, 0 fail; `bun scripts/check.mjs` exit 0. - Install as magpie does: `npm pack --ignore-scripts` (552 KB) then `bun add --ignore-scripts`: 45 MB node_modules, no @anthropic-ai/*, index.mjs imports. - Read every changed line since 41c7a94: argv values limited to SAFE_ARG tokens (no cmd.exe metacharacters reach the shim path), no new network hosts, no install scripts, no eval; no commit in main..8e8f910 contains claude-agent-sdk. Not tried: magpie's desktop window loading the page; a Windows .cmd/.ps1 claude shim end to end. |