Skip to content

Fix backend stability and local sandbox regressions#1575

Open
corazzione wants to merge 1 commit intobytedance:mainfrom
corazzione:fix/backend-batch-1
Open

Fix backend stability and local sandbox regressions#1575
corazzione wants to merge 1 commit intobytedance:mainfrom
corazzione:fix/backend-batch-1

Conversation

@corazzione
Copy link
Copy Markdown
Contributor

@corazzione corazzione commented Mar 29, 2026

Fixes #1095
Fixes #1261
Fixes #1452
Fixes #1473
Fixes #1513
Fixes #1543

Summary

This PR batches several backend stability and local-sandbox fixes that were reported independently but share the same execution path.

Included fixes

  • promote deferred tools after tool_search returns their schema so the tool becomes callable on the next turn
  • complete the shared agent factory migration so make_lead_agent uses the same middleware/features as the reusable factory entrypoint
  • move large-file conversion work off the event loop to avoid uploads/list timeouts after heavy uploads
  • treat only supported Feishu slash commands as commands, so file paths beginning with / are handled as normal chat input
  • allow configured sandbox.mounts paths in LocalSandbox, while still enforcing read-only mounts at the tool gate
  • reduce gateway reload loops in local development by excluding sandbox output directories from hot reload watches
  • reorder write_file tool arguments so path and content are the primary required fields exposed to the tool schema

Root causes

  • deferred MCP tools were discovered but never promoted out of the deferred filter
  • the lead-agent construction path had drifted from the shared factory runtime
  • synchronous file conversion could block the event loop during large uploads
  • Feishu treated any leading slash as a command marker
  • LocalSandbox config supported mounts, but the local tool security layer still rejected mounted virtual paths
  • gateway dev reload watched generated sandbox output paths
  • write_file exposed an unused description field as the first required schema parameter

Validation

  • ./.venv/Scripts/python.exe -m pytest tests/test_tool_search.py tests/test_create_deerflow_agent.py tests/test_lead_agent_model_resolution.py tests/test_file_conversion.py tests/test_feishu_parser.py tests/test_sandbox_tools_security.py -q
  • ./.venv/Scripts/python.exe -m ruff check packages/harness/deerflow/tools/builtins/tool_search.py packages/harness/deerflow/agents/factory.py packages/harness/deerflow/agents/features.py packages/harness/deerflow/agents/lead_agent/agent.py packages/harness/deerflow/utils/file_conversion.py packages/harness/deerflow/sandbox/tools.py packages/harness/deerflow/sandbox/local/local_sandbox_provider.py app/channels/feishu.py tests/test_tool_search.py tests/test_create_deerflow_agent.py tests/test_lead_agent_model_resolution.py tests/test_file_conversion.py tests/test_feishu_parser.py tests/test_sandbox_tools_security.py
  • cmd /c scripts\\run-with-git-bash.cmd ./scripts/test_gateway_reload_flags.sh

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 29, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment