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 <[email protected]>
This commit is contained in:
RockChinQ
2026-11-01 08:27:57 +00:00
co-authored by multica-agent
parent 1400bb8cfb
commit 7dbbe8aee8
@@ -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
# ==============================================================================