codex icon indicating copy to clipboard operation
codex copied to clipboard

Upgrading /Permissions to Full Access does not take effect during an active task

Open rrha opened this issue 4 months ago • 12 comments

What version of Codex CLI is running?

codex-cli 0.144.4

What subscription do you have?

Plus

Which model were you using?

gpt-5.5 xhigh

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What terminal emulator and version are you using (if applicable)?

PowerShell 7.6.3

What issue are you seeing?

changing Codex permissions to Full Access while a task is already running does not update the permissions used by the active turn. The UI shows that Full Access is enabled, but subsequent tool calls continue using the previous restricted permission level. The only workaround is to stop the current task and start it again, which interrupts long-running workflows and may lose progress.

What steps can reproduce the bug?

Start a Codex task with restricted permissions, such as read-only or workspace access. Allow the task to continue running. Change the permission level to Full Access without stopping the task. Observe that the operation is still blocked or triggers an approval prompt.

What is the expected behavior?

Permission changes should apply to subsequent tool calls within the currently active task.

After selecting Full Access, Codex should be able to continue the existing workflow with the new permission level without requiring the task to be stopped or restarted.

Allow permission upgrades to be applied dynamically to the active turn, at least for subsequent tool calls.

Alternatively, the UI should clearly state that the permission change will only take effect after the current task is restarted, rather than showing Full Access as though it is already active.

Additional information

This is particularly disruptive for:

Long-running or multi-step workflows Tasks that have already accumulated significant context or progress Runs that encounter an unexpected permission requirement midway through execution Workflows where restarting may repeat work or produce inconsistent results

Additional context

This request concerns upgrading permissions during an active task. It should not require restarting or discarding the current workflow merely to grant additional access.

rrha avatar Jul 14 '26 17:07 rrha

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #32239
  • #32237

Powered by Codex Action

github-actions[bot] avatar Jul 14 '26 17:07 github-actions[bot]

I can reproduce the same active-turn boundary on macOS:

  • Codex CLI: 0.144.4
  • Platform: Darwin 25.5.0 arm64 arm
  • Terminal: iTerm2 3.6.11

After selecting and confirming Full Access during an active turn, the TUI displays Permissions updated to Full Access, but later tool calls in that same turn continue to request approval. The next user turn in the same thread uses Full Access correctly.

I traced the current main implementation (2e1607ee2fa8099a233df7437adee5f16a741905) and found the following:

  1. The TUI immediately inserts the success message and sends an OverrideTurnContext action: https://github.com/openai/codex/blob/2e1607ee2fa8099a233df7437adee5f16a741905/codex-rs/tui/src/chatwidget/permission_popups.rs#L248-L273

  2. The action is translated into thread/settings/update: https://github.com/openai/codex/blob/2e1607ee2fa8099a233df7437adee5f16a741905/codex-rs/tui/src/app/thread_settings.rs#L94-L134

  3. Session::update_settings updates the stored SessionConfiguration, but it does not update the already-created TurnContext: https://github.com/openai/codex/blob/2e1607ee2fa8099a233df7437adee5f16a741905/codex-rs/core/src/session/mod.rs#L1440-L1477

  4. Approval calculation and shell execution continue reading the active turn's frozen approval policy and permission profile: https://github.com/openai/codex/blob/2e1607ee2fa8099a233df7437adee5f16a741905/codex-rs/core/src/tools/handlers/shell.rs#L168-L219 https://github.com/openai/codex/blob/2e1607ee2fa8099a233df7437adee5f16a741905/codex-rs/core/src/tools/orchestrator.rs#L137-L168

The built-in Full Access preset is unambiguous: AskForApproval::Never plus PermissionProfile::Disabled: https://github.com/openai/codex/blob/2e1607ee2fa8099a233df7437adee5f16a741905/codex-rs/utils/approval-presets/src/lib.rs#L50-L59

Suggested approval-boundary behavior

Before emitting a user approval request for ExecApprovalRequirement::NeedsApproval, re-read the thread's latest effective settings (for example through Session::thread_config_snapshot) rather than relying only on the turn-frozen values.

If the latest acknowledged settings are Full Access (approval_policy == Never and the effective permission profile is PermissionProfile::Disabled):

  • do not emit another approval prompt;
  • recompute the requirement as Skip;
  • execute the call using the refreshed Full Access profile, not the stale restricted sandbox profile; and
  • invalidate or auto-resolve an already-pending stale approval request after the Full Access update is acknowledged.

This check could happen immediately before resolve_tool_apporval in the NeedsApproval path. It is important to refresh both the approval decision and the execution/sandbox permissions; merely hiding the prompt would otherwise leave the command running under the stale restricted profile.

