Merge remote-tracking branch 'origin/master' into ji
This commit is contained in:
commit
5bf08c83a6
176 files changed
+33341
-1896
No files matched your search
@@ -9,6 +9,9 @@ import yaml
|
||||
from starlette.routing import Match
|
||||
|
||||
from app.gateway.routers import model_management as router
|
||||
from deerflow.config.app_config import AppConfig
|
||||
from deerflow.config.model_config import ModelConfig
|
||||
from deerflow.models.factory import create_chat_model
|
||||
|
||||
|
||||
def test_replace_models_block_keeps_other_sections_and_comments() -> None:
|
||||
@@ -149,3 +152,27 @@ async def test_connection_test_uses_one_minimal_prompt_without_writing_config(
|
||||
assert len(messages_seen) == 1
|
||||
assert messages_seen[0].content == "Reply with exactly: OK"
|
||||
assert config_path.read_text(encoding="utf-8") == original
|
||||
|
||||
|
||||
def test_force_disable_thinking_skips_generic_openai_models_without_thinking_support() -> None:
|
||||
"""LiteLLM proxies reject vendor-specific thinking payloads for ordinary chat models."""
|
||||
config = AppConfig.model_construct(
|
||||
models=[
|
||||
ModelConfig(
|
||||
name="litellm-qwen",
|
||||
use="langchain_openai:ChatOpenAI",
|
||||
model="qwen3.6",
|
||||
api_key="test-key",
|
||||
base_url="http://litellm.example/v1",
|
||||
supports_thinking=False,
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
chat_model = create_chat_model(
|
||||
"litellm-qwen",
|
||||
app_config=config,
|
||||
force_disable_thinking=True,
|
||||
)
|
||||
|
||||
assert chat_model.extra_body is None
|
||||
@@ -38,7 +38,10 @@ async def store(tmp_path):
|
||||
import deerflow.persistence.position_roundtable.model # noqa: F401
|
||||
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
return PositionRoundtableRepository(async_sessionmaker(engine, expire_on_commit=False))
|
||||
try:
|
||||
yield PositionRoundtableRepository(async_sessionmaker(engine, expire_on_commit=False))
|
||||
finally:
|
||||
await engine.dispose()
|
||||
|
||||
|
||||
def test_reject_node_request_allows_an_optional_reason():
|
||||
@@ -1206,6 +1209,8 @@ async def test_builtin_summary_and_action_plan_snapshots_are_invalidated_by_reje
|
||||
|
||||
|
||||
def test_rejected_or_stale_node_requires_a_new_markdown_delivery() -> None:
|
||||
from deerflow.persistence.position_roundtable.delivery import markdown_delivery_changed
|
||||
|
||||
old = [
|
||||
{
|
||||
"name": "report.md",
|
||||
@@ -1214,8 +1219,8 @@ def test_rejected_or_stale_node_requires_a_new_markdown_delivery() -> None:
|
||||
"size_bytes": 100,
|
||||
}
|
||||
]
|
||||
assert not position_roundtable_router._markdown_delivery_changed(old, old)
|
||||
assert position_roundtable_router._markdown_delivery_changed(
|
||||
assert not markdown_delivery_changed(old, old)
|
||||
assert markdown_delivery_changed(
|
||||
old,
|
||||
[{**old[0], "modified_at": "2026-07-21T00:05:00+00:00", "size_bytes": 120}],
|
||||
)
|
||||
@@ -1358,6 +1363,17 @@ async def test_locked_node_cannot_bind_a_thread_before_its_stage_is_ready():
|
||||
"thread_id": None,
|
||||
}
|
||||
|
||||
async def apply_node_command(
|
||||
self, session_id, node_key, user_id, *, command_id, command_type, payload=None,
|
||||
expected_session_version=None,
|
||||
):
|
||||
# Mirrors the in-lock rejection a locked node produces in the real store.
|
||||
return {
|
||||
"ok": False,
|
||||
"http_status": 409,
|
||||
"detail": "上游节点尚未完成,当前节点未解锁",
|
||||
}
|
||||
|
||||
request = SimpleNamespace(
|
||||
app=SimpleNamespace(state=SimpleNamespace(position_roundtable_store=LockedStore())),
|
||||
state=SimpleNamespace(user=SimpleNamespace(id="user-a")),
|
||||
|
||||
Reference in new issue
Block a user