[BREAKING][framework, gateway, tasks] refactor: replace mixed reward info with typed runner results - #109
Closed
zackcxb wants to merge 11 commits into
Closed
[BREAKING][framework, gateway, tasks] refactor: replace mixed reward info with typed runner results#109zackcxb wants to merge 11 commits into
zackcxb wants to merge 11 commits into
Conversation
zackcxb
force-pushed
the
refactor/typed-reward-flow
branch
from
August 12, 2026 14:44
1594e4b to
f6e07c8
Compare
zackcxb
force-pushed
the
refactor/typed-reward-flow
branch
from
August 24, 2026 12:25
bbb384e to
f6dd152
Compare
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The previous reward flow used one flat
reward_infodictionary for four different contracts: outcome reward, episode completion, validation metrics, and reward-worker context. That madefinishedlook like a metric, forced Framework code to infer semantics by removing reserved keys, and allowed structured scorer context to leak into validation fields.This PR makes every managed
AgentRunnerreturn a typedTaskResultdirectly and moves reward annotations out of Gateway session state. Gateway continues to own token materialization and session lifecycle fencing; Framework owns reward, completion, metric attachment, and training serialization.No issue is linked because this refactor follows the repository's existing reward-flow analysis and resolves the unassigned reward-metadata channel. The known non-streaming fallback limitation is documented and intentionally deferred.
Changes
AgentRunnerprotocol whose successful calls returnTaskResult.TaskResultfrom inline and Ray-task runners; reject legacy dictionaries and missing results.TaskResult(reward, accuracy, finished, extra_info)as the single Task/Runner result contract.extra_info["runner_reward_info"]and let the Worker own final reward and validation metrics.extra_infoas scorer context; only validated scalar Worker output becomes validation metrics./reward_info,reward_info_url, session reward storage, andTrajectory.reward_info.Trajectory.finished,reward_score, andreward_metricsfields.mask_unfinished_episodeconsumefinished is False;Noneremains trainable.rm_scores, retaining the existing group-baseline behavior.extra_fields["reward_extra_info"], soTaskResult.accuracyreaches validation asacc.AgentRunner/agent_runnersnaming;framework/task_runner.pyremains the concrete Task-backed runner implementation.main.compute_scorepath.TaskResult.Validation
PYTHONPATH="$PWD:$PWD/verl" python -m pytest -q tests/uni_agent/framework tests/uni_agent/tasks/test_finished_propagation.py tests/uni_agent/agents/test_react_agent.py tests/uni_agent/agents/test_claude_code_agent.py tests/uni_agent/agents/test_mini_swe_agent_agent.py tests/uni_agent/examples/test_claude_code_runner.py tests/uni_agent/gateway/test_debug_launcher.py tests/uni_agent/gateway/test_gateway_actor_on_cpu.py tests/uni_agent/gateway/test_gateway_manager_on_cpu.py tests/uni_agent/gateway/test_session_multiple_chains_on_cpu.py250 passed, 5 warnings303 passed, 3 failed, 7 warnings.openai.types.responses.NamespaceTool, which the installed OpenAI SDK does not expose.upstream/mainworktree.pre-commit run --all-files --show-diff-on-failure --color=alwaysbash -n examples/mini_swe_agent/run_train.shpassed.report_reward/use_reward_loop_workercompatibility config and usesuni_agent.framework.task_runner.compute_score.No GPU training or full sandbox rollout was run; this change is covered by CPU/Ray contract tests and recipe wiring checks.
Compatibility
This is a breaking API change. No runtime compatibility mapping is retained.
Removed APIs and fields:
SessionHandle.reward_info_urlPOST /sessions/{id}/reward_infoGatewaySession.set_reward_info/GatewayActor.set_reward_infoTrajectory.reward_inforeport_rewardMigration:
Remove
runner_kwargs.report_rewardand reward-info HTTP posts from custom integrations. CustomAgentRunnerimplementations must returnTaskResult; useTaskResult(reward=None)when they do not provide a runner reward.Custom code consuming debug
trajectories.jsonlmust accept schema version 2 and readfinished,reward_score, andreward_metricsinstead ofreward_info.The
verl/submodule is unchanged.Evolution ledger
ledger_update: candidateAgentRunner -> TaskResult -> Framework/RewardLoopWorkercontract.Checklist
pre-commit run --all-files --show-diff-on-failurepasses.