Skip to content

hotfix: remove [permissions.airc.filesystem] block that breaks Codex startup (regression from #364) - #366

Merged
joelteply merged 1 commit into
canaryfrom
hotfix/codex-filesystem-block-breaks-startup-364
Apr 30, 2026
Merged

joelteply merged 1 commit into
canaryfrom
hotfix/codex-filesystem-block-breaks-startup-364

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

🚨 Hotfix — regression from #364 takes Codex offline.

The filesystem-permission block added in #364's second commit broke Codex on startup with:

Error loading configuration: permissions profile requests filesystem writes outside the workspace root, which is not supported until the runtime enforces FileSystemSandboxPolicy directly

Codex 0.125's runtime can't honor home-dir-scoped filesystem grants in named profiles yet. Even the :project_roots-only variant didn't help. On every machine that ran the merged #364, the next codex invocation fails to start until the block is removed from ~/.codex/config.toml manually.

Surfaced live during Joel's codex first-encounter QA — Codex hard-failed at config load right after the post-#364 restart.

Two-part hotfix

  1. Stop writing the [permissions.airc.filesystem] block. Replaced the write code with a comment explaining why the block is omitted + pointer at git history for the prior version. Living with Codex's harmless 'does not define any recognized filesystem entries' warning is preferable to a hard-fail-on-startup that takes Codex offline entirely.

  2. Add a cleanup step that detects + strips the broken block in existing ~/.codex/config.toml files. Without this, every user who already ran feat(install): airc skills auto-install into Codex too (same SKILL.md format) #364 has a permanently broken Codex until they hand-edit. Cleanup uses Python (we have the venv from cryptography) for section-aware strip — handles the leading # airc filesystem permissions comment and any [permissions.airc.filesystem.<sub>] children in one pass. Runs every install.sh invocation; idempotent (no-op when block absent).

Tested on this Mac

$ # simulated stale block
$ AIRC_INSTALL_NO_PULL=1 AIRC_DIR=$HOME/.airc-src bash install.sh
   ...
   -> Removing stale [permissions.airc.filesystem] block from ~/.codex/config.toml ...

$ codex exec --skip-git-repo-check 'true'
OpenAI Codex v0.125.0 (research preview)        # ← starts cleanly now
$ echo $?
0

Network profile + skill symlinks from #364 stay intact and continue working — only the filesystem block is removed.

Open follow-up

Codex's docs claim filesystem profiles are supported per the config-reference, but the runtime rejects them. Possibly a 0.125-vs-newer-version gap. When/if Codex's runtime adds support, restore the block — history is in git log -- install.sh.

Test plan

  • Live test: simulated stale block in config.toml → install.sh detects + strips → codex exec starts (rc=0)
  • bash -n install.sh syntax check
  • Re-run idempotency: install.sh on cleaned config = no-op, no spurious changes
  • Network profile + skills still installed correctly
  • CI: clean-install jobs pass on the 4 platforms (no regression elsewhere)

🤖 Generated with Claude Code

…startup (regression from #364)

The filesystem-permission block added in the second commit of #364
broke Codex on startup with:

  Error loading configuration: permissions profile requests filesystem
  writes outside the workspace root, which is not supported until the
  runtime enforces FileSystemSandboxPolicy directly

Codex 0.125's runtime can't honor home-dir-scoped filesystem grants
in named profiles yet. Even the :project_roots-only variant didn't
help (the block was rejected as a whole). On every machine that ran
the merged #364, the next codex invocation fails to start until the
block is removed from ~/.codex/config.toml manually.

Surfaced live during the codex first-encounter QA: after Joel restarted
Codex post-#364 merge, Codex hard-failed at config load with the
above error.

Two-part hotfix:

1. Stop writing the [permissions.airc.filesystem] block. Replace the
   write code with a comment explaining why the block is omitted and
   pointing at git history for the prior version. Living with Codex's
   harmless 'does not define any recognized filesystem entries'
   warning is preferable to a hard-fail-on-startup that takes Codex
   offline entirely.

2. Add a cleanup step that DETECTS the broken block in existing
   ~/.codex/config.toml files and strips it. Without this, every
   user who already ran #364 has a permanently broken Codex until
   they hand-edit. Cleanup uses Python with the existing venv
   (we have it from cryptography) to do a section-aware strip;
   handles the leading '# airc filesystem permissions' comment and
   any [permissions.airc.filesystem.<sub>] children in one pass.
   Runs every install.sh invocation; idempotent (no-op when the
   block is already absent). Collapses runs of >2 blank lines that
   the strip might have left.

Tested on this Mac:
  - simulated stale block → install.sh detects + strips
  - Codex (codex exec) starts cleanly after cleanup
  - re-runs of install.sh on cleaned config: no-op, no spurious changes

Network profile + skill symlinks from #364 stay intact and continue
working — only the filesystem block is removed.

Open question / followup: Codex's docs claim filesystem profiles are
supported per the config-reference, but the runtime rejects them.
Possibly a 0.125-vs-newer-version gap. When/if Codex's runtime adds
support, restore the block (history at git log -- install.sh).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant