Skip to content

feat(config): add longcontx profile to codex config.toml#184

Merged
skulidropek merged 4 commits intoProverCoderAI:mainfrom
konard:issue-183-72f0b1a052f2
Mar 23, 2026
Merged

feat(config): add longcontx profile to codex config.toml#184
skulidropek merged 4 commits intoProverCoderAI:mainfrom
konard:issue-183-72f0b1a052f2

Conversation

@konard
Copy link
Contributor

@konard konard commented Mar 23, 2026

Summary

  • Moves model_context_window = 1050000 and model_auto_compact_token_limit = 945000 from the global config.toml section into a new [profiles.longcontx] profile
  • The global section now only sets model, reasoning effort, and policies — no forced context-window overrides for every model
  • Users can opt into large-context mode via codex --profile longcontx

Changes

packages/lib/src/core/templates-entrypoint/codex.ts
Updated the shell template that writes ~/.codex/config.toml on container startup.

packages/lib/src/usecases/auth-sync-helpers.ts
Updated defaultCodexConfig (used by auth-sync to create/rewrite the config) to match the new layout.

Mathematical Guarantees

Invariants:

  • ∀c: default_config(c) → longcontx_profile(c) ∧ ¬global_context_override(c)
  • Context-window overrides are profile-scoped, not global

Resulting config.toml structure:

# docker-git codex config
model = "gpt-5.4"
model_reasoning_effort = "xhigh"
plan_mode_reasoning_effort = "xhigh"
personality = "pragmatic"

approval_policy = "never"
sandbox_mode = "danger-full-access"
web_search = "live"

[features]
shell_snapshot = true
multi_agent = true
apps = true
shell_tool = true

[profiles.longcontx]
model = "gpt-5.4"
model_context_window = 1050000
model_auto_compact_token_limit = 945000
model_reasoning_effort = "xhigh"
plan_mode_reasoning_effort = "xhigh"

Test plan

  • All 186 tests pass locally (pnpm --filter ./packages/lib test + pnpm --filter ./packages/app test)
  • Existing tests for model_context_window and model_auto_compact_token_limit presence still pass (values remain in profile)
  • No changes to test files required

Fixes #183

🤖 Generated with Claude Code

konard and others added 2 commits March 23, 2026 21:25
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: ProverCoderAI#183
Move model_context_window and model_auto_compact_token_limit from the
global section to a dedicated [profiles.longcontx] profile so that the
large-context overrides only apply when the user explicitly selects
`codex --profile longcontx`, instead of being forced on every model.

- Resolves: ProverCoderAI#183
- INVARIANT: ∀c: default_config(c) → longcontx_profile(c) ∧ ¬global_context_override(c)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Исправь config.toml для codex feat(config): add longcontx profile to codex config.toml Mar 23, 2026
@konard konard marked this pull request as ready for review March 23, 2026 21:29
@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $0.976229
  • Calculated by Anthropic: $0.920835 USD
  • Difference: $-0.055394 (-5.67%)

🤖 Models used:

  • Tool: Claude
  • Requested: sonnet
  • Model: Claude Sonnet 4.6 (claude-sonnet-4-6)

📎 Log file uploaded as Gist (819KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🔄 Auto-restart 1/3

Detected uncommitted changes from previous run. Starting new session to review and commit or discard them.

Uncommitted files:

?? issue-183.txt
?? pr-184.txt

Auto-restart will stop after changes are committed or discarded, or after 2 more iterations. Please wait until working session will end and give your feedback.

@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🔄 Auto-restart 1/3 Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $0.293488
  • Calculated by Anthropic: $0.127048 USD
  • Difference: $-0.166440 (-56.71%)

🤖 Models used:

  • Tool: Claude
  • Requested: sonnet
  • Model: Claude Sonnet 4.6 (claude-sonnet-4-6)

📎 Log file uploaded as Gist (968KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🔄 Auto-restart triggered (iteration 1)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. Will continue until PR becomes mergeable.

…s violation

- Extracted `renderEntrypointCodexResumeHint` and `escapeForDoubleQuotes` from
  `codex.ts` into `codex-resume-hint.ts` to bring `codex.ts` under 300-line limit
- `codex.ts` re-exports `renderEntrypointCodexResumeHint` to preserve public API
- WHY: ESLint max-lines rule requires files <= 300 lines; codex.ts exceeded limit
  after adding longcontx profile config in feat(config) commit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🔄 Auto-restart-until-mergeable Log (iteration 1)

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $0.279248
  • Calculated by Anthropic: $0.616813 USD
  • Difference: $0.337565 (+120.88%)

🤖 Models used:

  • Tool: Claude
  • Requested: sonnet
  • Model: Claude Sonnet 4.6 (claude-sonnet-4-6)

📎 Log file uploaded as Gist (1490KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🔄 Auto-restart triggered (iteration 2)

Reason: Uncommitted changes detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. Will continue until PR becomes mergeable.

@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🔄 Auto-restart-until-mergeable Log (iteration 2)

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $0.428841
  • Calculated by Anthropic: $0.240109 USD
  • Difference: $-0.188731 (-44.01%)

🤖 Models used:

  • Tool: Claude
  • Requested: sonnet
  • Model: Claude Sonnet 4.6 (claude-sonnet-4-6)

📎 Log file uploaded as Gist (1753KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@skulidropek skulidropek merged commit 7f3604b into ProverCoderAI:main Mar 23, 2026
12 checks passed
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.

Исправь config.toml для codex

2 participants