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
+34
View File
@@ -49,4 +49,38 @@ describe("dashboard-runs", () => {
assert.equal(runs.getRun("agenthub-lane-5").status, "running");
assert.equal(runs.getRun("agenthub-lane-6").status, "abandoned");
});
it("gives a hookless tool's session the lane of the run it started in", () => {
const { db } = require("../db");
start("agenthub-lane-7-1", {
laneId: 7,
cwd: "/w",
tool: "antigravity",
startedAt: Date.parse("2026-10-05T08:49:57.145Z"),
});
runs.patchRun({
id: "agenthub-lane-7-1",
status: "killed",
endedAt: Date.parse("2026-10-05T08:50:10.740Z"),
});
const add = db.prepare(
"INSERT INTO sessions (id, name, status, cwd, started_at, tool) VALUES (?, 'x', 'completed', ?, ?, ?)"
);
add.run("in", "/w", "2026-10-05T08:50:01Z", "antigravity");
add.run("before", "/w", "2026-10-05T08:40:00Z", "antigravity");
add.run("after", "/w", "2026-10-05T09:00:00Z", "antigravity");
add.run("elsewhere", "/x", "2026-10-05T08:50:01Z", "antigravity");
add.run("other-tool", "/w", "2026-10-05T08:50:01Z", "codex");
add.run("claude", "/w", "2026-10-05T08:50:01Z", "claude");
runs.claimToolSessions();
const lane = (id) => db.prepare("SELECT lane_id FROM sessions WHERE id = ?").get(id).lane_id;
assert.equal(lane("in"), 7);
for (const id of ["before", "after", "elsewhere", "other-tool", "claude"]) {
assert.equal(lane(id), null, id);
}
// One session at a time also becomes its run's session.
assert.equal(runs.getRun("agenthub-lane-7-1").session_id, null);
runs.claimToolSessions("in");
assert.equal(runs.getRun("agenthub-lane-7-1").session_id, "in");
});
});