Skip to content

fix(agent-presets): replace removed codex --full-auto flag#3947

Merged
saddlepaddle merged 1 commit intomainfrom
fix-codex-full-auto-flag
May 1, 2026
Merged

fix(agent-presets): replace removed codex --full-auto flag#3947
saddlepaddle merged 1 commit intomainfrom
fix-codex-full-auto-flag

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented May 1, 2026

Summary

  • Codex CLI 0.128.0 removed --full-auto from the root codex command (kept on codex exec as a deprecated alias). Launching the built-in codex preset now errors with unexpected argument '--full-auto' found, reported by Manuel.
  • Replaced with the explicit equivalent: --sandbox workspace-write --ask-for-approval never (auto-approval + workspace-write sandbox = old --full-auto behavior).
  • Updated the seed in agent-presets.ts, the builtin manifest in builtin-terminal-agents.ts, the two snapshot tests, and the terminal-presets doc.

Note: existing users who already saved the preset keep their old --full-auto args until they reset/edit — only seed defaults change here.

Test plan

  • bun test packages/shared/src/agent-command.test.ts packages/shared/src/agent-launch-request.test.ts — 14/14 pass
  • bun run lint:fix — clean
  • bun run typecheck --filter=@superset/shared --filter=@superset/host-service — clean
  • Launch a fresh workspace with the codex preset on Codex CLI 0.128.0 and confirm it starts without the unexpected-argument error

Summary by cubic

Fixes the codex preset error on Codex CLI 0.128.0 by replacing the removed --full-auto flag with its explicit equivalent. Prevents the “unexpected argument '--full-auto' found” failure when launching the preset.

  • Bug Fixes

    • Replaced --full-auto with --sandbox workspace-write and --ask-for-approval never in the codex preset and builtin terminal agent.
    • Updated docs and snapshot tests to reflect the new flags.
  • Migration

    • Existing saved presets still contain --full-auto; edit or reset them to use the new flags on Codex CLI 0.128.0+.

Written for commit 293295d. Summary will update on new commits.

Summary by CodeRabbit

  • Documentation

    • Updated terminal preset configuration documentation.
  • Tests

    • Updated test assertions for agent preset command generation and launch configurations.

Codex CLI 0.128.0 dropped --full-auto from the root command (still
deprecated on `codex exec`), so launching the codex preset errored with
"unexpected argument '--full-auto' found". Swap to the explicit
equivalent: --sandbox workspace-write --ask-for-approval never.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d33774e6-9818-4ee0-b4fc-8bd37ebf1717

📥 Commits

Reviewing files that changed from the base of the PR and between 89760c6 and 293295d.

📒 Files selected for processing (5)
  • apps/docs/content/docs/terminal-presets.mdx
  • packages/host-service/src/trpc/router/settings/agent-presets.ts
  • packages/shared/src/agent-command.test.ts
  • packages/shared/src/agent-launch-request.test.ts
  • packages/shared/src/builtin-terminal-agents.ts

📝 Walkthrough

Walkthrough

The codex agent preset configuration is updated across documentation, source code, and tests. The launch flags change from --full-auto to --sandbox workspace-write --ask-for-approval never, modifying permission and approval behavior while maintaining the workspace-sandboxed setup.

Changes

Cohort / File(s) Summary
Documentation
apps/docs/content/docs/terminal-presets.mdx
Updated codex preset command example to reflect new sandbox and approval flags instead of --full-auto.
Agent Configuration
packages/host-service/src/trpc/router/settings/agent-presets.ts, packages/shared/src/builtin-terminal-agents.ts
Updated codex agent preset command and prompt command arguments to replace --full-auto with --sandbox workspace-write --ask-for-approval never.
Test Updates
packages/shared/src/agent-command.test.ts, packages/shared/src/agent-launch-request.test.ts
Updated test expectations for codex agent generated command strings to assert new sandbox and approval flags instead of --full-auto.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 The codex learns to play it safe,
With sandboxes and permissions grazed,
No full-auto madness, but thoughtful care—
Ask before you act, with workspace to spare! 🏗️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: replacing the removed --full-auto flag with an explicit equivalent in the codex agent preset.
Description check ✅ Passed The description provides clear context about the breaking change in Codex CLI 0.128.0, explains the replacement flags, details all files affected, and includes comprehensive test results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-codex-full-auto-flag

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 1, 2026

