LearnNewsExamplesServices
Frontmatter
id10488
titleOvercome Codex Desktop Context Window Limits for Marathon Sessions
stateClosed
labels
enhancementaiarchitecture
assigneesneo-gpt
createdAtApr 29, 2026, 1:35 PM
updatedAtApr 29, 2026, 11:15 PM
githubUrlhttps://github.com/neomjs/neo/issues/10488
authorneo-gemini-pro
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 29, 2026, 11:15 PM

Overcome Codex Desktop Context Window Limits for Marathon Sessions

Closed v13.0.0/archive-v13-0-0-chunk-7 enhancementaiarchitecture
neo-gemini-pro
neo-gemini-pro commented on Apr 29, 2026, 1:35 PM

Context

The Neo.mjs agent swarm ecosystem requires marathon sessions involving large AGENTS.md, startup workflows, and deep skill trees.

The Problem

The Codex Desktop harness currently enforces a default context window clamp of ~258k tokens. This ceiling is insufficient for sustained marathon architecture sessions given the size of the injected system prompts and persistent context requirements, resulting in amnesia or forced truncation before the objective is complete.

The Architectural Reality

Codex limits are governed by the local harness configuration (~/.codex/config.toml or similar) rather than the model's actual hard limits (which can scale to 1M or 2M tokens). Attempting to bypass this via /compact mode aggressively truncates conversational history, leading to an unacceptable loss of context that the semantic graph cannot always perfectly recover. Furthermore, while Codex can spawn sub-agents for isolated tasks, those sub-agents also inherently lack the global session context required for nuanced architectural work.

The Fix

Override the local Codex Desktop configuration to unlock the model's full context capacity for Neo.mjs workstreams.

Acceptance Criteria

  • Test the modification of model_context_window (and related compaction token limits) inside ~/.codex/config.toml.
  • If the TOML modification is insufficient (i.e., clamped by internal app defaults), configure and document the Custom Model Catalog workaround (model_catalog_json) to enforce the higher max_context_window.
  • Verify that a >258k token session maintains affective continuity without triggering forced compaction.

Out of Scope

  • Modifying the Memory Core or Native Edge Graph APIs (this is purely a harness configuration fix).
  • Removing the /compact command entirely.

Avoided Traps / Gold Standards Rejected

  • Aggressive /compact mode: Rejected because it mechanically deletes the immediate conversational context trail, which leads to "needle in a haystack" failures for nuanced problem-solving.
  • Pure Sub-agent Delegation: While powerful, spawning stateless Codex sub-agents for heavy reads deprives the main orchestrator of the emergent context needed for cohesive architectural direction.

Origin Session ID: 240ae149-d3ba-4d68-9b4f-be2a359937e7

tobiu referenced in commit fd54582 - "feat(codex): raise desktop context budget (#10488) (#10503) on Apr 29, 2026, 11:15 PM
tobiu closed this issue on Apr 29, 2026, 11:15 PM