codex - ✅(Solved) Fix TUI: /side cannot access /permissions, and returning from /side can restore stale main-thread permissions [1 pull requests, 3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18854Fetched 2026-04-22 07:51:28
View on GitHub
Comments
3
Participants
3
Timeline
10
Reactions
0
Timeline (top)
labeled ×4commented ×3unlabeled ×2cross-referenced ×1

I found two related TUI issues around /side:

  1. /permissions is not available inside /side, even though it is useful there for switching between safe modes like Default and Read Only.
  2. Returning from /side can restore stale main-thread permission state.

Root Cause

The two issues are related because /permissions inside /side is useful, but it also makes the stale-restore behavior more visible.

Fix Action

Fixed

PR fix notes

PR #18924: TUI: preserve permission state after side conversations

Description (problem / solution / changelog)

Addresses #18854

Why

The /permissions selector updates the active TUI session state, but the cached session snapshot used when replaying a thread could still contain the old approval or sandbox settings. After opening and leaving /side, the main thread replay could restore those stale settings into the ChatWidget, so the UI and the next submitted turn could fall back to the old permission mode.

What

  • Sync the active thread's cached ThreadSessionState whenever approval policy, sandbox policy, or approval reviewer changes.

Verification

Confirmed bug prior to fix and correct behavior after fix.

Changed files

  • codex-rs/tui/src/app/config_persistence.rs (modified, +2/-0)
  • codex-rs/tui/src/app/event_dispatch.rs (modified, +6/-0)
  • codex-rs/tui/src/app/thread_session_state.rs (modified, +143/-0)
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.122.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.4 xhigh

What platform is your computer?

Microsoft Windows NT 10.0.26220.0 x64

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

CMD Terminal

What issue are you seeing?

Summary

I found two related TUI issues around /side:

  1. /permissions is not available inside /side, even though it is useful there for switching between safe modes like Default and Read Only.
  2. Returning from /side can restore stale main-thread permission state.

Actual behavior

  • /permissions is blocked in /side.
  • If permissions are changed in the main thread and /side is entered and exited, the main thread can show stale permissions again instead of preserving the current selection.

What steps can reproduce the bug?

There are two related repro paths.

Repro 1: /permissions is unavailable inside /side

  1. Start a normal TUI session.
  2. Start a side conversation with /side.
  3. Inside the side conversation, try /permissions.
  4. Observe that the command is unavailable / not accessible there.

Repro 2: main-thread permissions can reset after leaving /side

  1. Start a normal TUI session.
  2. In the main thread, change permissions using /permissions. Example: switch from Default to another mode and confirm the change.
  3. Start a side conversation with /side.
  4. Exit the side conversation and return to the main thread.
  5. Observe that the main thread can show stale permission state again instead of preserving the updated value.

I reproduced this in the TUI. No special thread id was required.

What is the expected behavior?

  • /permissions should be usable inside /side in a limited and safe form.
  • Leaving /side should preserve the current main-thread permission mode.
  • Returning from a side conversation should not replay stale permission state into the main thread UI/session state.

Additional information

I investigated the second bug locally and the issue appears related to stale cached thread-session state during thread replay when returning from /side.

The live permission update path changes the active app/chat state, but the cached session snapshot used for main-thread replay can remain stale. When /side exits and the main thread is restored, those old values can be replayed back into the UI/session state.

The two issues are related because /permissions inside /side is useful, but it also makes the stale-restore behavior more visible.

I have a working branch in my fork with a proposed fix: https://github.com/adarshnagrikar14/codex/tree/fix/side-permissions

If this approach aligns with maintainer expectations, I can open a PR from that branch.

extent analysis

TL;DR

The most likely fix involves updating the handling of cached thread-session state during thread replay when returning from /side to ensure that the main-thread permission mode is preserved.

Guidance

  • Investigate the proposed fix in the provided branch (https://github.com/adarshnagrikar14/codex/tree/fix/side-permissions) to understand how it addresses the stale cached thread-session state issue.
  • Verify that the fix allows /permissions to be usable inside /side in a limited and safe form.
  • Test the fix to ensure that leaving /side preserves the current main-thread permission mode and does not replay stale permission state into the main thread UI/session state.
  • Consider opening a PR from the proposed fix branch if it aligns with maintainer expectations.

Example

No code snippet is provided as the issue does not contain sufficient code details, and the proposed fix is available in the mentioned branch.

Notes

The provided information suggests that the issue is related to the handling of cached thread-session state, but the exact implementation details are not available. The proposed fix in the mentioned branch should be reviewed and tested to ensure it addresses the issue correctly.

Recommendation

Apply the workaround by implementing the proposed fix from the branch https://github.com/adarshnagrikar14/codex/tree/fix/side-permissions, as it seems to address the root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING