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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: name the real reason when a PortOS update declines the detached path (#5976)
[._.]/ Adam Eivy495d885ab9dc
diff --git a/docs/SELF_UPDATE.md b/docs/SELF_UPDATE.mdindex 88556a6e21..72213338e0 100644--- a/docs/SELF_UPDATE.md+++ b/docs/SELF_UPDATE.md@@ -71,7 +71,7 @@ To prevent that confusion, `POST /api/update/execute` rejects fork runs with **4Both entry points take the same atomic `setUpdateInProgress(true)` lock before launching, so they cannot run `update.sh` concurrently — and because that flag is what `subAgentSpawner`, `agentLifecycle` and `persistentMindSupervisor` gate on, holding it also stops a CoS agent from being spawned into a process the script is about to `pm2 delete` (#4124).-A PortOS record carrying a custom `updateCommand`, or a `repoPath` that is not this checkout, keeps the ordinary attached path — delegating there would silently run `update.sh` instead of the configured command. That decision is logged rather than silent, since the attached path is the one that failed. The `repoPath` comparison resolves symlinks and case-folds on macOS/Windows: `repoPath` is user-editable and not force-synced, so a trailing slash or a different spelling must not be mistaken for a different checkout. Non-PortOS managed apps are unaffected, and still get their own PM2 restart and dashboard handoff from `appUpdater`.+A PortOS record carrying a custom `updateCommand`, or a `repoPath` that is not this checkout, keeps the ordinary attached path — delegating there would silently run `update.sh` instead of the configured command. That decision is logged rather than silent, since the attached path is the one that failed. The `repoPath` comparison resolves symlinks and case-folds on macOS/Windows: `repoPath` is user-editable and not force-synced, so a trailing slash or a different spelling must not be mistaken for a different checkout. Non-PortOS managed apps are unaffected and still get their own PM2 restart from `appUpdater`. The dashboard handoff it starts before that restart is PortOS-only — it opens the PortOS dashboard, so it would be meaningless after another app's update.## Post-update health verificationdiff --git a/server/services/appUpdater.js b/server/services/appUpdater.jsindex 812e4c063a..6be5fd9ff0 100644--- a/server/services/appUpdater.js+++ b/server/services/appUpdater.js@@ -186,11 +186,6 @@ async function _doUpdate(app, emit, { syncFork }) {// other than this checkout, keeps the ordinary attached path rather than// silently running a different script than the one configured.const detachSelfUpdate = app.id === PORTOS_APP_ID && usesStandardScript && isSamePath(dir, PATHS.root);- if (app.id === PORTOS_APP_ID && !detachSelfUpdate) {- // Never silent: this is the branch that runs update.sh attached, and an- // attached run is what left the install headless in #5976.- console.log(`⚠️ PortOS update is using the attached path — ${usesStandardScript ? 'repoPath is not this checkout' : 'a custom update command is configured'}`);- }if (configuredUpdate || pkg?.scripts?.['portos:update'] || usesStandardScript) {// A configured runtime may be an absolute Bun path, which is trusted app// configuration but not a commandSecurity allowlist token. Only free-form@@ -204,6 +199,18 @@ async function _doUpdate(app, emit, { syncFork }) {? { valid: true, baseCommand: 'powershell', args: ['-ExecutionPolicy', 'Bypass', '-File', standardScriptPath] }: { valid: true, baseCommand: standardScriptPath, args: [] };if (!command.valid) throw new Error(`Update command is not allowed: ${command.error}`);+ if (app.id === PORTOS_APP_ID && !detachSelfUpdate) {+ // Never silent: this is PortOS about to run its update routine ATTACHED,+ // and an attached run is what left the install headless in #5976. Name+ // which of the three narrowings declined it, so an operator debugging the+ // misconfiguration is not sent after the wrong one.+ const reason = configuredUpdate+ ? 'a custom update command is configured'+ : pkg?.scripts?.['portos:update']+ ? 'a portos:update package script is configured'+ : 'repoPath is not this checkout';+ console.log(`⚠️ PortOS update is using the attached path — ${reason}`);+ }emit('app-update', 'running', 'Running the app update routine...');if (detachSelfUpdate) {// PortOS is itself a managed app, so an App Management update reaches