molecule-core/workspace-server/internal
Molecule AI Core-BE 1ecc384852 test(handlers): fix delegation and MCP tests exposed by full platform suite
Commit b9311134 added a CanCommunicate hierarchy check to proxyA2ARequest.
The executeDelegation tests call proxyA2ARequest directly but did not mock
the workspace hierarchy lookup, causing sqlmock to reject the unexpected
queries and fall through to the DELEGATION_FAILED path.

Fix: add mockCanCommunicate(mock, testSourceID, testTargetID, true) to
each affected executeDelegation test so the hierarchy check returns true
and the proxy is actually called.

Separately, TestMCPHandler_CommitMemory_GlobalScope_Blocked expected
zero DB calls (the handler should block GLOBAL scope before any DB work).
With no memv2 wired, toolCommitMemory fell through to the legacy shim,
which called scopeToWritableNamespace before the scope check.

Fix: wire memv2 via withMemoryV2APIs(nil, nil) in newMCPHandler so the
v2 path is taken and the GLOBAL scope check fires before any DB call.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 21:30:50 +00:00
..
artifacts
buildinfo
bundle refactor(events): migrate 18 files to typed EventType constants (RFC #2945 PR-B-1) 2026-05-05 19:05:03 -07:00
channels refactor(events): migrate 18 files to typed EventType constants (RFC #2945 PR-B-1) 2026-05-05 19:05:03 -07:00
crypto
db
envx
events feat(events): typed EventType registry — single source of truth for WS event names (RFC #2945 PR-B) 2026-05-05 16:25:38 -07:00
handlers test(handlers): fix delegation and MCP tests exposed by full platform suite 2026-05-11 21:30:50 +00:00
imagewatch fix(workspace-server): respect MOLECULE_IMAGE_REGISTRY in imagewatch + admin_workspace_images (RFC #229 P2-4) 2026-05-10 04:21:27 -07:00
memory fix(textutil): SSOT for rune-safe string truncation, fix 3 audit-gap bugs 2026-05-05 23:01:21 -07:00
messagestore feat(canvas/chat-server): canvas consumes /chat-history + server-side row-aware reverse (RFC #2945 PR-C-2) 2026-05-06 16:55:00 -07:00
metrics
middleware docs(ratelimit): tighten dev-mode comment after keyFor refactor 2026-05-07 14:57:21 -07:00
models
orgtoken
pendinguploads fix(pendinguploads): accept done channel in StartSweeperWithIntervalForTest 2026-05-11 21:15:49 +00:00
plugins [core-lead-agent] fix(core#228): cascade fixes for PluginResolver — make main compile 2026-05-10 09:46:35 +00:00
provisioner fix(provisioner): fix type mismatch in checkTool seam 2026-05-11 18:45:39 +00:00
provlog
registry chore: reconcile main → staging post-suspension divergence 2026-05-07 14:24:37 -07:00
router [core-lead-agent] fix(core#228): cascade fixes for PluginResolver — make main compile 2026-05-10 09:46:35 +00:00
scheduler fix(textutil): SSOT for rune-safe string truncation, fix 3 audit-gap bugs 2026-05-05 23:01:21 -07:00
supervised
textutil fix(textutil): SSOT for rune-safe string truncation, fix 3 audit-gap bugs 2026-05-05 23:01:21 -07:00
ws
wsauth