Skip to content

Make the app's daemon management follow NODESPACE_HOME #3616

Closed as not planned

Description

@mstomar125

Problem

The desktop app's daemon management (ensure_daemon_running, the launchd plist it writes) ignores NODESPACE_HOME. An app started with an isolated home still manages, and points its launchd job at, the user's real daemon setup. Also, the launchd daemon doesn't inherit the app's NODESPACE_HOME. #3611 documents that limitation for the bundled-model copy.

Found while implementing #2781 Part B (#3611). Related: #3601, #3609, #3612 (other components that now follow NODESPACE_HOME).

Documentation

Acceptance criteria

  • Decide and document whether an isolated NODESPACE_HOME app run should register its own launchd job, pass NODESPACE_HOME to the daemon, or refuse to manage a launchd job at all. Write the decision in the docs first.
  • Implement it, with tests using scratch homes and no real launchctl calls.

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Oct 5, 2026
  2. mstomar125 commented on Oct 5, 2026

    @mstomar125
    ContributorAuthor

    @malibio for tomorrow's discussion: the decision is proposed in NodeSpaceAI/nodespace-docs#111 and implemented in #3637. Both are held until we agree.

    What we found. An app started with only NODESPACE_HOME set still connected to the real $HOME/.nodespace socket, registered the real launchd job (without NODESPACE_HOME), and stopped the real daemon on quit. So it read and wrote the user's own databases. daemon-cli-protocol.md claimed a different home meant a different socket; it didn't.

    Proposed rule. For a home other than the user's, the app runs the daemon headless as its own child process. It never calls launchctl, systemctl or reg, uses a per-home socket or pipe, and stops the daemon by PID, never by image name. Deleting the home cleans everything up. The trade-off: no tray, no crash restart and no login start for another home. The user's own home is byte-for-byte unchanged, and a test proves it against main.

    Rejected: a per-home launchd job (leaves orphaned login jobs, and nodespace uninstall and the product check only know the shared label), a dev flag, and expecting a hand-started daemon.

    Open for the discussion:

    🤖 Generated with Claude Code

  3. malibio commented on Oct 5, 2026

    @malibio
    Collaborator

    Closing as not planned. NODESPACE_HOME is a test setting for the daemon and the CLI; the desktop app does not read it and manages one daemon through the shared registration. Reasoning: https://github.com/NodeSpaceAI/nodespace-docs/pull/111#issuecomment-5998859172

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