Skip to content

Codex Support Legacy setup for versions < 0.134#112

Merged
rohita5l merged 4 commits into
mainfrom
codex_fix
May 28, 2026
Merged

Codex Support Legacy setup for versions < 0.134#112
rohita5l merged 4 commits into
mainfrom
codex_fix

Conversation

@AarushiShah-db
Copy link
Copy Markdown
Collaborator

Summary

Adds backward‑compatible Codex config writing. For Codex CLI >= 0.134.0, continue writing per‑profile ~/.codex/ucode.config.toml. For older Codex CLI, write to shared ~/.codex/config.toml while preserving unrelated profiles. Refactors provider
config to reduce duplication and simplifies version handling.

Key Changes

  • src/ucode/agents/codex.py
    • Add legacy paths: LEGACY_CODEX_CONFIG_PATH, LEGACY_CODEX_BACKUP_PATH.
    • Detect layout via _use_legacy_layout() (parses agent_version('codex') vs MINIMUM_CODEX_VERSION).
    • Extract _provider_block(...) to centralize Gateway provider config.
    • Add render_legacy_overlay(...) to build shared‑file overlay (profile, [profiles.ucode], [model_providers.ucode-databricks]).
    • Write logic preserves non‑ucode profiles in shared config.
  • Tests
    • tests/test_agent_codex.py: new cases for legacy overlay contents, preservation of other profiles, and layout detection.
    • tests/test_agents_init.py: remove strict “force update Codex” blockers; compatibility replaces hard stop.

Behavior Before

  • Required Codex >= 0.134.0; older versions prompted/blocked.

Behavior After

  • Works with both layouts:
    • Modern (>= 0.134.0): per‑profile ~/.codex/ucode.config.toml.
    • Legacy (< 0.134.0): shared ~/.codex/config.toml, keeping existing non‑ucode sections intact.

…r-profile layout otherwise; refactor provider block; update tests
@AarushiShah-db AarushiShah-db requested a review from rohita5l May 28, 2026 00:19
rohita5l
rohita5l previously approved these changes May 28, 2026
@rohita5l rohita5l merged commit fd86dd3 into main May 28, 2026
2 checks passed
@rohita5l rohita5l deleted the codex_fix branch May 28, 2026 15:05
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.

2 participants