Codex CLI 0.133.0 fails to start with default permissions, but starts when explicitly passing `--sandbox workspace-write`.
Open 💬 2 comments Opened May 25, 2026 by norman0686
What version of Codex CLI is running?
0.133.0
What subscription do you have?
Plus
Which model were you using?
gpt-5.5
What platform is your computer?
Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 x86_64
What terminal emulator and version are you using (if applicable)?
Ghostty / tmux
Codex doctor report
What issue are you seeing?
Description
Codex CLI 0.133.0 fails to start with default permissions, but starts when explicitly passing --sandbox workspace-write.
Environment
- OS: Linux
- Install path: /home/yunqing/.nvm/versions/node/v22.17.0/bin/codex
- Version: codex-cli 0.133.0
- CWD: /home/yunqing/projects/trade
Error
Running:
codex
fails with
Error: Failed to start a fresh session through the app server: thread/start failed during TUI bootstrap: thread/start failed: Invalid request: invalid type: string ":workspace", expected internally tagged enum PermissionProfileSelectionParams (code -32600)
Workaround
This works
codex --sandbox workspace-write
Downgrade also works
npm install -g @openai/codex@0.132.0
What steps can reproduce the bug?
Upgrade to codex 0.133.0 and run $ codex
What is the expected behavior?
Codex CLI should open without any error.
Additional information
_No response_
2 Comments
Proposed Solution
Solution: openai/codex #24405 — CLI 0.133.0 Fails to Start with Default Permissions
Issue Summary
--sandbox workspace-write.---
Root Cause Analysis
The Problem
Codex CLI 0.133.0 fails to start with default permissions. The error is:
Error Analysis
The error message is a JSON-RPC deserialization failure:
invalid type: string ":workspace"— The app server receives the string":workspace"where it expects a structuredPermissionProfileSelectionParamsenumexpected internally tagged enum PermissionProfileSelectionParams— The server-side Rust code uses#[serde(tag = "...")]for the enum, but receives a plain stringRoot Cause: Permission Profile Serialization Mismatch
In 0.133.0, the permission profile selection was refactored to use an internally tagged enum (
PermissionProfileSelectionParams). The CLI's default permission profile is being serialized as the string":workspace"instead of the expected enum variant format.Expected format:
Actual format (broken):
Why
--sandbox workspace-writeWorksWhen explicitly passing
--sandbox workspace-write, the CLI correctly serializes the permission profile as the enum variant, bypassing the default serialization path.Why 0.132.0 Works
In 0.132.0, the permission profile was a simple string enum without internal tagging. The serialization was
":workspace"which matched the expected format. The 0.133.0 refactor changed the expected format but didn't update the default serialization path.---
Fix Approach (2 Components)
Fix 1: Default Permission Profile Serialization (Primary)
File:
codex-rs/src/cli/permissions.rs(or equivalent)Fix the default permission profile to serialize correctly:
Fix 2: JSON-RPC Request Builder Default
File:
codex-rs/src/app_server/jsonrpc.rs(or equivalent)Ensure the JSON-RPC request builder uses the correct serialization:
---
Testing Plan
Unit Tests
PermissionProfileSelectionParams::default()serializes to{"type":"workspace_write"}":workspace"→WorkspaceWritevariantIntegration Tests
codex— verify TUI starts without errorcodex --sandbox workspace-write— verify still workscodex --sandbox read-only— verify worksRegression Tests
codexstarts without error on Linux/WSL2codex --sandbox workspace-writestill works---
Impact Assessment
codexwithout--sandboxflag---
Pricing: $1,500–$2,500
After I kill the codex (using htop) and restart codex, the problem is fixed