fix(plugin): extend knowledge retrieval timeout

This commit is contained in:
huanghuoguoguo
2026-07-20 17:12:55 +08:00
parent e4d4860446
commit 7615c40f73
2 changed files with 19 additions and 1 deletions
+1 -1
View File
@@ -1944,7 +1944,7 @@ class RuntimeConnectionHandler(handler.Handler):
'retriever_name': retriever_name,
'retrieval_context': retrieval_context,
},
timeout=30,
timeout=180,
)
return result
+18
View File
@@ -274,6 +274,24 @@ class TestHandlerPluginDiagnostic:
plugin_handler.LangBotToRuntimeAction = original
class TestHandlerKnowledgeRetrieval:
@pytest.mark.asyncio
async def test_retrieve_knowledge_allows_runtime_to_finish_inner_timeout(self):
app = SimpleNamespace()
runtime_handler = make_handler(app)
runtime_handler.call_action = AsyncMock(return_value={'results': []})
result = await runtime_handler.retrieve_knowledge(
'langbot-team',
'LangRAG',
'',
{'query': 'sentinel'},
)
assert result == {'results': []}
assert runtime_handler.call_action.await_args.kwargs['timeout'] == 180
class TestConstantsSemanticVersion:
"""Tests for version constant access."""