Summary
On February 13, 2026 at 10:56:21 local time (2026-02-13T15:56:21Z), conversation 019c53ae-d992-7543-aeb1-cd8348e680aa switched to a different user_instructions payload that included:
At the end of your turn, report you are testing with the ~/codex-sandboxes/playground/.codex/AGENTS.md file in place.
This happened even though the thread cwd and sandbox root remained /Users/dre/src/ts/platform-operator-console.
Impact
Instruction boundary was violated at prompt-construction level: model followed unrelated AGENTS guidance from another workspace context.
Environment
- Codex Desktop / VS Code extension (
openai.chatgpt-0.5.74-darwin-arm64)
- CLI version in session meta:
0.100.0-alpha.10
- Host: macOS
- Conversation:
019c53ae-d992-7543-aeb1-cd8348e680aa
Observed Behavior
- Session starts with expected workspace:
~/.codex/sessions/2026/02/12/rollout-2026-02-12T16-08-13-019c53ae-d992-7543-aeb1-cd8348e680aa.jsonl:1
- At
2026-02-13T15:56:21.063Z, a fresh preamble is injected, including AGENTS block containing playground path:
~/.codex/sessions/2026/02/12/rollout-2026-02-12T16-08-13-019c53ae-d992-7543-aeb1-cd8348e680aa.jsonl:816
- Immediately after,
turn_context.user_instructions flips to payload containing the playground line:
~/.codex/sessions/2026/02/12/rollout-2026-02-12T16-08-13-019c53ae-d992-7543-aeb1-cd8348e680aa.jsonl:824
cwd in turn context remains /Users/dre/src/ts/platform-operator-console.
- Same minute, extension log reports rehydrate anomaly:
~/Library/Application Support/Code/logs/20260211T083628/window1/exthost/openai.chatgpt/Codex.log:2741
Failed to apply patches ... conversationId=019c53ae-d992-7543-aeb1-cd8348e680aa
Expected Behavior
When restoring/resuming a thread, AGENTS/project instructions should be recomputed from the active workspace (cwd) and trusted config only; stale instructions from other workspaces must not be injected.
Why this looks like a rehydrate bug (inference)
user_instructions are computed at spawn and stored:
current-installed-codex-version/codex-rs/core/src/codex.rs:283
current-installed-codex-version/codex-rs/core/src/codex.rs:358
- Later settings updates can change
cwd without recomputing user_instructions:
current-installed-codex-version/codex-rs/core/src/codex.rs:642
current-installed-codex-version/codex-rs/core/src/codex.rs:662
- Turn context reuses stored
user_instructions:
current-installed-codex-version/codex-rs/core/src/codex.rs:797
Relevant docs
Suggested fixes
- Recompute
user_instructions whenever cwd changes in resumed/rehydrated sessions.
- Add invariant check: AGENTS prompt header path must be within active workspace chain.
- On “Failed to apply patches” during resume, force full instruction rebuild from current
cwd.
- Emit debug metadata for instruction-source files (resolved paths + hashes) in logs.
Summary
On February 13, 2026 at 10:56:21 local time (2026-02-13T15:56:21Z), conversation
019c53ae-d992-7543-aeb1-cd8348e680aaswitched to a differentuser_instructionspayload that included:At the end of your turn, report you are testing with the ~/codex-sandboxes/playground/.codex/AGENTS.md file in place.This happened even though the thread
cwdand sandbox root remained/Users/dre/src/ts/platform-operator-console.Impact
Instruction boundary was violated at prompt-construction level: model followed unrelated AGENTS guidance from another workspace context.
Environment
openai.chatgpt-0.5.74-darwin-arm64)0.100.0-alpha.10019c53ae-d992-7543-aeb1-cd8348e680aaObserved Behavior
~/.codex/sessions/2026/02/12/rollout-2026-02-12T16-08-13-019c53ae-d992-7543-aeb1-cd8348e680aa.jsonl:12026-02-13T15:56:21.063Z, a fresh preamble is injected, including AGENTS block containing playground path:~/.codex/sessions/2026/02/12/rollout-2026-02-12T16-08-13-019c53ae-d992-7543-aeb1-cd8348e680aa.jsonl:816turn_context.user_instructionsflips to payload containing the playground line:~/.codex/sessions/2026/02/12/rollout-2026-02-12T16-08-13-019c53ae-d992-7543-aeb1-cd8348e680aa.jsonl:824cwdin turn context remains/Users/dre/src/ts/platform-operator-console.~/Library/Application Support/Code/logs/20260211T083628/window1/exthost/openai.chatgpt/Codex.log:2741Failed to apply patches ... conversationId=019c53ae-d992-7543-aeb1-cd8348e680aaExpected Behavior
When restoring/resuming a thread, AGENTS/project instructions should be recomputed from the active workspace (
cwd) and trusted config only; stale instructions from other workspaces must not be injected.Why this looks like a rehydrate bug (inference)
user_instructionsare computed at spawn and stored:current-installed-codex-version/codex-rs/core/src/codex.rs:283current-installed-codex-version/codex-rs/core/src/codex.rs:358cwdwithout recomputinguser_instructions:current-installed-codex-version/codex-rs/core/src/codex.rs:642current-installed-codex-version/codex-rs/core/src/codex.rs:662user_instructions:current-installed-codex-version/codex-rs/core/src/codex.rs:797Relevant docs
Suggested fixes
user_instructionswhenevercwdchanges in resumed/rehydrated sessions.cwd.