[framework, docs] feat: forward TaskResult.extra_info metadata - #144
Open
qiangyupei wants to merge 1 commit into
Open
[framework, docs] feat: forward TaskResult.extra_info metadata#144qiangyupei wants to merge 1 commit into
qiangyupei wants to merge 1 commit into
Conversation
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
Forward compact, use-case-specific
TaskResult.extra_infofields through the generic Task Runner into a Gateway session'sreward_info. This lets verifier metrics reach finalized trajectory metadata without adding task knowledge toGateway or the Agent Framework.
TaskResult.extra_infoalready exists. This PR only defines how the generic Runner forwards it when the existingreport_reward=trueoption is enabled.Changes
extra_infointo sessionreward_info.reward,acc, andfinishedreserved for canonicalTaskResultfields; ignore colliding metadata keys.API
The 64 KiB limit is a Task Runner policy, not a Gateway, HTTP, Ray, or trajectory schema requirement. Session metadata is copied into finalized trajectories and training records, so large logs, source code, and evaluator artifacts should use artifact storage instead.
Compatibility
report_reward=falsepreserves the original Runner behavior and does not forwardextra_info.report_reward=trueand noextra_info, the canonical payload is unchanged.Validation
Validated on Ubuntu with Python 3.11 against
28174fdab3787d307ae3a96d32d3737b600575a0.python -m pytest -q \ tests/uni_agent/framework/test_task_runner.py \ tests/uni_agent/tasks/test_inference_task_routing.py # 21 passed, 3 warnings in 9.89sThe focused tests cover successful metadata forwarding, reserved-key protection, invalid JSON values, serialization failures, and the 64 KiB serialized-size boundary. Existing Task Runner and Task routing behavior is also covered by the same test run.
Focused lint and format validation:
The focused CPU tests, Ruff check, and format check passed. The three warnings come from third-party OpenTelemetry, SciPy/NumPy, and Ray dependencies and do not affect the test result.
Checklist
serialization failures, and the serialized-size boundary.
TaskResult.extra_inforemains covered.are documented.
21 passed).