Skip to content

feat: background task for agent request#471

Merged
rayrayraykk merged 4 commits intoagentscope-ai:mainfrom
rayrayraykk:weirui/dev/v1.1.2.beta.2
Mar 26, 2026
Merged

feat: background task for agent request#471
rayrayraykk merged 4 commits intoagentscope-ai:mainfrom
rayrayraykk:weirui/dev/v1.1.2.beta.2

Conversation

@rayrayraykk
Copy link
Copy Markdown
Member

@rayrayraykk rayrayraykk commented Mar 26, 2026

Description

[Describe what this PR does and why]

Related Issue: Fixes #[issue_number] or Relates to #[issue_number]

Security Considerations: [If applicable, especially for sandbox changes]

Type of Change

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

Component(s) Affected

  • Engine
  • Sandbox
  • Tools
  • Common
  • Documentation
  • Tests
  • CI/CD

Checklist

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

Testing

[How to test these changes]

Additional Notes

[Optional: any other context]

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a background-task execution mode for stream_query so clients can submit a request, get a task_id immediately, and poll for the final (non-streaming) result later.

Changes:

  • Introduces /process/task submission and /process/task/{task_id} polling when enable_stream_task=True.
  • Adds in-memory execution logic to collect and store only the final stream_query response event.
  • Adds integration tests and updates cookbook docs; bumps version to 1.1.2b2.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/agentscope_runtime/engine/app/agent_app.py Adds config knobs and registers the new task endpoints + root endpoint discovery info.
src/agentscope_runtime/engine/deployers/utils/service_utils/routing/task_engine_mixin.py Adds execute_stream_query_task for collecting only the final streamed event into task storage.
tests/integrated/test_agent_app_stream_task.py New integration tests covering task submission and polling behavior.
cookbook/en/agent_app.md Documents background task mode usage and endpoints (EN).
cookbook/zh/agent_app.md Documents background task mode usage and endpoints (ZH).
src/agentscope_runtime/version.py Runtime version bump to v1.1.2b2.
pyproject.toml Package version bump to 1.1.2b2.

Comment thread src/agentscope_runtime/engine/app/agent_app.py
Comment thread tests/integrated/test_agent_app_stream_task.py Outdated
Comment thread tests/integrated/test_agent_app_stream_task.py
Comment thread src/agentscope_runtime/engine/app/agent_app.py
Comment thread src/agentscope_runtime/engine/app/agent_app.py
Comment thread tests/integrated/test_agent_app_stream_task.py Outdated
Comment thread tests/integrated/test_agent_app_stream_task.py Outdated
Comment thread tests/integrated/test_agent_app_stream_task.py Outdated
Comment thread cookbook/zh/agent_app.md Outdated
Copilot AI review requested due to automatic review settings March 26, 2026 07:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Comment thread src/agentscope_runtime/engine/app/agent_app.py
Comment thread src/agentscope_runtime/engine/app/agent_app.py
Comment thread src/agentscope_runtime/engine/app/agent_app.py
Comment thread src/agentscope_runtime/engine/app/agent_app.py
Comment thread src/agentscope_runtime/engine/app/agent_app.py
@rayrayraykk rayrayraykk merged commit 53e5c00 into agentscope-ai:main Mar 26, 2026
11 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