Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

Report an already-running daemon as running, whatever the host platform

Adam Eivye6f65a218368
diff --git a/server/services/localRuntimeSetup.js b/server/services/localRuntimeSetup.js
index 34f2b6e012..82ca3bccf9 100644
--- a/server/services/localRuntimeSetup.js
+++ b/server/services/localRuntimeSetup.js
@@ -287,13 +287,18 @@ export async function runLocalRuntimeSetup(kind, { endpoint, emit = () => {}, is
const row = SETUP_ROWS[kind];
const runtime = LOCAL_RUNTIMES[kind];
if (!row || !runtime) return { success: false, error: `PortOS has no automatic setup for \`${String(kind)}\`.` };
- if (!platformSupported(row)) return { success: false, error: row.unsupportedReason };
+ // The reachability probe comes BEFORE the platform gate on purpose: a daemon
+ // that is already answering is running whatever this host's platform is, and
+ // "MTPLX runs only on macOS" is a false report about a server the user can
+ // see working. The gate is about what PortOS may INSTALL, not about what is
+ // already up.
const target = endpoint || runtime.defaultBaseUrl;
const probe = await probeOpenAiModels(target, { timeoutMs: PROBE_TIMEOUT_MS });
if (probe.reachable) {
return { success: true, message: `${runtime.label} is already running at ${target} — nothing to do.` };
}
+ if (!platformSupported(row)) return { success: false, error: row.unsupportedReason };
// Same two signals `providerReadiness.js` uses: the binary on PATH, plus LM
// Studio's macOS app bundle, which serves without ever putting `lms` there.
diff --git a/server/services/localRuntimeSetup.test.js b/server/services/localRuntimeSetup.test.js
index 8602ff11ee..edc2f22b35 100644
--- a/server/services/localRuntimeSetup.test.js
+++ b/server/services/localRuntimeSetup.test.js
@@ -112,10 +112,16 @@ describe('describeRuntimeSetup', () => {
});
describe('runLocalRuntimeSetup', () => {
- it('does nothing when the endpoint already answers', async () => {
+ it('does nothing when the endpoint already answers — on ANY platform', async () => {
+ // Pinned to a platform this runtime cannot be installed on: a daemon that
+ // answers is running, and the macOS-only gate must not turn that into
+ // "MTPLX runs only on macOS". (Left unpinned this passed on a macOS dev box
+ // and failed on the Linux CI runner, which is how the ordering bug surfaced.)
+ const restore = pinPlatform('linux');
probe.probeOpenAiModels.mockResolvedValueOnce(reachable());
const result = await runLocalRuntimeSetup('mtplx', { endpoint: 'http://127.0.0.1:8000/v1' });
+ restore();
expect(result).toMatchObject({ success: true, message: expect.stringMatching(/already running/) });
expect(streaming.runStreamingCommand).not.toHaveBeenCalled();
@@ -157,6 +163,7 @@ describe('runLocalRuntimeSetup', () => {
});
it('refuses a host that cannot run the runtime at all', async () => {
+ probe.probeOpenAiModels.mockResolvedValueOnce(unreachable);
const restore = pinPlatform('win32');
const result = await runLocalRuntimeSetup('mtplx', { endpoint: 'http://127.0.0.1:8000/v1' });
restore();