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

fix: keep the express app type standardizable (#4137)

Adam Eivyd196ccb4c408
diff --git a/client/src/components/apps/constants.js b/client/src/components/apps/constants.js
index 19849d8631..575721c66f 100644
--- a/client/src/components/apps/constants.js
+++ b/client/src/components/apps/constants.js
@@ -48,13 +48,14 @@ export function resolveLaunchPanelProcess(app, result) {
// test asserts the two Sets match). POSITIVE list: the PM2 standardizer writes a
// NODE ecosystem config from a prompt that opens "You are analyzing a Node.js
// application", so a Python/Go/Docker/static repo must not be offered the flow.
-// `unknown` and `desktop` stay in for continuity — see the server's rationale.
+// `express` (appSchema's default), `unknown`, and `desktop` stay in for
+// continuity with already-persisted app records — see the server's rationale.
export const STANDARDIZABLE_TYPES = new Set([
- 'vite+express', 'vite', 'single-node-server', 'nextjs', 'desktop', 'unknown'
+ 'vite+express', 'vite', 'single-node-server', 'nextjs', 'express', 'desktop', 'unknown'
]);
/** Whether the PM2 standardizer (which writes a NODE ecosystem config) applies. */
-export const isStandardizable = (type) => STANDARDIZABLE_TYPES.has(type ?? 'unknown');
+export const isStandardizable = (type) => STANDARDIZABLE_TYPES.has(type || 'unknown');
// Every app type that can reach a UI label. Kept TOTAL (with a raw-type
// fallback) rather than a ternary chain ending in '🔨 Xcode' — that default
@@ -72,6 +73,7 @@ const APP_TYPE_LABELS = {
'vite+express': '⚡ Vite + Express',
vite: '⚡ Vite',
'single-node-server': '🟢 Node',
+ express: '🟢 Express',
nextjs: '▲ Next.js'
};
diff --git a/server/services/streamingDetect.js b/server/services/streamingDetect.js
index f24410bdd4..2936436596 100644
--- a/server/services/streamingDetect.js
+++ b/server/services/streamingDetect.js
@@ -49,18 +49,24 @@ export function classifyNonNodeType(files) {
* unrecognized repo. On a Python/Go/Docker/static repo the LLM doesn't fail, it
* confidently writes a Node ecosystem config into someone else's project.
*
- * `unknown` stays in the list on purpose: `type` is persisted on the app record,
- * so every app imported before this classification existed keeps `unknown` until
- * it's re-detected — and most of those really are Node apps. `desktop` (a Godot
- * game binary) is here for the same continuity reason; those repos commonly
- * carry a Node web process alongside the game and were always offered the flow.
+ * The list has to cover every type an install can have PERSISTED, not just the
+ * ones detection emits today — `type` lives on the app record and other installs
+ * upgrade on their own schedule:
+ * - `express` is `appSchema`'s default (`server/lib/validation.js`) and the
+ * type of PortOS's own app entry, so it's the most common stored value.
+ * - `unknown` is what every app imported before this classification existed
+ * kept — and most of those really are Node apps.
+ * - `desktop` (a Godot game binary) was always offered the flow; those repos
+ * commonly carry a Node web process alongside the game.
+ * A missing/blank type normalizes to `unknown`, so an unrecognized legacy value
+ * degrades to "offer it" rather than silently hiding the button.
*/
export const STANDARDIZABLE_TYPES = new Set([
- 'vite+express', 'vite', 'single-node-server', 'nextjs', 'desktop', 'unknown'
+ 'vite+express', 'vite', 'single-node-server', 'nextjs', 'express', 'desktop', 'unknown'
]);
/** Whether the PM2 standardizer (which writes a NODE ecosystem config) applies. */
-export const isStandardizable = (type) => STANDARDIZABLE_TYPES.has(type ?? 'unknown');
+export const isStandardizable = (type) => STANDARDIZABLE_TYPES.has(type || 'unknown');
/**
* App types that run a GUI/desktop process with no HTTP port (e.g. a Godot
diff --git a/server/services/streamingDetect.test.js b/server/services/streamingDetect.test.js
index 3785bdada5..d612f84a76 100644
--- a/server/services/streamingDetect.test.js
+++ b/server/services/streamingDetect.test.js
@@ -1154,6 +1154,16 @@ describe('isStandardizable', () => {
expect(isStandardizable('unknown')).toBe(true);
expect(isStandardizable(undefined)).toBe(true);
expect(isStandardizable(null)).toBe(true);
+ expect(isStandardizable('')).toBe(true);
+ });
+
+ it("covers appSchema's default type — the most common PERSISTED value", async () => {
+ // `type` lives on the app record, and an app created without one defaults to
+ // this. A positive gate that missed it would silently hide the standardize
+ // button on every such app across every install.
+ const { appSchema } = await import('../lib/validation.js');
+ const defaultType = appSchema.parse({ name: 'Example App', repoPath: '/srv/example-app' }).type;
+ expect(isStandardizable(defaultType)).toBe(true);
});
it('refuses the non-Node runtimes', () => {