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
+9 -2
View File
@@ -317,8 +317,14 @@ db.exec(`
-- read by the watchdog every 15 s and by every lane payload. Without it each
-- read walked the rows' overflow chains (created_at sits after data).
CREATE INDEX IF NOT EXISTS idx_events_session_created ON events(session_id, created_at);
-- A prefix of idx_events_session_type: never needed, ~1% of the file.
DROP INDEX IF EXISTS idx_events_session;
-- (session_id, id): a session's events in insert order, NOT a prefix of
-- idx_events_session_type (that one is not id-ordered). Every hook's
-- duplicate guard reads a session's latest event through it; dropped, that
-- read sorted the whole session per hook.
CREATE INDEX IF NOT EXISTS idx_events_session ON events(session_id, id);
-- tool_name: the per-tool counts (analytics, workflows) and the events
-- filter's tool list read it alone instead of scanning every event row.
CREATE INDEX IF NOT EXISTS idx_events_tool ON events(tool_name);
CREATE INDEX IF NOT EXISTS idx_events_type ON events(event_type);
CREATE INDEX IF NOT EXISTS idx_events_created ON events(created_at DESC);
CREATE INDEX IF NOT EXISTS idx_sessions_status ON sessions(status);
@@ -2181,6 +2187,7 @@ module.exports = {
db,
stmts,
DB_PATH,
Database, // the driver class picked above, for other SQLite files (agy's)
DEFAULT_PRICING,
applyIntroPricing,
topUpDefaultPricing,