This would provide a natural synchronization boundary without requiring every part of TurnContext to become mutable: a tool call that reaches an approval boundary can observe the user's explicit Full Access upgrade and continue without interrupting the active task. If active-turn adoption is intentionally unsupported, the TUI message should instead say that the change applies starting with the next turn.

xiaost avatar Jul 15 '26 08:07 xiaost

I can reproduce the same active-turn failure in a Linux/WSL environment with Codex CLI 0.144.4.

After the TUI says Permissions updated to Full Access, the active task still asks for approval for repository-local commands, e.g.:

npm run pipeline:docs:refresh
npm run pipeline:docs:check

The stated reason is that the local TypeScript tool needs a temporary local IPC socket. I approved and allowlisted npm run pipeline:docs:refresh, which then completed, but the following npm run pipeline:docs:check immediately prompted again for the same reason.

This is disruptive for unattended/YOLO workflows: Full Access is visibly acknowledged, yet each new command prefix can still interrupt the already-running task. The failure is not specific to network access; these are repository-local documentation commands using a temporary local IPC socket.

simfor99 avatar Jul 15 '26 11:07 simfor99

Update: I rebuilt this as a clean commit from current main and corrected test-compilation issues found in my initial draft.

Patch: https://github.com/simfor99/codex/commit/26e1b05 Compare: https://github.com/openai/codex/compare/main...simfor99:codex:fix/active-turn-permissions-clean?expand=1

The change keeps the active turn’s approval_policy and permission_profile behind shared locks, so Session::update_settings updates the values used by subsequent tool calls in the already-running turn. It also refreshes the MCP manager.

Regression coverage:

  • update_settings_applies_permissions_to_an_active_turn (core)
  • thread_settings_update_applies_full_access_to_an_active_turn (app server)

Validated:

  • just fmt
  • just test -p codex-core update_settings_applies_permissions_to_an_active_turn (1 passed, 2972 skipped)
  • just test -p codex-app-server thread_settings_update_applies_full_access_to_an_active_turn (1 passed, 982 skipped)
  • just fix -p codex-core

The previous commit linked here is superseded by this one. I could not open an upstream PR because this repository restricts PR creation to collaborators, but this branch and commit are available to cherry-pick.

simfor99 avatar Jul 15 '26 14:07 simfor99

I can reproduce this behavior as well.

Environment:

  • Codex CLI: codex-cli 0.145.0
  • Platform: Linux / Ubuntu
  • Terminal: SSH Terminal
  • Uploaded thread: 019fc4df-715d-7e52-b466-f70a94eee9aa

During an active, long-running task, I changed /permissions from the middle/workspace permission tier to Full Access. Codex confirmed that Full Access was selected, but subsequent commands in the same active task continued requesting approval under the previous permission level.

Changing permissions during a session should update the effective permission state for subsequent tool calls without requiring the current task to be cancelled or restarted.

Ideally, after Full Access is confirmed:

  • future tool calls in the active task should use Full Access immediately;
  • stale approval requests created under the previous permission level should be invalidated;
  • the UI should clearly display the effective permission level used by the current tool call.

Restarting a long-running task is disruptive because it can repeat work, lose execution progress, or cause the agent to abandon the original workflow.

explcre avatar Aug 02 '26 23:08 explcre

Corroborating this on Windows 11 with Codex Desktop 26.803.10989.0 (ChatGPT Desktop 1.2026.190.0).

Observed sequence:

  1. A parent task was running with Full Access / approvals disabled.
  2. A separate user-owned task created through the app's create_thread route began with recorded effective settings workspace-write / approval_policy: on-request / restricted filesystem. The creation route exposed no permission parameter and did not inherit the parent's mode. This part overlaps #25810.
  3. The created task was opened and Full Access was selected in the UI.
  4. The bottom bar then showed the orange Full Access label, but the already-active turn continued enforcing the older restricted approval state and requested approval for nearly every command.

The misleading part is therefore not only that the new task starts restricted: after the UI switch, the visible label says Full Access while the active turn still behaves as restricted. A worker can reasonably trust the displayed mode and misdiagnose the resulting prompts as its own orchestration error.

No repository-specific behavior was involved. The safe operational workaround is to treat the label as requested state only: stop the active turn, start a new turn after selecting the mode, and verify the new turn's recorded effective permission tuple before substantive commands. A mid-turn UI change did not repair the running turn in this reproduction.

Wolfsblvt avatar Aug 13 '26 23:08 Wolfsblvt

Is this ever gonna be fixed?

F1xGOD avatar Sep 28 '26 17:09 F1xGOD

Is this ever gonna be fixed?

probably not anytime soon with over 19,400 open issues right now the codex team is strictly prioritizing enterprise customers unless a big company complains about it we're stuck waiting

rrha avatar Sep 30 '26 02:09 rrha

