Skip to content

fix: Improve AutoGen Studio: deprecate FunctionTool, harden MCP WebSocket endpoint#7362

Merged
victordibia merged 6 commits intomainfrom
ags_fix
Mar 11, 2026
Merged

fix: Improve AutoGen Studio: deprecate FunctionTool, harden MCP WebSocket endpoint#7362
victordibia merged 6 commits intomainfrom
ags_fix

Conversation

@victordibia
Copy link
Copy Markdown
Contributor

Why are these changes needed?

Two improvements to AutoGen Studio's security posture and developer experience:

  1. Deprecate FunctionTool in the UI: FunctionTool uses exec() to run user-supplied Python code at config load time. The UI now shows a deprecation warning for existing FunctionTool configs and directs users to MCP Workbenches instead. The FunctionTool template has been removed from the component gallery. Validation no longer instantiates FunctionTool configs (skips load_component() to avoid exec()).

  2. Harden MCP WebSocket endpoint: Previously, MCP server params were passed as base64-encoded query string parameters on the WebSocket URL. Now, server params are stored server-side via the POST /ws/connect endpoint and looked up by session_id when the WebSocket connects. Sessions are one-time use (pop on connect).

Changes

  • validation_service.py — Skip load_component() for FunctionTool
  • mcp.py — Server-side pending_session_params storage; WebSocket handler looks up params by session_id
  • component-templates.ts — Remove FunctionTool template
  • agent-fields.tsx — Remove handleAddTool
  • tool-fields.tsx — Show deprecation warning instead of code editor
  • workbench-fields.tsx — Remove "Add Tool" buttons

Related issue number

N/A — internal security hardening

Checks

…endpoint

- Deprecate FunctionTool creation in the UI; show deprecation warning for existing configs
- Skip FunctionTool instantiation during validation to avoid exec() on user code
- Store MCP server params server-side instead of passing via WebSocket query string
- Remove FunctionTool template and direct users to MCP Workbenches
@victordibia victordibia changed the title Improve AutoGen Studio: deprecate FunctionTool, harden MCP WebSocket endpoint fix: Improve AutoGen Studio: deprecate FunctionTool, harden MCP WebSocket endpoint Mar 10, 2026
The old version (20240930) uses a legacy setup.py that imports
pkg_resources without declaring setuptools as a build dependency,
causing uv sync --all-extras to fail in CI.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.21%. Comparing base (13e144e) to head (b275023).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7362      +/-   ##
==========================================
- Coverage   81.22%   81.21%   -0.01%     
==========================================
  Files         244      244              
  Lines       18512    18514       +2     
==========================================
+ Hits        15036    15037       +1     
- Misses       3476     3477       +1     
Flag Coverage Δ
unittests 81.21% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The docs build workflow was using `uv sync --locked --all-extras` which
pulls in optional extras like `video-surfer` that depend on `openai-whisper`.
This caused build failures across all matrix versions (old tags and current).

Docs building only needs core package imports for autodoc, not runtime extras.
Guard against empty/whitespace query strings in RedisMemory.query() by
returning an empty MemoryQueryResult early, avoiding a ValueError from
redisvl>=0.9.0 which rejects empty content in its embed() method.

Also fix the test assertion to verify empty queries return empty results.
docfx 2.78+ targets net10.0 and fails to compile .NET 8 projects due to
missing BCL references. Pin to 2.67.5 to match dotnet-tools.json manifest.

Add a mock-based unit test for the empty-string early return in
RedisMemory.query() so codecov can instrument the line without requiring
a live Redis instance.
@victordibia victordibia enabled auto-merge (squash) March 11, 2026 19:33
@victordibia victordibia disabled auto-merge March 11, 2026 19:42
@victordibia victordibia merged commit b047730 into main Mar 11, 2026
77 checks passed
@victordibia victordibia deleted the ags_fix branch March 11, 2026 19:42
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.

1 participant