Skip to content

codex keeps its shell and apply_patch tools on the gpt-5.6 models - #24

Open
pedroapfilho wants to merge 1 commit into
RubricLab:mainfrom
pedroapfilho:codex-developer-messages
Open

codex keeps its shell and apply_patch tools on the gpt-5.6 models#24
pedroapfilho wants to merge 1 commit into
RubricLab:mainfrom
pedroapfilho:codex-developer-messages

Conversation

@pedroapfilho

Copy link
Copy Markdown
Contributor

The bug

Codex routed through tokenmaxx loses its shell and apply_patch tools on the gpt-5.6 models. The model still answers, but it answers with text like this:

Blocked: this turn has no shell or filesystem tools, so I cannot inspect or edit the checkout safely.

Nothing in codex reports an error, so it reads like a codex or harness bug. It isn't. The proxy causes it.

adaptChatGptRequest lifts every system and developer item out of input and folds their text into instructions. The comment above it says codex requests already have that shape, so the rewrite is a no-op for them. That part is wrong: codex sends developer-role items in input on every turn, and its tool contract rides in them. Once those items arrive flattened into instructions, the backend stops attaching the shell and apply_patch tools for the gpt-5.6 family. gpt-5.5 is unaffected.

The rewrite has been in the proxy since 0.0.62 and worked fine for weeks, so this looks like a backend change on OpenAI's side that turned a tolerated shortcut into a broken one. In my session history, gpt-5.6-sol used tools in 36 of 41 sessions from Aug 17 to Aug 19, then 4 of 34 on Aug 20.

The fix

Lift only system. Developer items stay in input.

That keeps the reason the function exists. The backend rejects system messages from third-party harnesses with "System messages are not allowed", which is what broke pi, and max_output_tokens is still dropped. Developer messages were never rejected, so they never needed lifting.

How I verified it

Same machine, same account, same prompt (codex exec "Run: echo hello"), counting whether the shell tool was actually called.

Setup Shell tool
gpt-5.6-sol through tokenmaxx 0/3
gpt-5.6-terra through tokenmaxx 0/2
gpt-5.6-luna through tokenmaxx 0/2
gpt-5.5 through tokenmaxx 3/3
gpt-5.6-sol, proxy bypassed 3/3
gpt-5.6-sol through tokenmaxx, request body forwarded unmodified 3/3
gpt-5.6-sol through tokenmaxx, this patch 3/3

I also ran 0.0.62 and 0.0.63 with gpt-5.6-sol and both failed 3/3, which is what ruled out a recent regression in this repo and pointed at the backend instead.

bun run check passes: typecheck, biome, 88 tests.

The existing test for merging developer messages into instructions now covers system instead, and there's a new test asserting developer items survive in input while a system item in the same request still gets lifted.

@pedroapfilho
pedroapfilho force-pushed the codex-developer-messages branch from d07379b to 9d5e895 Compare August 21, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant