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
+31
View File
@@ -179,6 +179,37 @@ describe("data-transfer export/import round-trip", () => {
assert.equal(db.prepare("SELECT COUNT(*) c FROM events WHERE session_id='S3'").get().c, 4);
});
it("stores a restored event's payload trimmed, like every other event insert", () => {
const data = JSON.stringify({
tool_name: "Edit",
tool_response: { originalFile: "x".repeat(40_000) },
});
const c = importExportBundle(db, {
sessions: [
{
id: "S-trim",
status: "completed",
started_at: "2026-06-01T00:00:00.000Z",
updated_at: "2026-06-01T00:00:00.000Z",
source: "local",
tool: "claude",
},
],
events: [
{
session_id: "S-trim",
event_type: "PostToolUse",
data,
created_at: "2026-06-01T00:00:01.000Z",
},
],
});
assert.equal(c.events, 1);
const row = db.prepare("SELECT data FROM events WHERE session_id = 'S-trim'").get();
assert.ok(row.data.length < 1000, `stored ${row.data.length} chars`);
assert.deepEqual(JSON.parse(row.data)._trimmed, ["tool_response.originalFile"]);
});
it("rejects a non-export object", () => {
assert.throws(() => importExportBundle(db, { foo: "bar" }), /recognizable dashboard export/);
assert.throws(() => importExportBundle(db, { format: "something-else" }), /Unrecognized/);