mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-26 18:06:00 +00:00
e344be8d94
* feat(tests): add Blockbuster runtime gate for event-loop blocking IO Adds a strict runtime gate that fails CI when sync blocking IO calls run on the asyncio event loop thread through DeerFlow business code. Components: - backend/tests/support/detectors/blocking_io_runtime.py — Blockbuster context scoped to `app.*` and `deerflow.*` so test infrastructure, pytest internals, and third-party libraries stay silent. - backend/tests/blocking_io/conftest.py — pytest_runtest_protocol hookwrapper that wraps every item (setup + call + teardown) with the strict context. Respects `@pytest.mark.allow_blocking_io` opt-out. - backend/tests/blocking_io/test_skills_load.py — regression anchor for the #1917 fix (asyncio.to_thread offload around LocalSkillStorage.load_skills). - backend/tests/blocking_io/test_sqlite_lifespan.py — regression anchor for the #1912 fix (asyncio.to_thread offload around ensure_sqlite_parent_dir). - backend/tests/blocking_io/test_gate_smoke.py — meta-test asserting the gate actually catches unoffloaded blocking IO and that the `@pytest.mark.allow_blocking_io` opt-out works. - backend/Makefile — `make test-blocking-io` target. - .github/workflows/backend-blocking-io-tests.yml — hard-fail PR gate on ubuntu-latest. Windows matrix deferred to follow-up. Dependencies: - blockbuster>=1.5.26,<1.6 added to dev group. Coverage boundary (called out in PR body): the gate only catches blocking IO on code paths the test suite actually exercises. Static AST inventory (separate, informational) is the complementary coverage tool. Three blind spot categories — untested paths, mocked-away paths, env-mismatched paths — are documented in the PR description. Findings surfaced while authoring this PR: - resolve_sqlite_conn_str in runtime/store/_sqlite_utils.py:19 does sync Path.resolve() -> os.path.abspath on the lifespan loop thread, ahead of the #1912 fix. Not addressed here; tracked as follow-up. Tests: 4 passed locally (`make test-blocking-io`). Lint/format: clean (`ruff check` and `ruff format --check`). * fix(tests): scope Blockbuster gate to blocking-io suite * fix(tests): harden Blockbuster runtime gate * test(blocking-io): add project rule extension point * test(blocking-io): address review cleanup
53 lines
1.3 KiB
TOML
53 lines
1.3 KiB
TOML
[project]
|
|
name = "deer-flow"
|
|
version = "0.1.0"
|
|
description = "LangGraph-based AI agent system with sandbox execution capabilities"
|
|
readme = "README.md"
|
|
requires-python = ">=3.12"
|
|
dependencies = [
|
|
"deerflow-harness",
|
|
"fastapi>=0.115.0",
|
|
"httpx>=0.28.0",
|
|
"python-multipart>=0.0.27",
|
|
"sse-starlette>=2.1.0",
|
|
"uvicorn[standard]>=0.34.0",
|
|
"lark-oapi>=1.4.0",
|
|
"slack-sdk>=3.33.0",
|
|
"python-telegram-bot>=21.0",
|
|
"langgraph-sdk>=0.1.51",
|
|
"markdown-to-mrkdwn>=0.3.1",
|
|
"wecom-aibot-python-sdk>=0.1.6",
|
|
"dingtalk-stream>=0.24.3",
|
|
"bcrypt>=4.0.0",
|
|
"pyjwt>=2.9.0",
|
|
"email-validator>=2.0.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
postgres = ["deerflow-harness[postgres]"]
|
|
discord = ["discord.py>=2.7.0"]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"blockbuster>=1.5.26,<1.6",
|
|
"prompt-toolkit>=3.0.0",
|
|
"pytest>=9.0.3",
|
|
"pytest-asyncio>=1.3.0",
|
|
"ruff>=0.14.11",
|
|
]
|
|
|
|
[tool.pytest.ini_options]
|
|
markers = [
|
|
"no_auto_user: disable the conftest autouse contextvar fixture for this test",
|
|
"allow_blocking_io: opt out of the strict Blockbuster gate in tests/blocking_io/",
|
|
]
|
|
|
|
[tool.uv]
|
|
index-url = "https://pypi.org/simple"
|
|
|
|
[tool.uv.workspace]
|
|
members = ["packages/harness"]
|
|
|
|
[tool.uv.sources]
|
|
deerflow-harness = { workspace = true }
|