fix: event-loop freezes, plugin-install boot crash, tmux attach/scrollbar, Codex transcripts

- GET /api/workflows: one LEAD() window pass in a read worker (read-pool.js,
  workflow-stats.js); idx_events_session restored, idx_events_tool added
- compat-sqlite gains function/pluck/readonly so a plugin install without a
  better-sqlite3 build boots again; antigravity-usage uses db.js's Database
- install-hooks adds no checkout hooks while the agenthub plugin is enabled
  (events were doubled)
- terminal attach runs the live tmux server's own binary; the pane scrollbar
  gets a visible 2-column style, and claude panes start with
  CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 so tmux keeps history to scroll
- Codex sessions' conversation in GET /api/sessions/:id/transcript
- Codex/Antigravity sessions claimed by their workspace without hooks
- UI-audit follow-ups, docs and OpenAPI
This commit is contained in:
2026-10-05 17:01:05 +07:00
parent 442f133930
commit 198fbb7980
78 changed files with 2716 additions and 873 deletions
+30 -11
View File
@@ -3,8 +3,10 @@
* an install its browser run console cannot work, because every run the
* dashboard starts is a tmux session (server/lib/tmux.js). The row must WARN
* and never FAIL: sessions, analytics, lanes and the CLI all work without the
* binary, so failing a doctor run over it would cry wolf. tmux is faked through
* the module's own exec seam, so the test never depends on the host having it.
* binary, so failing a doctor run over it would cry wolf. A tmux older than 3.7
* (no pane scrollbars) also warns, as does a new binary still talking to an
* older running server. tmux is faked through the module's own exec seam, so
* the test never depends on the host having it.
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
*/
@@ -26,11 +28,14 @@ after(() => {
delete process.env.CLAUDE_HOME;
});
/** Fake the tmux binary as present or absent, then read back the row. */
function rowWithTmux(present) {
tmux.__setExecImpl(() => {
if (!present) throw new Error("spawnSync tmux ENOENT");
return "tmux 3.4\n";
/** Fake the tmux binary (null = absent) and its running server (null = none),
* then read back the row. */
function rowWithTmux(client, server = null) {
tmux.__setExecImpl((args) => {
if (!client) throw new Error("spawnSync tmux ENOENT");
if (args[0] === "-V") return `tmux ${client}\n`;
if (!server) throw new Error("no server running");
return `${server}\n`;
});
const row = diagnose().find((r) => r.label === "tmux");
assert.ok(row, "the doctor must always emit a tmux row");
@@ -39,16 +44,30 @@ function rowWithTmux(present) {
describe("plugin-doctor: tmux row", () => {
it("warns, never fails, when tmux is not on PATH", () => {
const row = rowWithTmux(false);
const row = rowWithTmux(null);
assert.equal(row.level, "warn", "a missing tmux must not fail the doctor run");
assert.match(row.detail, /lanes shell/, "the reader needs to know WHAT breaks");
assert.match(row.detail, /install/i, "and how to fix it");
});
it("passes when tmux is available", () => {
const row = rowWithTmux(true);
it("passes when tmux has pane scrollbars (3.7+)", () => {
assert.equal(rowWithTmux("3.7c").level, "ok");
assert.equal(rowWithTmux("next-3.8", "3.8-rc3").level, "ok");
});
assert.equal(row.level, "ok", row.detail);
it("warns, with the upgrade path, when tmux is older than 3.7", () => {
const row = rowWithTmux("3.4", "3.4");
assert.equal(row.level, "warn");
assert.match(row.detail, /3\.7/);
assert.match(row.detail, /brew upgrade tmux/);
});
it("warns when a new tmux is still talking to an older running server", () => {
const row = rowWithTmux("3.7c", "3.4");
assert.equal(row.level, "warn");
assert.match(row.detail, /server is 3\.4/);
});
});