feat(agentic-rl): add function instance log query/delete APIs and error_code outputs - #196
Merged
Merged
Conversation
added 4 commits
September 15, 2026 11:03
Add a shared before-validator so RolloutOutput/RewardOutput accept int error codes without hard-failing validation, while downstream always receives str (the protocol type stays string).
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.
Description
Enhancements to the Agentic RL fine-tuning module (
dashscope.finetune.agentic_rl/dashscope.finetune.reinforcement).New function (FaaS) instance APIs on
AgenticRL:query_function_instance_logs()— query logs of a deployed function instance with pagination, time-range and keyword filtersquery_all_function_instance_logs()— aggregate all log entries across pagesdelete_function_instance()— delete a function runtime instanceverify_deployed_function()— newpull_logs/log_page_size/start_time/end_timeoptions to pull and print instance logs after verificationFC_QUERY_LOG_API/FC_DELETE_API(env-overridable, consistent with the existingFC_*constants)InstanceQueryErrorwith dedicated error codes (3009/3010/3011 at the API layer, 2074/2075 at the component layer)Error-code plumbing:
RolloutOutput/RewardOutputgain an optionalerror_codefield so rollout/reward failures can carry machine-readable error codesClearer OSS upload errors:
FC_ZIP_EXCLUDE_PATTERNS,FC_OSS_FILE_SIZE_WARNING)Related Issue: N/A
Security Considerations: No API keys or sensitive credentials are exposed in code or logs. Log pulling only prints function-instance log content; API keys are passed via request headers as before.
Type of Change
Component(s) Affected
dashscope.finetune.agentic_rl,dashscope.finetune.reinforcement)Checklist
Testing
python3 -m pytest tests/unit/test_agentic_rl_components.py tests/unit/test_agentic_rl_model.py tests/unit/test_agentic_rl_submit_job.py tests/unit/test_agentic_rl_utils.py -q→ 147 passedpre-commit run --files <changed files>→ all hooks pass (mypy / black / flake8 / pylint)await AgenticRL.query_all_function_instance_logs(function_instance_id=...)andawait AgenticRL.delete_function_instance(function_instance_id=...)Additional Notes
Branch is rebased onto the latest upstream
main(9b2fb54), so it should merge cleanly.