[Bug]: clear command does not reset context for codex
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
- Open a thread with Codex as a provider
- Write some prompts
- Try to reset via /clear command in chat
- Codex says that context is cleared
- Ask Codex about what's in context
When command is invoked, context is not cleared even though Codex says so. When you ask about what's in context, it will tell you the remaining context before the reset.
Expected behavior
- /clear command should be suggested when typing into the chat
- context should actually be reset when command is invoked
Actual behavior
- /clear command does not show up in suggestions
- context is not cleared when command is invoked
Impact
Major degradation or frequent failure
Version or commit
0.0.33
Environment
macOS
Logs or stack traces
Screenshots, recordings, or supporting files
Screenshot 2026-08-18 at 15.41.50.jpeg
Workaround
Open a new thread instead of clearing current conversation
Independent reproduction on T3 Code 0.0.33, with the server running on Linux and the command submitted from the mobile client. This suggests the issue is not limited to macOS or the web UI.
The persisted orchestration event sequence makes the failure mode fairly explicit:
/clearis stored as an ordinarythread.message-sentuser message.- T3 immediately emits an ordinary
thread.turn-start-requested. - The same T3 thread and Codex provider session continue; there is no clear/new-session lifecycle event.
- The following Codex turn reported about 63.8k input tokens (62.2k cached), and the assistant could still answer from messages sent before
/clear.
The especially confusing part is that the assistant may respond as though the command worked, because it receives /clear as natural-language input while retaining the old context. A safe interim behavior would be to reject or visibly mark unsupported reset commands rather than send them to the model as ordinary prompts.
Current workaround is still to create a new T3 thread.
Reproduced with the Cursor provider (Claude model) on desktop, so it is not Codex-specific. Same failure mode: /clear (and /compress, which is not a command anywhere) reaches the agent as ordinary user text, the agent improvises a "cleared" or "compressed" reply, and the thread carries on with the full context.
Filed the feature side as an Ideas discussion — a native /clear that resets the provider session in place, and until then rejecting unsupported reset commands instead of forwarding them: #11091
Additional reproduction / workflow impact (8 October 2026):
I use T3 Code to keep a complete task lifecycle in one thread, from Opus-heavy discovery through implementation with GPT-6 Sol, PR review and finally settling the thread once the PR is accepted.
After an Opus discovery session, I select /clear from the suggested supported slash commands and submit it. The context does not appear to reset. When I switch the same thread from Opus to GPT-6 Sol, Sol still receives a nonzero amount of the preceding Opus context.
What I want is a fresh provider/model context within the existing T3 thread, while keeping the visible thread history, worktree/branch and PR association, so I can track one task in one place and settle it at the end. Starting a separate T3 thread defeats that workflow.
Expected:
/cleargenuinely resets the model context for subsequent turns (including across model/provider switches).- The existing T3 thread, its visible history and task tracking remain intact.
- T3 should not advertise or silently forward
/clearas a supported command if it cannot perform that reset.
This is an observed behaviour report, not a claim about the precise internal cause. Related feature discussion: #11091.
is this going to be adressed? It currently makes running long running resused threads very unusable
Evidence (Claude provider)
Environment: T3 Code 0.0.46-nightly.20261014.3118 (macOS desktop), Claude Code 2.1.299, Opus 5.5, 1M context window. Long-running coordinator threads reset their own context by queuing /clear plus a resume prompt into their own thread via t3_thread_send.
Measured over 7 days (all Claude threads on one machine):
Outcome of a queued /clear |
Count |
|---|---|
Thread stays in the fresh post-/clear session |
74 |
Thread later continues in the pre-/clear session with the full old context |
66 (45%) |
| Other | 6 |
One thread queued /clear 7 times in 24 hours. Its context still rose from 30% to 47% of the window, because every relaunch restored the old session.
One traced case (from the T3 event store, provider log and Claude transcripts):
- 10:21:29
/clearand the resume prompt are queued. Both runs complete. - Claude Code starts a new session
93a46460-…. The resume prompt and 23 minutes of work run there at ~5% context. - T3 keeps the thread's stored native id
d42af3f5-…(run-attempt.updated.nativeThreadId). - 10:51:34
query.close, 10:51:35query.openwithoptions.resume = "d42af3f5-…". The thread is back at 34% context, and the post-/clearwork is gone from the model's context.
Every event that reopens the query triggers it: a scheduled-task wake, a t3_thread_send from another thread, a model or settings change, a server restart.
Code on main @ 348f217:
- L1398: the session id is stored once as
nativeThreadRef.nativeId, and the provider thread id is derived from it. - L1097: every launch resumes that stored id.
- L7770, L7794:
message.session_idis only logged. - L9377: only a rollback to
thread_startallocates a new session id.
Related: #19356 (closed as duplicate of this issue), #15854 (same stored-id resume, different trigger).
After further investigation :
- Claude Code runs through its interactive CLI, which handles slash commands locally.
- Codex is launched by T3 through codex app-server.
- In the app-server integration, /clear is not a recognized protocol command. T3 currently sends it as a normal user message inside the existing Codex thread.
@juliusmarminge can you confirm this behavior?
Checked on current main ed9b7ca9c5, Linux web dev server, Codex CLI 0.163.0 with GPT-6.1-Sol.
- Asked a new Codex thread to remember
violet-otter-7402; it repliedACK. - Typed
/clear: the command menu showed No matching command. - Submitted it anyway: it became an ordinary user message and returned an empty response in this run.
- Asked for the earlier marker: Codex returned
violet-otter-7402.
Context retention reproduces; the claim that context was cleared did not reproduce. Codex currently has no supported /clear command. Resetting provider context while preserving the T3 thread is an enhancement requiring a session/history policy, so this belongs in Ideas. The Claude session-id restoration described above is a separate provider behavior. Creating a new thread remains the workaround for Codex.
No matching open fix PR or earlier duplicate found in the 90-day issue/PR scan.