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
+29
View File
@@ -104,6 +104,35 @@ describe("install-hooks host-only guard (#193)", () => {
assert.equal(ours.length, 1, "must not duplicate our hook entry on re-run");
});
it("with the agenthub plugin enabled, adds nothing and removes our duplicate entries", () => {
process.env.AGENTHUB_FORCE_HOST = "1";
const foreign = { hooks: [{ type: "command", command: "my-own-hook.sh" }], matcher: "*" };
const ours = {
hooks: [{ type: "command", command: 'node "/x/scripts/hook-handler.js" Stop' }],
};
fs.writeFileSync(
SETTINGS,
JSON.stringify({
enabledPlugins: { "agenthub@sg": true },
hooks: { PreToolUse: [foreign], Stop: [ours] },
})
);
assert.equal(installHooks(true), true);
const settings = JSON.parse(fs.readFileSync(SETTINGS, "utf8"));
assert.doesNotMatch(JSON.stringify(settings.hooks), /hook-handler\.js/);
assert.deepEqual(settings.hooks.PreToolUse, [foreign]);
assert.equal(settings.hooks.Stop, undefined);
assert.ok(fs.existsSync(`${SETTINGS}.agenthub-bak`), "backs the file up before writing");
});
it("installs as before when the plugin is disabled", () => {
process.env.AGENTHUB_FORCE_HOST = "1";
fs.writeFileSync(SETTINGS, JSON.stringify({ enabledPlugins: { "agenthub@sg": false } }));
assert.equal(installHooks(true), true);
const settings = JSON.parse(fs.readFileSync(SETTINGS, "utf8"));
assert.match(JSON.stringify(settings.hooks.PreToolUse), /hook-handler\.js/);
});
it("isInsideContainer honors the force flags", () => {
process.env.AGENTHUB_FORCE_CONTAINER = "1";
assert.equal(isInsideContainer(), true);