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
+27 -1
View File
@@ -1071,6 +1071,31 @@ records anything — a pipeline going unused has to be visible as such.
### Workflows
#### Workflow aggregate bundle
```http
GET /api/workflows?status=active|completed&sections=stats,toolFlow
```
The Workflow analytics page's eleven sections in one payload: `stats`,
`orchestration`, `toolFlow`, `effectiveness`, `patterns`, `modelDelegation`,
`errorPropagation`, `concurrency`, `complexity`, `compaction`, `cooccurrence`.
`status` scopes every section to sessions of one lifecycle status; omit it (or
pass `all`) for no filter. `sections` computes and returns only the named ones —
Dashboard → Health asks for the seven its cards read. `stats.topFlow` is the
head of `toolFlow.transitions` (one window pass over the events for both).
The bundle scans every event, so it is computed in a worker thread on its own
read-only connection (`server/lib/read-pool.js`) and never stalls another
request, hook or websocket meanwhile. Identical requests in flight share one
run. `AGENTHUB_READ_WORKER=0` computes it inline instead.
**Status codes:**
- **200** — the bundle, or the requested sections of it
- **400** `{ "error": { "code": "INVALID_SECTIONS", "message": "sections must name some of: …" } }` — `sections` names no known section (unknown names beside known ones are ignored)
- **500** `{ "error": { "message": "…" } }`
- **503** `{ "error": { "code": "EREADTIMEOUT", "message": "read query took over 60000 ms" } }` — the run passed `AGENTHUB_READ_TIMEOUT_MS` (default 60000); its worker is replaced for the next request
#### Skill and plugin usage
```http
@@ -1319,7 +1344,8 @@ Body: any of `name`, `status`, `ended_at`, `metadata` and `archived`.
the session leaves its workspace's lists and nothing is deleted. Ownership
(`lane_id`) is not patchable: `bindRunSession` (`server/routes/hooks.js`)
stamps the session a dashboard pane holds with that pane's lane, first writer
wins.
wins (`claimToolSessions` in `server/lib/dashboard-runs.js` does it for a
Codex/Antigravity session from the run that was live in its folder).
Returns `{ session }`.
---