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
address review (codex): force update-check off on the direct agent path + match codex TUI by basename
[._.]/ Adam Eivyd775ff7db9a7
diff --git a/server/lib/tuiHandshake.js b/server/lib/tuiHandshake.jsindex 3398e00d6c..312a9c178f 100644--- a/server/lib/tuiHandshake.js+++ b/server/lib/tuiHandshake.js@@ -12,7 +12,7 @@* No cycle risk: this module imports nothing from either consumer.*/-import { resolveCliModel, hasModelFlag, resolveBedrockCliModel, prefixOpencodeModel, isOpencodeCommand, buildCodexStartupArgs } from './providerModels.js';+import { resolveCliModel, hasModelFlag, resolveBedrockCliModel, prefixOpencodeModel, isOpencodeCommand, buildCodexStartupArgs, commandBasename } from './providerModels.js';import { ensureAntigravityTuiArgs, isAntigravityCommand } from './antigravity.js';import { ensureGrokTuiArgs, isGrokCommand } from './grok.js';@@ -797,9 +797,14 @@ export function rendersWorkCounter(commandName) {// provider config already pins an approval/sandbox/bypass policy of its own.// We ALSO disable codex's startup update check (see ensureCodexTuiArgs) —// independent of the approval posture, so it's injected even when a provider-// pins its own policy.+// pins its own policy. Match codex by BASENAME (`commandBasename`), not a strict+// `=== 'codex'`: a provider commonly configures the absolute binary path+// (`/opt/homebrew/bin/codex`, what `which codex` returns), and a strict match+// would skip both the bypass flag and the update-check disable — leaving that+// headless TUI to wedge on the update modal. A wrapper like `my-codex-wrapper`+// has a non-`codex` basename and still (correctly) owns its own argv.export function applyCommandDefaults(command, args) {- if (command === 'codex') {+ if (commandBasename(command) === 'codex') {return ensureCodexTuiArgs(args);}if (isAntigravityCommand(command)) {diff --git a/server/lib/tuiHandshake.test.js b/server/lib/tuiHandshake.test.jsindex a91ad96b15..d155fba7fa 100644--- a/server/lib/tuiHandshake.test.js+++ b/server/lib/tuiHandshake.test.js@@ -539,16 +539,26 @@ describe('tuiHandshake.buildTuiInvocation', () => {else process.env.CLAUDE_CODE_USE_BEDROCK = savedBedrock;});- it('uses provider.command when present and skips codex defaults for non-literal-codex command names', () => {+ it('uses provider.command when present and skips codex defaults for non-codex-basename command names', () => {const provider = { id: 'codex', command: 'my-codex-wrapper', args: ['exec', '-'] };const out = buildTuiInvocation(provider, null);expect(out.command).toBe('my-codex-wrapper');- // `applyCommandDefaults` checks `command === 'codex'` (strict). A- // wrapper name escapes the auto-inject — caller-controlled commands- // own their argv entirely.+ // `applyCommandDefaults` matches codex by basename. `my-codex-wrapper`'s+ // basename is not `codex`, so it escapes the auto-inject — a caller-+ // controlled wrapper owns its argv entirely.expect(out.args).toEqual(['exec', '-']);});+ it('injects codex defaults for an absolute codex binary path (basename-aware match)', () => {+ // A provider commonly pins the absolute path `which codex` returns; a strict+ // `=== 'codex'` would skip the defaults and leave the TUI to wedge on the+ // update modal. Basename `codex` still matches.+ const provider = { id: 'codex-tui', command: '/opt/homebrew/bin/codex', args: [] };+ const out = buildTuiInvocation(provider, null);+ expect(out.command).toBe('/opt/homebrew/bin/codex');+ expect(out.args).toEqual(['--dangerously-bypass-approvals-and-sandbox', '-c', 'check_for_update_on_startup=false']);+ });+it('infers command from id when provider.command is missing', () => {const provider = { id: 'codex' };const out = buildTuiInvocation(provider, null);diff --git a/server/services/agentCliSpawning.js b/server/services/agentCliSpawning.jsindex b45a28984e..8e270cfd4e 100644--- a/server/services/agentCliSpawning.js+++ b/server/services/agentCliSpawning.js@@ -266,8 +266,14 @@ export function buildCliSpawnConfig(provider, model, settingsEnv = {}, { systemP// buildCodexStartupArgs disables codex's startup update check so a headless// exec run never spends startup time hitting GitHub / kicking off a brew// upgrade it can't complete unattended (the fatal interactive-modal variant- // is documented on buildCodexStartupArgs in providerModels.js).- const args = ['exec', '--dangerously-bypass-approvals-and-sandbox', ...buildCodexStartupArgs(provider?.args)];+ // is documented on buildCodexStartupArgs in providerModels.js). Injected+ // UNCONDITIONALLY here (no provider.args passed): this branch builds codex's+ // argv from scratch and never forwards provider.args, and a headless CoS+ // agent can never dismiss the update modal — so the check must be off+ // regardless of any provider.args pin. (Passing provider.args would detect a+ // pin and skip injecting, but since the pin is never forwarded either, codex+ // would fall back to its check-ON default — the exact wedge this prevents.)+ const args = ['exec', '--dangerously-bypass-approvals-and-sandbox', ...buildCodexStartupArgs()];if (effectiveModel) {args.push('--model', effectiveModel);}diff --git a/server/services/agentCliSpawning.test.js b/server/services/agentCliSpawning.test.jsindex 0ab132c9c0..03122bf0b1 100644--- a/server/services/agentCliSpawning.test.js+++ b/server/services/agentCliSpawning.test.js@@ -194,13 +194,15 @@ describe('buildCliSpawnConfig', () => {expect(config.args).toEqual(['exec', '--dangerously-bypass-approvals-and-sandbox', '-c', 'check_for_update_on_startup=false', '--model', 'gpt-5.4']);});- it('does not override a Codex provider that pins the update-check config in its args', () => {+ it('disables the codex update check unconditionally on the headless agent path (ignores provider.args)', () => {+ // This builder constructs codex argv from scratch and never forwards+ // provider.args, so a provider.args pin is NOT honored here — a headless CoS+ // agent can never dismiss the update modal, so the check is always forced off.const config = buildCliSpawnConfig({ id: 'codex', command: 'codex', args: ['-c', 'check_for_update_on_startup=true'] },'gpt-5.4',);- // The user's explicit pin wins: no injected `check_for_update_on_startup=false`.- expect(config.args.filter((a) => a.startsWith('check_for_update_on_startup='))).toEqual([]);+ expect(config.args).toContain('check_for_update_on_startup=false');});it('uses agy print mode for Antigravity without model flags', () => {