Skip to content

Hold the app's data-plane calls until the daemon product check passes #3623

Closed

Description

@mstomar125

Problem

At app startup, the frontend's first routed calls (database list, boot loads) can reach whichever daemon holds daemon.sock before the product check (ADR-084 §5) has run and evicted a daemon of another product. Today that daemon serves those first calls, and it may open databases. It writes no state for the other product, but it does open databases the starting app's product should not have opened yet.

Found during the #3414 "Sign-in gate check" analysis (see #3414 (comment)). An app built on core holds its own daemon's opens with existing hooks. This window is about a different daemon answering first, so it needs a core ordering change, not an extension hook. Cases: a leftover daemon outside the shared launchd label, or another macOS user's per-user registration.

Documentation

Acceptance criteria

  • Document the startup ordering: no data-plane call reaches the daemon until the product check has passed (or the daemon was replaced).
  • The app holds or queues its data-plane calls until then, without tripping the channel health probe's wedged-channel rebuild.
  • A test with a mock daemon reporting another product shows no routed call reaches it.

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Oct 5, 2026
  2. added a commit that references this issue on Oct 5, 2026
    4dd75e7
  3. mstomar125 commented on Oct 5, 2026

    @mstomar125
    ContributorAuthor

    @malibio for tomorrow's discussion: the design is proposed in NodeSpaceAI/nodespace-docs#112 (an ADR-084 §4.3 amendment plus a startup-ordering section) and implemented in #3639. Both are held.

    Proposal. The shared gRPC channel's connector doesn't dial the socket until a daemon has passed the product check, and the check uses its own one-shot connection. A daemon of another product, or one that doesn't answer, only ever sees GetDaemonVersion. Held calls queue for up to 2 minutes, and the health probe skips while held, so there's no wedged-channel rebuild. No frontend change.

    Your automated reviews' points are addressed in the later rounds:

    Open questions for the discussion

    1. Land Install coexistence checks and other-product notices (ADR-084 §4.3, §5) #3606 first? It overlaps in ensure_daemon_running, the setup task and check_daemon_status. Run the daemon as the app's child for another NODESPACE_HOME, never touching the user's registration (held) #3637 (Make the app's daemon management follow NODESPACE_HOME #3616) touches the same function too.
    2. Does this need an EXTENSION_API_VERSION minor bump? This is open question 2 on docs#112.
    3. The Windows code is uncompiled. A release.yml workflow_dispatch with platform=windows-x86 before merge would cover it.

    🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

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