Skip to content

(renderer): a transcript-activity message before app.js loads throws 'activePtyIds is not defined' #415

Description

@devsuitup

A session-transcript-activity message that arrives before app.js has run throws in the renderer:

[renderer:3] :136 Uncaught Error: activePtyIds is not defined

Seen once at startup on an isolated instance whose HOME had live sessions writing transcripts during load (2026-10-02, at #414's head).

Cause:

  • public/local-transcript-adapter.js:135 registers window.api.onSessionTranscriptActivity(onLocalTranscriptActivity) at top level.
  • That script loads before app.js (index.html:156 vs :163).
  • The handler reads activePtyIds (local-transcript-adapter.js:88, sub-agent path :102), which is declared at public/app.js:127.
  • main.js sends the message from the projects watcher, which starts right after createWindow() with no renderer-readiness gate.
  • :136 is the ipcRenderer.on('session-transcript-activity', …) line of preload.js plus Electron's sandbox wrapper offset.

Not a regression:

Supposed impact (not measured): one dropped busy signal for that session. The next send, at most 1 s later, works once app.js has loaded.

Fix direction: register the listener from app.js once its state exists, or guard the handler until the renderer is ready.

Activity

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