Skip to content

Core signals: engine-owned signal listeners (engineListeners, upstream #1734) #1693

Closed as not planned

Description

@kblok

Follow-up of #1677. Upstream core/signals.ts marks the signal listeners an engine registers while a host or session opens (engineListeners) and removes them before it raises the signal again, so an engine's listener never swallows the signal.

.NET cannot enumerate PosixSignalRegistrations, so the port tells a program's listener from an engine's only by whether it cancels the re-raised signal. An engine whose registration cancels the signal would keep the process alive after the host closed. Needs a design, such as an engine-facing registration wrapper the host tracks and disposes before re-raising.

Activity

  1. kblok commented on Nov 16, 2026

    @kblok
    MemberAuthor

    QUESTION: This builds on #1694 (the Signals port, still open and unmerged), and .NET cannot enumerate PosixSignalRegistrations, so how should an engine mark its listeners?

    1. Add a public engine-facing wrapper, e.g. Signals.EngineRegistration.Create(PosixSignal, Action<PosixSignalContext>), that the host tracks and disposes before re-raising. It is a new public API with no upstream counterpart, and it only covers engines that opt in.
    2. Keep the current behavior: a listener is the program's only if it cancels the re-raised signal. No new API; an engine whose registration cancels the signal keeps the process alive, as today.
    3. Add the wrapper as an internal/.NET-only API for the in-repo engines only. None of them register signal listeners today, so this has no effect yet.

    Recommendation: 1, after #1694 merges, so I can stack on it. Waiting for your answer.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions