Skip to content

[bot] Support AgentScope 2.0 integration APIs #483

@AbhiPrasad

Description

Summary

The weekly dependency update PR #478 bumped the latest AgentScope matrix pin from agentscope==1.0.20 to agentscope==2.0.0. The current Braintrust AgentScope integration tests no longer run against 2.0.0 because several AgentScope APIs used by our integration tests and auto-instrumentation smoke script were removed or moved.

For PR #478, we restored the existing agentscope latest cassettes rather than committing a broken or partial re-record. This issue tracks adding explicit support for AgentScope 2.0.

Reproduction

On PR #478 / branch deps/weekly-update-2026-06-01, run:

cd py
nox -s "test_agentscope(latest)" -- --vcr-record=all

Observed with agentscope==2.0.0:

ImportError: cannot import name 'ReActAgent' from 'agentscope.agent'
ModuleNotFoundError: No module named 'agentscope.pipeline'
ImportError: cannot import name 'execute_python_code' from 'agentscope.tool'
ImportError: cannot import name 'AgentBase' from 'agentscope.agent'

Affected test/script locations:

  • py/src/braintrust/integrations/agentscope/test_agentscope.py
    • _make_agent() imports ReActAgent from agentscope.agent
    • sequential pipeline test imports sequential_pipeline from agentscope.pipeline
    • tool-use test imports Toolkit / execute_python_code from agentscope.tool
  • py/src/braintrust/integrations/auto_test_scripts/test_auto_agentscope.py
    • imports AgentBase and ReActAgent from agentscope.agent

Investigation plan

  1. Review the AgentScope 2.0 migration guide / changelog and identify replacements for:

    • agentscope.agent.AgentBase
    • agentscope.agent.ReActAgent
    • agentscope.pipeline.sequential_pipeline
    • agentscope.tool.execute_python_code
  2. Inspect AgentScope 2.0 package structure locally, e.g.:

    cd py
    nox -s "test_agentscope(latest)" -- --disable-vcr -k non_vcr_or_import_probe
    # or use the nox-created env / a scratch env to inspect:
    python - <<'PY'
    import agentscope, pkgutil
    print(agentscope.__version__)
    print([m.name for m in pkgutil.iter_modules(agentscope.__path__)])
    PY
  3. Decide whether the Braintrust integration needs version-gated code paths:

    • keep AgentScope 1.x behavior working for the existing 1.0.0 matrix entry
    • add AgentScope 2.x wrappers / instrumentation paths where APIs have changed
  4. Update tests to cover both versions in the nox matrix:

    • keep existing 1.x cassettes
    • re-record py/src/braintrust/integrations/agentscope/cassettes/latest/ once 2.0 support is implemented
  5. Verify:

    cd py
    nox -s "test_agentscope(latest)"
    nox -s "test_agentscope(1.0.0)"

Notes

This is a major dependency bump (1.0.20 -> 2.0.0), so API breakage is expected. The immediate failure is at import time before cassette playback/recording can meaningfully validate provider response shape.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions