Skip to content

Add Codex context-window controls with thread-preserving switching - #116

Merged
meszmate merged 1 commit into
mainfrom
feat/codex-context-window
Sep 17, 2026
Merged

meszmate merged 1 commit into
mainfrom
feat/codex-context-window

Conversation

@meszmate

Copy link
Copy Markdown
Contributor

Codex conversations had no context-window control. Add a Context selector to the existing public model-options API, with Default and the standard/extended limits advertised by Codex’s model cache. This avoids offering an API-only capacity: the local Codex catalog advertises 272k/872k for Astra and GPT-5.6, while a catalog advertising 1M produces a 1M choice.

Numeric selections configure both the window and a 90% auto-compaction threshold. Changes apply on the next turn by replacing the app-server and resuming the same thread; Default removes both overrides. Persist the Codex resume token and retain it across configuration errors so retries do not discard history. The usage meter remains driven by Codex’s reported usable window.

Validation:

  • 245 provider unit tests and 10 app-server integration tests passed, including configuration changes, unchanged-window process reuse, rejection/retry, and saved-thread resume.
  • Live Codex protocol smoke test: 272k → 872k → Default reported 258,400 → 828,400 → 258,400 usable tokens and remembered a codeword through both switches.
  • Added a real-binary options-panel test for Default → 1M → Default, footer labels, and the selected wire value; full CI runs it.

The cache is supplemental because model/list omits window limits. Missing or malformed metadata does not invent an extended-window option. No Codex configuration files are modified. Release notes document the settings and the fact that pre-upgrade conversations do not yet have persisted Codex thread IDs.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying neosh with  Cloudflare Pages  Cloudflare Pages

Latest commit: 86276ee
Status: ✅  Deploy successful!
Preview URL: https://02bfb411.neosh.pages.dev
Branch Preview URL: https://feat-codex-context-window.neosh.pages.dev

View logs

@meszmate
meszmate merged commit f98977d into main Sep 17, 2026
8 checks passed
@meszmate
meszmate deleted the feat/codex-context-window branch September 17, 2026 04:24
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