From 4a67905266633f1867aaf89d863b4a8d149d5237 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Fri, 24 Apr 2026 17:39:06 -0400 Subject: [PATCH] fix: ensure gpt-5.5 compacts at correct context size when using openai oauth (#24212) --- packages/opencode/src/plugin/codex.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/opencode/src/plugin/codex.ts b/packages/opencode/src/plugin/codex.ts index e05111fc6..60d2d5b47 100644 --- a/packages/opencode/src/plugin/codex.ts +++ b/packages/opencode/src/plugin/codex.ts @@ -390,6 +390,16 @@ export async function CodexAuthPlugin(input: PluginInput): Promise { output: 0, cache: { read: 0, write: 0 }, } + + // gpt-5.5 models temporarily have restricted context window size for codex plans + if (model.id.includes("gpt-5.5")) { + model.limit = { + context: 400_000, + //@ts-expect-error incorrect type for v1 sdk but works + input: 272_000, + output: 128_000, + } + } } return {