Default Codex sessions to the 272K pricing boundary, not the 1M model maximum
- Dominant language
- TypeScript
- Stars
- 909
- Forks
- 116
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 156
Description
### Before filing
- [x] I searched open and closed issues for duplicates.
- [x] I reproduced this on the latest release.
- [x] This is one request, not several bundled together.
### Closest existing issue
None found. I searched for Codex context window, 1M context, token usage, long-context pricing, and Codex auto-compaction.
### Is this new, or an improvement?
Improvement. Berd supports Codex context reporting today, but its current default makes long-running sessions unexpectedly expensive.
### The problem, in my terms
I use Berd for long-running Codex sessions. On Berd 0.6.2, a fresh GPT-5.6 Sol chat reports the full model window, for example `35K / 1M tokens used`.
That is a poor default for routine agent work. OpenAI's GPT-5.6 Sol pricing says that any request with more than 272K input tokens is billed at 2x input and 1.5x output for the entire request:
https://developers.openai.com/api/docs/models/gpt-5.6-sol
Once a long session crosses that boundary, later turns can repeatedly pay the long-context multiplier. The model can accept 1.05M tokens, but exposing that maximum as the normal session budget makes Berd much more expensive during long-running work.
On the same machine, Codex CLI 0.147.0 reports this default for GPT-5.6 Sol:
```json
{
"context_window": 272000,
"effective_context_window_percent": 95
}
```
That yields a 258,400-token effective window, which matches the roughly 258K context shown by Codex itself.
Environment: Berd 0.6.2, macOS 26.5, Apple Silicon, GPT-5.6 Sol through the managed `codex-acp` bridge.
### What I do today
I watch the context meter and manually leave or compact sessions before they cross the pricing boundary. Berd only exposes automatic compaction controls for Goose, so there is no reliable Codex-side guard in the app.
### What I'd like to see
Default managed Codex sessions to a nominal `model_context_window` of 272,000 tokens. With Codex's 95% effective window, Berd should then report about 258.4K and compact before requests exceed the long-context pricing boundary.
The full 1.05M window should remain available as an explicit opt-in for users who need it and accept the higher price.
`codex-acp` already supports a `CODEX_CONFIG` JSON object merged into Codex session config, so Berd could provide this default while preserving an explicit user override.
### Why this belongs in Berd itself
Berd installs and launches the managed `codex-acp` bridge and presents its context budget as a product-level session control. A skill, agent, or automation cannot safely change the Codex context limit before session creation or guarantee that every later request stays below the pricing boundary.
### Non-goals
- Do not remove access to the full 1.05M model window.
- Do not change Goose, Claude Code, or other agent defaults.
- Do not change OpenAI pricing or estimate invoice cost in the UI.
- Do not cap users who explicitly configure a different Codex context window.
### Alternatives considered
- Keep 1.05M as the default and only warn at 272K. This still lets every later request incur the multiplier and requires manual intervention.
- Add Codex auto-compaction at a percentage of 1.05M. A normal percentage such as 80% still crosses 272K by a wide margin.
- Change only the displayed denominator. That would hide the real runtime behavior instead of fixing it.
Contributor guide
Research direction
Trace how Berd installs and launches the managed codex-acp bridge, then inspect how CODEX_CONFIG is merged into Codex session configuration. Verify the handling of model_context_window and any existing context or compaction controls. Done means managed Codex sessions default to 272,000 tokens while preserving explicit user overrides and leaving other agent defaults unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100