中文

希望权限切换时,界面能直接告诉我新设置何时生效。

任务正在执行时,我把权限改为“完全访问”,自然会期待接下来的操作使用新权限。如果要等下一轮才生效,选择器旁边应显示“下一轮生效”,并保留当前任务实际使用的权限。现在选了什么、当前生效的是什么,应该一眼就能看清。

长任务中途遇到权限问题,停下来再启动会打断工作。希望能在后续工具调用前应用新设置,并从原进度继续。若需要重新启动这一轮,请提供明确的操作入口,接续已有工作,避免重复执行已经完成的步骤。

降低权限时也需要清楚的状态提示。切换后,用户应立即知道当前任务是否仍在使用原来的权限,以及新限制从哪一步开始执行。执行期间追加一条消息是否会触发新权限,也请在界面里说明。

English

Please make it clear in the permission selector when a change takes effect.

When I select Full Access while a task is running, I expect the next operations to use it. If the change takes effect on the next turn, show “Applies next turn” beside the selector and keep the active task’s effective permissions visible. I should be able to tell at a glance what I selected and what the task is currently using.

Stopping and restarting a long task breaks the workflow. Ideally, a permission change would apply before the next tool call, with the task continuing from its existing progress. If restarting the turn is necessary, provide a clear action that resumes the work without repeating completed steps.

The same clarity matters when reducing access. After a change, show whether the active task still has its previous permissions and where the new restrictions will begin to apply. Please also explain in the UI whether sending a follow-up message during execution activates the new settings.

explorerzkb avatar Oct 07 '26 12:10 explorerzkb

Additional Windows Desktop reproduction (2026-10-25):

  • Environment: Windows 11 (NT 10.0.26200), Codex CLI 0.163.0-alpha.11.1, local project-backed chats in the desktop app. User config contained approval_policy = "never" and sandbox_mode = "danger-full-access".
  • A newly created project chat's initial turn nevertheless started with effective on-request / workspace permissions. The user changed that chat to Full access while the turn was active. A subsequent settings event showed never / danger-full-access, but the running turn continued to behave as restricted: an ordinary Git check against the working repository returned permission denied, and a Godot headless startup in that turn crashed with signal 11 before printing its engine banner. An explicitly escalated command still produced an approval prompt even though the UI showed Full access.
  • Control: the same Godot headless startup succeeded from an unrestricted coordinator session. After the affected chat's active turn ended, a fresh turn in that same chat ran ordinary Git status and the same Godot startup successfully (both exit 0), then ran the game's focused test. No game-source change or Godot reinstall occurred between these attempts.

This supports a stale active-turn executor/permission context after the UI setting changes. The sandbox-only Godot crash is an especially confusing symptom because it looks like an application failure rather than an access-mode mismatch. Expected: either apply the new profile to subsequent tool calls in the active turn, or clearly say that a new turn is required and avoid showing the current turn as Full access. The user reports encountering this approval behavior repeatedly across coding work.

This comment intentionally omits private project paths, conversation identifiers, raw logs, and diagnostic uploads.

EnochLeBaron avatar Oct 25 '26 16:10 EnochLeBaron

Still reproducible with Codex CLI 0.164.0 on macOS arm64.

Persisted thread settings showed sandbox disabled, but the active turn retained workspace-write with network_access=false. gh failed to connect, and direct TCP connections returned EPERM.

After the turn ended, a fresh turn in the same thread received Full Access and gh succeeded immediately. Follow-up messages during the active turn did not refresh its permissions.

vjeranc avatar Oct 27 '26 07:10 vjeranc

Additional reproduction report (Windows Codex CLI / Windows Terminal, 20 November 2026):

  • In a running or resumed Codex terminal session, choose /permissions and set Full Access.
  • The permissions display confirms Full Access, but subsequent ordinary development commands still trigger repeated approval prompts.
  • Re-selecting Full Access inside the affected session does not reliably resolve the prompts.
  • This has occurred intermittently across multiple sessions, rather than as a one-off.
  • Fully closing Codex and reopening it generally restores the intended behavior. That workaround interrupts long-running autonomous development.
  • The same installation has also used long-running /goal sessions, although it is not established whether /goal causes the permission mismatch.

Expected: the effective approval/sandbox policy for subsequent normal operations should match the Full Access setting displayed in /permissions, or the terminal should clearly indicate if a session restart is required.

Actual: the terminal indicates Full Access while continuing to request manual approval until Codex is fully restarted.

Please investigate whether the CLI session retains a stale effective permission/approval context after an in-session /permissions change. Specific command prompt text, Codex CLI version and diagnostic logs have not yet been captured. No project identifiers or private paths are included here.

Killertom63 avatar Nov 20 '26 14:11 Killertom63