From 7dbbe8aee8bfdbaa5318f2152f325e04f4b0452f Mon Sep 17 00:00:00 2001 From: RockChinQ Date: Sun, 1 Nov 2026 08:27:57 +0000 Subject: [PATCH] test(localagent): fix fixture resources setup for pypi sdk 0.7.19 compatibility (LANG-233) - Use SimpleNamespace on ctx.resources in test fixture to prevent Pydantic ValidationError on PyPI langbot-plugin==0.7.19 - Retain object structure for models, tools, knowledge_bases, skills and platform capabilities Co-authored-by: multica-agent --- .../LocalAgent/tests/test_workspace_tools.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/Runner/LocalAgent/tests/test_workspace_tools.py b/plugins/Runner/LocalAgent/tests/test_workspace_tools.py index db54919d4..f71d89583 100644 --- a/plugins/Runner/LocalAgent/tests/test_workspace_tools.py +++ b/plugins/Runner/LocalAgent/tests/test_workspace_tools.py @@ -68,15 +68,24 @@ def _make_ctx( models=models, tools=tools or [], ) - if workspace_ops is not None: - setattr(resources, "workspace_operations", workspace_ops) - return make_context( + ctx = make_context( run_id="run-test-1", input_text="test question", config=cfg, resources=resources, delivery_supports_streaming=False, ) + if workspace_ops is not None: + ctx.resources = types.SimpleNamespace( + models=list(resources.models), + tools=list(resources.tools), + knowledge_bases=list(getattr(resources, "knowledge_bases", [])), + skills=list(getattr(resources, "skills", [])), + storage=getattr(resources, "storage", None), + platform_capabilities=getattr(resources, "platform_capabilities", {}), + workspace_operations=workspace_ops, + ) + return ctx # ==============================================================================