Skip to content

(bg-agents): transcript availability cost, recheck and promotion selection (follow-up #881) #882

Closed

Description

@devsuitup

Follow-up of #881 (#530), review minors.

  1. Main-thread cost of transcriptAvailable.
    • Each roster rebuild (bg-agents.js ~172, main.js ~3490) now does one SQLite lookup and one statSync per row, on the main thread, even with Agents closed. Rebuilds can run up to 4 times a second.
    • A missing file throws, which costs more than the stat. Measured: about 5 ms per pass for 220 rows.
    • This reverses (bg-agents): one row per conversation, refuse destructive verbs while it is live (#522) #525's "rebuilds do not query SQLite or stat transcripts".
    • Fix: use statSync(p, { throwIfNoEntry: false }), add a per-sessionId memo cleared by reconcile(), or compute the flag only for visible rows.
  2. Disabled Transcript button never rechecks. A new interactive session's file indexed after the first roster build leaves Transcript disabled until the next rebuild, up to 30 s. Recheck on hover or click, or invalidate on index events for that session.
  3. No test for selection across a promotion.
    • Add a DOM test where a background row becomes interactive and keeps its selection.
    • Decide what happens when a selected external int:<sid> row merges into a job row: today the selection is lost (agents-view.js ~548).
  4. Wording.
    • The "pre-compaction" line also shows when the job had no sessionId (agents-view.js ~521).
    • The CHANGELOG uses "merged row", internal vocabulary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions