Skip to content

[examples] fix: use task-level swe-bench reward#91

Merged
yyDing1 merged 1 commit into
verl-project:mainfrom
zackcxb:cxb/claude-code-reward-task-api
Jul 24, 2026
Merged

[examples] fix: use task-level swe-bench reward#91
yyDing1 merged 1 commit into
verl-project:mainfrom
zackcxb:cxb/claude-code-reward-task-api

Conversation

@zackcxb

@zackcxb zackcxb commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fix the Claude Code blackbox recipe after the runtime/task refactor in #83.
The recipe still loaded the removed uni_agent.reward registry, so in-sandbox
SWE-bench evaluation failed on current main. This PR migrates the recipe to
the task-level uni_agent.tasks.swe_bench.reward.compute_reward API and adds
the exec_shell adapter required by that evaluator.

Checklist Before Starting

Test

  • Focused development regression probe: reproduced the missing uni_agent.reward import and missing exec_shell, then passed all 4 reward-adapter cases after the fix. The probe is not committed because this repository treats executable recipes as integration coverage and does not run recipe pytest suites in CI.
  • python -m pytest tests/uni_agent/agents/test_claude_code_agent.py -q — 8 passed.
  • pre-commit run --all-files --show-diff-on-failure --color=always — all hooks passed.
  • Integration evidence from the earlier rollback validation rollout, with this reward compatibility patch applied: 32 sessions produced 50 trajectories; all 50 reward records reported eval_completed=True, with no reward-path crash.

API and Usage Example

No new user-facing configuration is required. The existing Claude Code
run_infer.sh and training recipe now evaluate SWE-bench through the post-#83
task reward API.

result = await compute_reward(metadata, sandbox, eval_timeout=600)
score = 1.0 if result.get("resolved", False) else 0.0

Design & Code Changes

  • Remove the obsolete recipe-local reward registry lookup.
  • Lazily call the canonical task-level SWE-bench reward function.
  • Reject unsupported reward data sources explicitly; this recipe is SWE-bench-specific.
  • Add SandboxEnvForReward.exec_shell, preserving quoted working directories and timeouts.

Checklist Before Submitting

  • Read the Contribute Guide and PR template requirements.
  • Ran full-repository pre-commit checks.
  • Explained why recipe integration evidence is used instead of adding a new pytest file.
  • Confirmed the PR title matches the required format.
  • Replaced all PR template placeholder text.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@zackcxb zackcxb changed the title fix(examples): use task-level swe-bench reward [examples] fix: use task-level swe-bench reward Jul 24, 2026
@yyDing1
yyDing1 merged commit 3d4e401 into verl-project:main Jul 24, 2026
3 of 4 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