Skip to content

fix(codex): support exec optimizer backend#112

Open
TheGameVIX wants to merge 1 commit into
microsoft:mainfrom
TheGameVIX:agent/codex-exec-optimizer-main
Open

fix(codex): support exec optimizer backend#112
TheGameVIX wants to merge 1 commit into
microsoft:mainfrom
TheGameVIX:agent/codex-exec-optimizer-main

Conversation

@TheGameVIX

Copy link
Copy Markdown

Summary

  • allow codex_exec as an optimizer backend
  • make --backend codex route both optimizer and target through Codex exec
  • route optimizer calls through skillopt.model.codex_backend
  • update backend config docs and add regression tests

Why

The Codex integration already supports running the target through codex exec, but selecting --backend codex left the optimizer on openai_chat. Users trying to run SkillOpt fully through Codex still had an API-backed optimizer path.

This keeps the existing backend split model and only adds codex_exec to the optimizer side. Claude Code remains target-only.

Validation

  • python -m pytest tests/test_codex_optimizer_backend.py -q
  • python -m mkdocs build --strict
  • python -c "import sys; sys.argv=['train.py','--config','configs/searchqa/default.yaml','--backend','codex']; from scripts.train import parse_args, load_config; cfg=load_config(parse_args()); print(cfg['optimizer_backend'], cfg['target_backend'])" prints codex_exec codex_exec

Note: full python -m pytest -q was also attempted on Windows, but current main has unrelated path-separator assertions in ALFWorld/Sleep tests. This PR intentionally leaves those Windows-support fixes out to keep the change scoped to Codex optimizer support.

@TheGameVIX

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@TheGameVIX TheGameVIX marked this pull request as ready for review July 8, 2026 17:52
@Yif-Yang

Copy link
Copy Markdown
Contributor

Thanks for adding Codex as an optimizer backend — this is useful functionality and we would like to preserve the merge under your original PR and commit authorship.

The branch now conflicts with backend registry/configuration work merged after it. Could you please rebase onto the latest main? During conflict resolution, please preserve the existing Azure/OpenAI, Claude, Qwen, and MiniMax paths while adding codex_exec to the optimizer path; do not replace the newer backend sets in skillopt/model/__init__.py or backend_config.py.

We tested a union-style resolution locally and obtained:

pytest tests/test_codex_optimizer_backend.py -q  # 12 passed
pytest tests/ -q                                # full suite passed

Please also keep the target and optimizer routing distinct and verify token accounting is not duplicated. Once rebased and green, we can re-review and merge this through #112 so your contributor record remains intact.

@TheGameVIX TheGameVIX force-pushed the agent/codex-exec-optimizer-main branch from b8d8d89 to 0b94f89 Compare July 15, 2026 16:06
@TheGameVIX

TheGameVIX commented Jul 15, 2026

Copy link
Copy Markdown
Author

Rebased onto latest main (57333f3) and force-pushed 0b94f89.

Conflict resolution preserved the newer Azure/OpenAI, Claude, Qwen, MiniMax, and openai_compatible paths, then added codex_exec as the optimizer path. Target and optimizer routing remain distinct, and token summary tests cover Codex + existing backend aggregation without duplicate counting.

Validation:

python -m pytest tests/test_codex_optimizer_backend.py -q
# 12 passed

python -m mkdocs build --strict
# passed

python -c "import sys; sys.argv=['train.py','--config','configs/searchqa/default.yaml','--backend','codex']; from scripts.train import parse_args, load_config; cfg=load_config(parse_args()); print(cfg['optimizer_backend'], cfg['target_backend'])"
# codex_exec codex_exec

Current PR branch is merge-clean against main.

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