Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Harness Team account always takes releases, whatever its owner's environment says

bitcoinbuilder06e50e0dc64d
diff --git a/cli/src/masterProcess.ts b/cli/src/masterProcess.ts
index b344d3b87..cb089983b 100644
--- a/cli/src/masterProcess.ts
+++ b/cli/src/masterProcess.ts
@@ -31,6 +31,7 @@ import { ts } from './lib/log.js'
import { confirm as confirmUpdate, pendingVersion, restore as restoreUpdate, unjudgedUpdate } from './lib/selfUpdate.js'
import { keepStaged, ptyUnjudged, rollBackStaged } from './lib/windows/ptyUpdate.js'
import { VERSION } from './version.js'
+import { isTeamAccount } from './team/config.js'
/** Where a master re-executing on a new bundle leaves word of it, until that master's core is up. */
export const HARNESSD_REEXEC_FILE = join(env.ADAPTER_DATA_DIR, 'harnessd-reexec.json')
@@ -272,7 +273,9 @@ export function startMaster(
unjudgedUpdate: (bundle) => unjudgedUpdate(env.ADAPTER_CLI_DIR, bundle)
?? (ptyRoot === null ? null : ptyUnjudged(ptyRoot, { cliPending: pendingVersion(env.ADAPTER_CLI_DIR) !== null, log: masterLog, lock })),
// The updater runs for the installed copy alone (lib/installedCopy.ts), beside the core, never in it.
- updater: !env.ADAPTER_UPDATE_DISABLE && isInstalledCopy(start.scriptPath, env.ADAPTER_CLI_DIR),
+ // The Harness Team account takes releases even when its owner's environment switched updates off and setup carried
+ // that in (team/layout.ts): nobody develops in it, and nobody is there to update it by hand.
+ updater: (!env.ADAPTER_UPDATE_DISABLE || isTeamAccount()) && isInstalledCopy(start.scriptPath, env.ADAPTER_CLI_DIR),
// A master that ends cleanly gives up its claim on its lean bundle, so the next one to start can
// clear the folder; one that dies leaves a claim whose pid is gone, which counts for nothing.
exit: (code) => {
diff --git a/cli/src/services/updaterProcess.ts b/cli/src/services/updaterProcess.ts
index 8478fcafe..94eb9e0e9 100644
--- a/cli/src/services/updaterProcess.ts
+++ b/cli/src/services/updaterProcess.ts
@@ -22,7 +22,7 @@
*/
import { userInfo } from 'node:os'
import { env } from '../config/env.js'
-import { readTeamConfig } from '../team/config.js'
+import { isTeamAccount, readTeamConfig } from '../team/config.js'
import { SERVICE_EXIT_RESTART, type StagedUpdate, type UpdaterMessage } from '../harnessd/protocol.js'
import { describeSpawnLockOwner, withSpawnLock } from '../lib/daemonSpawnLock.js'
import { DOWNLOAD_LIMITS, downloadVerified, isLocalDevBuild, retireCliVersions, startSelfUpdater } from '../lib/selfUpdate.js'
@@ -213,6 +213,6 @@ function startPty(
/** This process runs as the Harness Team account its Mac's root-owned config names. An account whose name cannot be read
* is not it. */
-export function inTeamAccount(config = readTeamConfig, user = () => userInfo().username): boolean {
- try { return config()?.user === user() } catch { return false }
+export function inTeamAccount(config: () => ReturnType<typeof readTeamConfig> = () => readTeamConfig(), user = () => userInfo().username): boolean {
+ return isTeamAccount(config, user)
}
diff --git a/cli/src/team/config.ts b/cli/src/team/config.ts
index e543d0723..05e216347 100644
--- a/cli/src/team/config.ts
+++ b/cli/src/team/config.ts
@@ -4,6 +4,7 @@
*/
import { readFileSync } from 'node:fs'
import { TEAM_CONFIG_FILE, carriedBackendEnv, checkPath, checkPort, checkUser } from './layout.js'
+import { userInfo } from 'node:os'
export interface TeamConfig {
version: 1
@@ -67,3 +68,9 @@ export function readTeamConfig(path: string = TEAM_CONFIG_FILE, read: (path: str
return null
}
}
+
+/** Whether this process runs as the Harness Team account its Mac's root-owned config names. An account whose name
+ * cannot be read is not it. */
+export function isTeamAccount(config: () => TeamConfig | null = () => readTeamConfig(), user: () => string = () => userInfo().username): boolean {
+ try { return config()?.user === user() } catch { return false }
+}
diff --git a/cli/src/team/layout.ts b/cli/src/team/layout.ts
index 210780c38..f72646122 100644
--- a/cli/src/team/layout.ts
+++ b/cli/src/team/layout.ts
@@ -119,8 +119,9 @@ export function carriedBackendEnv(source: NodeJS.ProcessEnv): Record<string, str
if (autonomous !== 'prod' && autonomous !== 'stag') throw new TeamInputError(`AUTONOMOUS_ENV must be prod or stag: ${JSON.stringify(autonomous)}`)
carried.AUTONOMOUS_ENV = autonomous
}
- const updates = source.ADAPTER_UPDATE_DISABLE?.trim()
- if (updates === 'true' || updates === '1') carried.ADAPTER_UPDATE_DISABLE = 'true'
+ // Never ADAPTER_UPDATE_DISABLE: an owner on a local build (`install-cli.sh --no-updates`) carried it into the team
+ // account, whose daemon then never updated, and with nobody to update it by hand it stayed without what came after
+ // (2026-10-27: no tmux of its own, so no teammate's agent could start there). The team account always takes releases.
return carried
}
diff --git a/cli/src/team/script.spec.ts b/cli/src/team/script.spec.ts
index 1e38796c5..07327b27e 100644
--- a/cli/src/team/script.spec.ts
+++ b/cli/src/team/script.spec.ts
@@ -554,3 +554,11 @@ describe('real permission bits on a temporary folder', () => {
expect(statSync(join(dir, 'bin')).mode & 0o777).toBe(0o755)
})
})
+
+describe('what setup carries from the owner\'s environment', () => {
+ it('carries the backend it signs in to, and never switches the team account\'s updates off', async () => {
+ const { carriedBackendEnv } = await import('./layout.js')
+ expect(carriedBackendEnv({ AUTONOMOUS_ENV: 'stag', ADAPTER_UPDATE_DISABLE: 'true' })).toEqual({ AUTONOMOUS_ENV: 'stag' })
+ expect(carriedBackendEnv({ ADAPTER_UPDATE_DISABLE: '1' })).toEqual({})
+ })
+})