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: run Codex TUI fully bypassed instead of only suppressing approvals
[._.]/ Adam Eivyc7c6f5a154ed
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 8f7dad716d..0fb2bf94ab 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -40,6 +40,7 @@## Changed+- **Codex TUI runs fully bypassed** — Codex now launches in TUI mode with `--dangerously-bypass-approvals-and-sandbox` (the same full-yolo posture the headless CLI path already used), instead of only `--ask-for-approval never`. The previous flag suppressed approval prompts but kept Codex's sandbox on, so tool calls that needed real file or network writes still got blocked. Provider configs that pin their own `--ask-for-approval` / `--sandbox` policy are left untouched.- **[issue-733]** "Finish the draft" editorial findings now carry an explicit marker for whether their suggestion is delta advice or a full page replacement, so comic-script panel rewrites and ordinary prose suggestions are handled by the right fix path. Internal maintenance change with no behavior difference.- **[issue-832]** The Review Hub's draft lookup now asks the data layer for just the unsent drafts it needs instead of loading every draft and filtering them in memory. Internal performance change with no behavior difference.- **[issue-705]** CyberCity now coalesces bursts of agent spawn/complete events into a single refresh instead of refetching once per event, so a wave of agents starting no longer fans out redundant requests. Internal performance change with no behavior difference.diff --git a/server/lib/tuiHandshake.js b/server/lib/tuiHandshake.jsindex c5e5b65591..84f53ac742 100644--- a/server/lib/tuiHandshake.js+++ b/server/lib/tuiHandshake.js@@ -70,11 +70,15 @@ export function inferTuiCommand(id) {return 'claude';}-// Codex TUI blocks on every tool approval without `--ask-for-approval never`.-// No human-at-keyboard for headless calls (one-shot OR agent), so inject it.+// Codex TUI blocks on every tool approval AND sandboxes file/network writes+// unless we run it fully bypassed. There's no human-at-keyboard for headless+// calls (one-shot OR agent), so inject the full-yolo flag — the same posture+// the CLI/exec path uses in `agentCliSpawning.js`. The bypass flag is mutually+// exclusive with `--ask-for-approval` / `--sandbox`, so don't add it when the+// provider config already pins an approval/sandbox/bypass policy of its own.export function applyCommandDefaults(command, args) {- if (command === 'codex' && !args.includes('--ask-for-approval')) {- return ['--ask-for-approval', 'never', ...args];+ if (command === 'codex' && !codexHasApprovalPolicy(args)) {+ return ['--dangerously-bypass-approvals-and-sandbox', ...args];}if (isAntigravityCommand(command)) {return ensureAntigravityTuiArgs(args);@@ -82,6 +86,16 @@ export function applyCommandDefaults(command, args) {return args;}+// True when the codex argv already declares an approval/sandbox posture, so+// injecting `--dangerously-bypass-approvals-and-sandbox` would collide with it.+function codexHasApprovalPolicy(args) {+ return args.some(arg =>+ arg === '--ask-for-approval' || arg === '-a' || arg.startsWith('-a=') || arg.startsWith('--ask-for-approval=') ||+ arg === '--sandbox' || arg === '-s' || arg.startsWith('-s=') || arg.startsWith('--sandbox=') ||+ arg === '--dangerously-bypass-approvals-and-sandbox' || arg === '--yolo'+ );+}+/*** Build the spawn args for a TUI invocation. When `provider.args` already* has a `--model X` (or `-m X`) pin, the args-baked flag wins and we skipdiff --git a/server/lib/tuiHandshake.test.js b/server/lib/tuiHandshake.test.jsindex 828cae70e9..899e676d19 100644--- a/server/lib/tuiHandshake.test.js+++ b/server/lib/tuiHandshake.test.js@@ -105,9 +105,9 @@ describe('tuiHandshake.inferTuiCommand', () => {});describe('tuiHandshake.applyCommandDefaults', () => {- it('injects `--ask-for-approval never` for codex when not already present', () => {+ it('injects `--dangerously-bypass-approvals-and-sandbox` for codex when not already present', () => {expect(applyCommandDefaults('codex', ['exec', '-'])).toEqual([- '--ask-for-approval', 'never', 'exec', '-',+ '--dangerously-bypass-approvals-and-sandbox', 'exec', '-',]);});@@ -116,6 +116,16 @@ describe('tuiHandshake.applyCommandDefaults', () => {expect(applyCommandDefaults('codex', args)).toBe(args);});+ it('passes codex args through unchanged when --sandbox is already present', () => {+ const args = ['--sandbox', 'workspace-write', 'exec', '-'];+ expect(applyCommandDefaults('codex', args)).toBe(args);+ });++ it('does not duplicate the bypass flag when codex args already pin it', () => {+ const args = ['--dangerously-bypass-approvals-and-sandbox', 'exec', '-'];+ expect(applyCommandDefaults('codex', args)).toBe(args);+ });+it('passes non-codex commands through unchanged', () => {const args = ['-p', '-'];expect(applyCommandDefaults('claude', args)).toBe(args);@@ -153,7 +163,7 @@ describe('tuiHandshake.buildTuiInvocation', () => {const provider = { id: 'codex' };const out = buildTuiInvocation(provider, null);expect(out.command).toBe('codex');- expect(out.args).toEqual(['--ask-for-approval', 'never']);+ expect(out.args).toEqual(['--dangerously-bypass-approvals-and-sandbox']);});it('appends --model when caller passes a model and provider.args has no model flag', () => {@@ -178,7 +188,7 @@ describe('tuiHandshake.buildTuiInvocation', () => {// resolveCliModel(CODEX_CONFIGURED_DEFAULT) returns null → no flag.const provider = { id: 'codex', args: ['exec', '-'] };const out = buildTuiInvocation(provider, CODEX_CONFIGURED_DEFAULT);- expect(out.args).toEqual(['--ask-for-approval', 'never', 'exec', '-']);+ expect(out.args).toEqual(['--dangerously-bypass-approvals-and-sandbox', 'exec', '-']);});it('skips --model injection when model is null/undefined/empty', () => {diff --git a/server/services/agentTuiSpawning.test.js b/server/services/agentTuiSpawning.test.jsindex af47e27895..94375abade 100644--- a/server/services/agentTuiSpawning.test.js+++ b/server/services/agentTuiSpawning.test.js@@ -142,21 +142,21 @@ describe('agent TUI spawning', () => {}, 'codex-configured-default');expect(config.command).toBe('codex');- expect(config.args).toEqual(['--ask-for-approval', 'never']);- expect(config.commandLine).toBe('codex --ask-for-approval never');+ expect(config.args).toEqual(['--dangerously-bypass-approvals-and-sandbox']);+ expect(config.commandLine).toBe('codex --dangerously-bypass-approvals-and-sandbox');});- it('injects --ask-for-approval never for codex TUI when not already set', () => {+ it('injects --dangerously-bypass-approvals-and-sandbox for codex TUI when not already set', () => {const config = buildTuiSpawnConfig({id: 'codex-tui',command: 'codex',type: 'tui',args: ['--cd', '/tmp/work']}, null);- expect(config.args).toEqual(['--ask-for-approval', 'never', '--cd', '/tmp/work']);+ expect(config.args).toEqual(['--dangerously-bypass-approvals-and-sandbox', '--cd', '/tmp/work']);});- it('does not duplicate --ask-for-approval when the provider config already pins it', () => {+ it('does not inject the bypass flag when the provider config already pins an approval policy', () => {const config = buildTuiSpawnConfig({id: 'codex-tui',command: 'codex',@@ -166,7 +166,7 @@ describe('agent TUI spawning', () => {expect(config.args).toEqual(['--ask-for-approval', 'on-failure']);});- it('does not inject --ask-for-approval for non-codex TUI commands', () => {+ it('does not inject the bypass flag for non-codex TUI commands', () => {const config = buildTuiSpawnConfig({id: 'claude-code-tui',command: 'claude',@@ -215,8 +215,8 @@ describe('agent TUI spawning', () => {it('omits the --model flag when model is null/empty', () => {const config = buildTuiSpawnConfig({ id: 'codex-tui', command: 'codex', type: 'tui', args: [] }, null);- expect(config.args).toEqual(['--ask-for-approval', 'never']);- expect(config.commandLine).toBe('codex --ask-for-approval never');+ expect(config.args).toEqual(['--dangerously-bypass-approvals-and-sandbox']);+ expect(config.commandLine).toBe('codex --dangerously-bypass-approvals-and-sandbox');});});