Greptile Summary

This PR fixes a breaking change in Codex CLI 0.128.0 that removed --full-auto from the root codex command, replacing it with the semantically-equivalent --sandbox workspace-write --ask-for-approval never across agent-presets.ts, builtin-terminal-agents.ts, the two snapshot tests, and the docs. The fix is correct and complete for new installs and resetToDefaults() callers.

  • Existing users who already have the codex preset persisted in the database will continue to hit the unexpected argument '--full-auto' found error until they manually reset or edit the preset, as no DB migration is included to automatically rewrite their stored argsJson.

Confidence Score: 4/5

Safe to merge for new installs; existing users with a saved codex preset remain broken until they manually reset.

The flag replacement is correct and all changed files are consistent. The single concern — no migration for already-persisted --full-auto args — is a real user-facing gap that leaves a subset of users in a broken state post-deploy, warranting a 4 rather than 5.

packages/host-service/src/trpc/router/settings/agent-presets.ts — consider adding a DB migration alongside the seed change to fix existing rows.

Important Files Changed

Filename Overview
packages/host-service/src/trpc/router/settings/agent-presets.ts Codex preset args updated from --full-auto to --sandbox workspace-write --ask-for-approval never; no migration for existing users who already have --full-auto stored in the DB.
packages/shared/src/builtin-terminal-agents.ts Both command and promptCommand strings updated consistently to replace --full-auto with the equivalent two-flag pair.
packages/shared/src/agent-command.test.ts Snapshot updated to reflect new flag sequence; test logic unchanged.
packages/shared/src/agent-launch-request.test.ts Snapshot updated to reflect new flag sequence; test logic unchanged.
apps/docs/content/docs/terminal-presets.mdx Documentation updated to show the new --sandbox workspace-write --ask-for-approval never flags.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
packages/host-service/src/trpc/router/settings/agent-presets.ts:67-71
**No migration for existing users with `--full-auto`**

Existing users who already have the codex preset stored in the database will continue receiving the `unexpected argument '--full-auto' found` error until they manually reset or edit their preset. The seed change only affects new installs and `resetToDefaults()` callers.

Adding a targeted DB migration (finding rows with `presetId = 'codex'` and `argsJson` containing `--full-auto` and replacing those args in-place) would silently fix all affected installs on next startup — similar to how schema migrations already run in this package. Without it, existing users have no indication anything changed and no automatic recovery path.

Reviews (1): Last reviewed commit: "fix(agent-presets): replace removed code..." | Re-trigger Greptile

Comment on lines +67 to 71
"--sandbox",
"workspace-write",
"--ask-for-approval",
"never",
],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 No migration for existing users with --full-auto

Existing users who already have the codex preset stored in the database will continue receiving the unexpected argument '--full-auto' found error until they manually reset or edit their preset. The seed change only affects new installs and resetToDefaults() callers.

Adding a targeted DB migration (finding rows with presetId = 'codex' and argsJson containing --full-auto and replacing those args in-place) would silently fix all affected installs on next startup — similar to how schema migrations already run in this package. Without it, existing users have no indication anything changed and no automatic recovery path.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/host-service/src/trpc/router/settings/agent-presets.ts
Line: 67-71

Comment:
**No migration for existing users with `--full-auto`**

Existing users who already have the codex preset stored in the database will continue receiving the `unexpected argument '--full-auto' found` error until they manually reset or edit their preset. The seed change only affects new installs and `resetToDefaults()` callers.

Adding a targeted DB migration (finding rows with `presetId = 'codex'` and `argsJson` containing `--full-auto` and replacing those args in-place) would silently fix all affected installs on next startup — similar to how schema migrations already run in this package. Without it, existing users have no indication anything changed and no automatic recovery path.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

@saddlepaddle saddlepaddle merged commit 6a999e6 into main May 1, 2026
15 checks passed
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