Repository navigation
feat(startup): system/launch-mode IPC command — headless-native, Rust-only - #1637
Merged
Merged
Conversation
…-only
The runtime lever for the headless-vs-UI launch preference, owned by
continuum-core with ZERO Node dependency. The headless server is independent
of Node entirely; the Node desktop is a dependent client that calls this over
IPC, never the reverse — so this lives in the Rust core, not the TS command
layer.
- core/.../modules/launch_mode.rs — LaunchModeModule (ServiceModule):
- system/launch-mode/get → reports stored CONTINUUM_LAUNCH_MODE (auto when unset)
- system/launch-mode/set → validates headless|ui|auto, persists, emits
system:launch-mode:changed so a running UI attaches/tears down its overlay
- core/.../config_env.rs — in-core config.env reader + UPSERT writer (the
mutable counterpart to the read-only, cached secrets.rs). Same key + format
the bin/continuum bootstrap resolver and the TS SecretManager use, so all
three runtimes (shell, Node, Rust) agree on one truth.
This is the everything-is-a-command embodiment: one config.env setting, edited
by any first-class citizen (CLI, tray, desktop, mobile, persona via the SDK)
through the one command; the changed-event is the UI-visible feedback. Distinct
from the substrate boot --mode (full-citizen/inference-only/fail-fast), which
stays explicit and is never guessed.
Registered in ipc/mod.rs alongside HealthModule. 8 unit tests (config.env
round-trip/upsert-in-place/comment-preservation; mode validation; deny unknown
subcommand; reject missing/invalid mode), green under --features metal,accelerate.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The runtime lever for the headless-vs-UI launch preference, as a Rust IPC command in continuum-core —
system/launch-mode/{get,set}.Why Rust, not TS
The headless server is independent of Node entirely; the Node desktop is a dependent client that calls the core over IPC, never the reverse. So a headless-only node (or a persona) must be able to read/set its own launch mode with no Node in the loop — this belongs in the Rust core, not the TS command layer. (The bash
bin/continuumresolver in #1636 is the unavoidable pre-core bootstrap; this is the runtime command.)Pieces
modules/launch_mode.rs—LaunchModeModule(ServiceModule, registered next toHealthModule):system/launch-mode/get→ reports storedCONTINUUM_LAUNCH_MODE(autowhen unset).system/launch-mode/set→ validatesheadless|ui|auto, persists, emitssystem:launch-mode:changedso a running UI attaches / tears down its own overlay (the "UI turns itself off when the last human leaves" behavior).config_env.rs— in-core config.env reader + upsert writer: the mutable counterpart to the read-only, cached-at-startupsecrets.rs. Same key +KEY=valueformat thebin/continuumbootstrap and the TSSecretManageruse, so all three runtimes (shell / Node / Rust) agree on one truth — coherence across runtimes, not duplication.The architecture it embodies
One config.env setting, edited by any first-class citizen — CLI, menu-bar tray, desktop Grid tab, mobile, persona via the SDK — through the one command; the changed-event is the UI-visible feedback. (Joel's rule: UI-manipulable action → command, UI-visible feedback → event.) Distinct from the substrate boot
--mode(full-citizen/inference-only/fail-fast), which stays explicit and is never guessed ([[no-fallbacks-ever]]).Tests
8 unit tests, green under
--features metal,accelerate: config.env round-trip / upsert-in-place (no duplicates) / comment+sibling preservation / missing-file → None; mode normalization; deny unknown subcommand; reject missing & invalid mode.Relationship to other PRs
Builds on #1636 (the bash bootstrap resolver reads the same key). Part of the headless-first startup-consolidation lane.
🤖 Generated with Claude Code