Skip to content

fix(agentscope): use correct to_agentscope() instead of to_crewai() i…#76

Merged
OhYee merged 1 commit intomainfrom
fix/agentscope-toolset-wrong-conversion
Mar 31, 2026
Merged

fix(agentscope): use correct to_agentscope() instead of to_crewai() i…#76
OhYee merged 1 commit intomainfrom
fix/agentscope-toolset-wrong-conversion

Conversation

@OhYee
Copy link
Copy Markdown
Member

@OhYee OhYee commented Mar 31, 2026

…n toolset()

The toolset() function in agentscope integration was incorrectly calling .to_crewai() instead of .to_agentscope(), returning CrewAI-formatted tools instead of AgentScope-formatted ones.

Change-Id: I41758ca6e22173cfc4cc47fa95713c8fb5d992a7
Co-developed-by: Claude noreply@anthropic.com

Thank you for creating a pull request to contribute to Serverless Devs agentrun-sdk-python code! Before you open the request please answer the following questions to help it be more easily integrated. Please check the boxes "[ ]" with "[x]" when done too.
Please select one of the PR types below to complete


Fix bugs

Bug detail

The specific manifestation of the bug or the associated issue.

Pull request tasks

  • Add test cases for the changes
  • Passed the CI test

Update docs

Reason for update

Why do you need to update your documentation?

Pull request tasks

  • Update Chinese documentation
  • Update English documentation

Add contributor

Contributed content

  • Code
  • Document

Content detail

if content_type == 'code' || content_type == 'document':
    please tell us `PR url`,like: https://github.com/Serverless-Devs/agentrun-sdk-python/pull/1
else:
    please describe your contribution in detail

Others

Reason for update

Why do you need to update your documentation?

…n toolset()

The toolset() function in agentscope integration was incorrectly calling
.to_crewai() instead of .to_agentscope(), returning CrewAI-formatted tools
instead of AgentScope-formatted ones.

Change-Id: I41758ca6e22173cfc4cc47fa95713c8fb5d992a7
Co-developed-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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

Fixes the AgentScope integration helper to return AgentScope-formatted tools by calling to_agentscope() instead of mistakenly calling to_crewai(), which previously produced CrewAI-formatted tools.

Changes:

  • Update agentrun.integration.agentscope.builtin.toolset() to use ts.to_agentscope(...) for correct tool conversion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 42 to +46
) -> List[Any]:
"""将内置工具集封装为 LangChain ``StructuredTool`` 列表。 / AgentScope Built-in Integration Functions"""

ts = _toolset(input=name, config=config)
return ts.to_crewai(
return ts.to_agentscope(
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The toolset() docstring says it returns a LangChain StructuredTool list, but this AgentScope integration now returns AgentScope-formatted tools (via to_agentscope()), which are not LangChain StructuredTools. Updating the docstring to describe the actual AgentScope return type/usage would avoid misleading users.

Copilot uses AI. Check for mistakes.
Comment on lines 45 to 49
ts = _toolset(input=name, config=config)
return ts.to_crewai(
return ts.to_agentscope(
prefix=prefix,
modify_tool_name=modify_tool_name,
filter_tools_by_name=filter_tools_by_name,
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

This bug fix changes the framework conversion method used by the AgentScope toolset() helper. To prevent regressions (e.g., accidentally calling to_crewai() again), please add a unit/integration test that exercises agentrun.integration.agentscope.builtin.toolset() and asserts the returned tools are AgentScope-compatible (not CrewAI/LangChain formatted).

Copilot uses AI. Check for mistakes.
@OhYee OhYee merged commit 91438d9 into main Mar 31, 2026
5 of 6 checks passed
@OhYee OhYee deleted the fix/agentscope-toolset-wrong-conversion branch March 31, 2026 09:24
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