Skip to content

feat(agentic-rl): add function instance log query/delete APIs and error_code outputs - #196

Merged
luk384090-cloud merged 4 commits into
dashscope:mainfrom
luozirong2025:error_code
Sep 17, 2026
Merged

luk384090-cloud merged 4 commits into
dashscope:mainfrom
luozirong2025:error_code

Conversation

@luozirong2025

Copy link
Copy Markdown
Contributor

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 filters
  • query_all_function_instance_logs() — aggregate all log entries across pages
  • delete_function_instance() — delete a function runtime instance
  • verify_deployed_function() — new pull_logs / log_page_size / start_time / end_time options to pull and print instance logs after verification
  • New endpoint constants FC_QUERY_LOG_API / FC_DELETE_API (env-overridable, consistent with the existing FC_* constants)
  • Failures raise InstanceQueryError with dedicated error codes (3009/3010/3011 at the API layer, 2074/2075 at the component layer)

Error-code plumbing:

  • RolloutOutput / RewardOutput gain an optional error_code field so rollout/reward failures can carry machine-readable error codes

Clearer OSS upload errors:

  • Oversized packages now fail fast before upload, with actual size, configured limit, and remediation hints (FC_ZIP_EXCLUDE_PATTERNS, FC_OSS_FILE_SIZE_WARNING)
  • Upload failures log file name, size, HTTP status and response body; partial upload failures now include per-file details

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

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Agentic RL fine-tuning (dashscope.finetune.agentic_rl, dashscope.finetune.reinforcement)

Checklist

  • Pre-commit hooks pass
  • Tests pass locally
  • Documentation updated (if needed)
  • Ready for review

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 passed
  • pre-commit run --files <changed files> → all hooks pass (mypy / black / flake8 / pylint)
  • Manual: deploy a function instance, then await AgenticRL.query_all_function_instance_logs(function_instance_id=...) and await AgenticRL.delete_function_instance(function_instance_id=...)

Additional Notes

Branch is rebased onto the latest upstream main (9b2fb54), so it should merge cleanly.

zirongluo 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).
@luk384090-cloud
luk384090-cloud merged commit cb410ef into dashscope:main Sep 17, 2026
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