Skip to content

feat(coding_agent_rl): select claude_code/codex harness+adapter pair via SWE_AGENT - #2125

Merged
zhuzilin merged 1 commit into
THUDM:mainfrom
jingshenghang:swe-agent-selector
Jun 23, 2026
Merged

zhuzilin merged 1 commit into
THUDM:mainfrom
jingshenghang:swe-agent-selector

Conversation

@jingshenghang

@jingshenghang jingshenghang commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

What

Make the SWE rollout in examples/coding_agent_rl agent-agnostic. The generate() orchestrator no longer hard-codes the Claude Code harness + Anthropic adapter; instead the (harness, adapter) pair is selected at import time by the SWE_AGENT env var.

Changes

  • generate.py:
    • Add an _AGENTS registry mapping the agent name to its (harness, adapter) pair:
      • claude_code -> (ClaudeCodeHarness, AnthropicAdapter)
      • codex -> (CodexHarness, OpenAIAdapter)
    • Resolve SWE_AGENT (default claude_code) into HARNESS_CLS / ADAPTER_CLS, with an explicit ValueError on an unknown value.
    • Use HARNESS_CLS / ADAPTER_CLS everywhere the concrete classes were previously referenced (CLI install, adapter service, rollout run).
    • Update the module docstring to describe the selector.
  • run_qwen36_35b_a3b_swe_8nodes.sh:
    • Export SWE_AGENT (default claude_code) and propagate it into the Ray RUNTIME_ENV_JSON so workers see the same selection.

Behavior

  • Default is unchanged (claude_code), so existing runs are not affected.
  • Set SWE_AGENT=codex to switch the rollout to the Codex harness + OpenAI adapter.

…arness+adapter pair

(cherry picked from commit ffe8c37ccee0cd8f441d61d8c52095fe16a5b264)
@jingshenghang jingshenghang changed the title feat(coding_agent_rl): add SWE_AGENT selector for claude_code/codex h… feat(coding_agent_rl): select claude_code/codex harness+adapter pair via SWE_AGENT Jun 23, 2026
@zhuzilin
zhuzilin merged commit a897e1f into THUDM:main Jun 23, 2026
38 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.

2 participants