Skip to content

/goal continuation uses stale permission context after permissions changes #22090

Closed

Description

@2c67cc18

What issue are you seeing?

/goal can start autonomous continuation with an older core permission context after the TUI permission mode has changed.

Observed effect: permission prompts can appear during goal continuation even after selecting Full Access, or approval routing can remain user-facing after selecting Auto-review.

A fresh session with Full Access or Auto-review as the default can work, which points to stale runtime permission state after an in-session permission change.

What steps can reproduce the bug?

  1. Start Codex with the goals feature enabled.
  2. In the TUI, change permissions to Full Access or Auto-review.
  3. Set a goal with /goal <objective>.
  4. Let goal continuation start work that would otherwise trigger a permission or approval path.
  5. Observe that continuation can use the previous approval policy, reviewer, or permission profile.

What is the expected behavior?

/goal continuation should use the current TUI permission context:

  • current approval policy
  • current approvals reviewer
  • current permission profile
  • current active permission profile

Additional information

Root-cause hypothesis: thread/goal/set carries goal fields only, while turn/start carries permission context through turn-context overrides. When /goal activates a goal and immediately starts continuation, core can continue from stale session settings.

Reference patch branch:
main...2c67cc18:codex:fix-goal-permission-context

Local verification for the patch:
RUSTUP_TOOLCHAIN=stable cargo check -p codex-core -p codex-app-server -p codex-tui passed.

Activity

  1. added
    bug
    CLI
    TUI
    app-server
    on May 11, 2026
  2. github-actions commented on May 11, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. removed
    CLI
    app-server
    on May 11, 2026
  4. leofratu commented on May 20, 2026

    @leofratu
    • have the same issue
  5. Wenjunyun123 commented on May 24, 2026

    @Wenjunyun123

    I investigated this locally and prepared a PR-ready fix branch here:

    Root cause I found:

    • The cold resume path applies runtime/config overrides.
    • The running-thread resume path only logged override mismatches and kept using the existing thread's stale SessionConfiguration.
    • Goal continuation is triggered immediately after resume, so /goal could continue with the old permission prompt/config even after the client resumed with approvalsReviewer: "auto_review" or updated permissions.

    Fix approach in the branch:

    • Apply supported resume-time overrides to the active running thread before returning the resume snapshot or triggering goal continuation.
    • Update active session settings for model/provider/cwd/runtime workspace roots/approval policy/approvals reviewer/sandbox or permissions/personality.
    • Keep per-turn permission config synchronized with the refreshed active session approval policy.
    • Add regression coverage that captures the actual /goal continuation request and asserts it carries the refreshed auto-review permission context instead of the stale one.

    Validation run locally:

    • cargo fmt
    • git diff --check
    • cargo check -p codex-core -p codex-app-server
    • cargo test -p codex-app-server thread_resume_applies_overrides_to_running_thread --test all
    • cargo test -p codex-app-server thread_resume_goal_continuation_uses_running_thread_overrides --test all

    I noticed docs/contributing.md says external code contributions are by invitation only, and my account could not create a PR against openai/codex via GitHub API (CreatePullRequest permission denied). Leaving the branch/compare link here in case it is useful to the maintainers or can be invited into a PR.

  6. etraut-openai commented on May 24, 2026

    @etraut-openai
    Contributor

    This issue has been fixed in 0.133.0. If you're still seeing behavior like this with the latest version, please open a new bug report with repro details.

  7. ilgaur commented on May 24, 2026

    @ilgaur

    I'm still seeing this on MacOS desktop app. I'm on Version 26.519.41501 (3044).

  8. etraut-openai commented on May 24, 2026

    @etraut-openai
    Contributor

    @ilgaur, we're still working on a fix for this in the app. It was fixed in the TUI in 0.133.0.

  9. peteallen commented on Jun 1, 2026

    @peteallen

    @ilgaur, we're still working on a fix for this in the app. It was fixed in the TUI in 0.133.0.

    Any update on this? Is there a separate issue to track this in the desktop app? It's severely hindering long-running goals.

  10. etraut-openai commented on Jun 1, 2026

    @etraut-openai
    Contributor

    Still working on the fix. It's complex and requires more testing before we release it.

    In the meantime, you can work around the problem by issuing a regular user prompt (not a goal) after changing the permissions in a thread. Then once you create the goal, it will properly inherit the permissions from the previous turn. The bug occurs when you change the permissions (or start a new thread from scratch) and immediately thereafter create a new /goal.

  11. gerrywastaken commented on Aug 16, 2026

    @gerrywastaken

    @etraut-openai

    Still working on the fix. It's complex and requires more testing before we release it.

    I feel like if it is still being worked on then the status here should not say Closed?
    I'm still being asked to approve basic stuff on threads with a goal set despite always having auto approve set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions