Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

fix(codex): full filesystem + auto-approval from spawn (claude parity)

Chaitanya Giri378653d0881d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4c1b7ba8..ada322da 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ started in 0.3.0 (which caught up missed *schedules* and auto-revived wedged *te
but left the *router* out).
### Fixed
+- **Codex hive workers get full filesystem + auto-approval from spawn (parity with Claude).** A Codex-engine agent in auto mode launched with `-a never -s workspace-write`, whose sandbox scopes writes to the PTY cwd (the user's project). But a hive worker must also write to its agent folder at `<harnessHome>/hive/agents/<id>/` (move `inbox/` → `.done/`, append `memory.md`, drop outbox JSON, write deliverables) — a **different path tree from cwd**, which `workspace-write` blocked. So a freshly spawned Codex worker couldn't complete HIVE PROTOCOL housekeeping and reported "it does not have permissions … grant write permission to the agent folder." Codex's auto-mode flag is now `--dangerously-bypass-approvals-and-sandbox` — the documented equivalent of Claude's `bypassPermissions` / Antigravity's `--dangerously-skip-permissions` (skip all approval prompts **and** drop the OS sandbox), so a Codex worker has the same filesystem access and auto-approval as a Claude worker from the get-go (`src/shared/agentProvider.ts`; reference/copy updated in `src/shared/codexCommands.ts`, `OnboardingWizard.tsx`, `renderer/store/config.ts`). Claude/agy/antigravity behavior is unchanged.
- **Re-arm the hive message router on wake (god→worker delivery survives sleep).** The outbox→inbox router is a `setInterval` (`hive.routeOnce` every ~1.5s) that, like the always-on beats, freezes during true macOS system sleep. `onSystemResume()` already re-armed the mission scheduler, the fleet/breaker beats, and keep-awake on `powerMonitor` `resume`/`unlock-screen` — but it never re-armed the router. So after a long sleep (e.g. laptop closed overnight) the scheduler→god path recovered while **every agent's outbox silently stopped draining**: god→worker, worker↔worker, and broadcast mail piled up undelivered, and no `message` event was logged. The resume handler now re-arms the router (clear-then-set, idempotent) **and** immediately drains the accumulated backlog instead of waiting for the first post-wake tick; the renderer's idle inbox-wake nudge then wakes each parked recipient once its mail lands (`src/main/index.ts`). Verified by `scripts/verify-keepalive-catchup.mjs` (now also reproduces the pre-fix backlog stall and proves the re-arm + flush).
## [0.3.0] — 2026-06-21
diff --git a/src/renderer/src/components/OnboardingWizard.tsx b/src/renderer/src/components/OnboardingWizard.tsx
index 1faeffcf..cbb176c1 100644
--- a/src/renderer/src/components/OnboardingWizard.tsx
+++ b/src/renderer/src/components/OnboardingWizard.tsx
@@ -512,8 +512,8 @@ export function OnboardingWizard({ onComplete }: OnboardingWizardProps) {
<>
{/* AUTONOMY — merged from the old "auto mode" step (item 5). One choice
that maps to each engine's flag (item 6): autoMode → claude
- bypassPermissions / codex -a never, etc.; off → each engine's
- ask-first default. */}
+ bypassPermissions / codex --dangerously-bypass-approvals-and-sandbox,
+ etc.; off → each engine's ask-first default. */}
<div style={{ fontFamily: 'var(--cth-font-display)', fontSize: 10, color: 'var(--cth-ink-700)' }}>
HOW MUCH CAN AGENTS DO ON THEIR OWN?
</div>
@@ -540,7 +540,7 @@ export function OnboardingWizard({ onComplete }: OnboardingWizardProps) {
? 'On. Agents carry out tasks without stopping to ask — the smoothest experience.'
: 'Off. Agents pause and ask you before changing files or running commands.')
: (autoMode
- ? 'On. Agents never pause — Claude runs bypassPermissions, Codex -a never, etc.'
+ ? 'On. Agents never pause — Claude runs bypassPermissions, Codex bypasses approvals + sandbox, etc.'
: 'Off. Each agent asks before edits / shell commands (Claude default, codex -a untrusted, …).')}
</div>
</div>
diff --git a/src/renderer/src/store/config.ts b/src/renderer/src/store/config.ts
index 02a1391d..354d84c5 100644
--- a/src/renderer/src/store/config.ts
+++ b/src/renderer/src/store/config.ts
@@ -213,7 +213,7 @@ export function buildSpawnCommand(
cmd = `${cmd} ${preset.modelFlag} ${m}`;
}
// Auto (skip-permissions) mode appends each provider's own flag — Claude's
- // bypassPermissions, codex's `-a never -s workspace-write`, agy's skip flag.
+ // bypassPermissions, codex's `--dangerously-bypass-approvals-and-sandbox`, agy's skip flag.
if (config.autoMode && preset.autoFlag) cmd = `${cmd} ${preset.autoFlag}`;
return cmd;
}
diff --git a/src/shared/agentProvider.ts b/src/shared/agentProvider.ts
index f6987f23..546372ef 100644
--- a/src/shared/agentProvider.ts
+++ b/src/shared/agentProvider.ts
@@ -147,11 +147,17 @@ export const AGENT_PROVIDER_PRESETS: AgentProviderPreset[] = [
label: 'Codex',
defaultCommand: 'codex',
commandGroups: CODEX_COMMAND_GROUPS,
- // -a never: never prompt for approval; -s workspace-write: sandbox scoped to
- // the workspace (no outbound network). Matches the non-interactive intent of
- // Claude's bypassPermissions while retaining a safety boundary.
- autoModeFlag: '-a never -s workspace-write',
- autoFlag: '-a never -s workspace-write',
+ // Full claude-parity auto mode: skip ALL approval prompts AND drop the sandbox,
+ // exactly like Claude's `bypassPermissions` / agy's `--dangerously-skip-permissions`.
+ // The earlier `-a never -s workspace-write` confined writes to the PTY cwd
+ // (the user's project), but a hive worker must also write to its agent folder
+ // at <harnessHome>/hive/agents/<id>/ (inbox→.done, memory.md, outbox JSON,
+ // deliverables) — a DIFFERENT path tree from cwd, which workspace-write blocked,
+ // so codex workers couldn't do HIVE PROTOCOL housekeeping. The single bypass flag
+ // is codex's documented equivalent of `--dangerously-skip-permissions` (no -a/-s
+ // alongside it). The app already runs claude/agy in this same full-access posture.
+ autoModeFlag: '--dangerously-bypass-approvals-and-sandbox',
+ autoFlag: '--dangerously-bypass-approvals-and-sandbox',
// Suppresses first-run interactive prompts (directory-trust gate, installer).
nonInteractiveEnv: { CODEX_NON_INTERACTIVE: '1' },
supportsModel: true,
diff --git a/src/shared/codexCommands.ts b/src/shared/codexCommands.ts
index 6e552478..e48a2711 100644
--- a/src/shared/codexCommands.ts
+++ b/src/shared/codexCommands.ts
@@ -41,8 +41,8 @@ export const CODEX_COMMAND_GROUPS: CmdGroup[] = [
{
title: 'APPROVALS & PERMISSIONS',
items: [
- { cmd: 'codex -a never -s workspace-write', kind: 'cli', desc: 'Auto mode: never prompt for approval (-a never) and scope the sandbox to the workspace (-s workspace-write). Used by Munder Difflin when auto mode is on.' },
- { cmd: 'codex --dangerously-bypass-approvals-and-sandbox', kind: 'cli', desc: 'Skip all approval prompts AND disable the OS sandbox entirely. CI-only full-bypass override — for externally-isolated environments (Docker, CI VM) only.' },
+ { cmd: 'codex --dangerously-bypass-approvals-and-sandbox', kind: 'cli', desc: 'Auto mode: skip ALL approval prompts AND drop the OS sandbox (full filesystem access). Used by Munder Difflin when auto mode is on — full parity with Claude bypassPermissions, and required so a hive worker can write to its agent folder outside the project cwd.' },
+ { cmd: 'codex -a never -s workspace-write', kind: 'cli', desc: 'Never prompt for approval (-a never) but scope the sandbox to the project workspace (-s workspace-write). Safer, but blocks writes outside cwd (e.g. a hive agent folder in another path tree).' },
{ cmd: 'codex -a untrusted', kind: 'cli', desc: 'Only run trusted commands without asking; escalate to the user for anything else.' },
{ cmd: 'codex -s danger-full-access', kind: 'cli', desc: 'Remove all sandbox restrictions (fine-grained flag — pair with -a for full control).' }
]