Skip to content

bug(tui): repeated session starts stack shared editor layers #740

Closed

Description

@outlier27-cell

Problem

OpenPI's shared editor-layer coordinator composes a new editor factory from current.ui.getEditorComponent() every time a layer registration is installed. Pi emits session_start for /new, /resume, and /reload; those starts register the same layers again without necessarily creating a new UI context. The second install therefore wraps the already-composed factory, nesting each editor layer again.

Minimal reproduction

  1. Start a TUI session with OpenPI editor contributors loaded.
  2. Let the scheduled editor-layer install run once.
  3. Start another Pi session on the same TUI context (/new, /resume, or /reload).
  4. After the second scheduled install, construct the editor component: each registered wrapper has been applied twice.

Expected behavior

One active TUI context has one composition of each registered OpenPI editor layer, regardless of repeated session_start events.

Proposed scope

Retain the original base editor factory per active context and compose registered layers from that base. Add a lifecycle regression that starts the same context twice and proves the wrapped editor depth does not grow.

Activity

  1. outlier27-cell commented on Oct 11, 2026

    @outlier27-cell
    ContributorAuthor

    I am claiming this issue. I verified no equivalent open Issue or implementation PR, and will add the same-context repeated-session regression before opening a focused PR.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions