SDK delegate() uses target as source and omits target_id #26

Closed
opened 2026-05-21 18:53:09 +00:00 by hongming · 0 comments
Owner

Finding from communication-parity audit (2026-05-21). Server contract is POST /workspaces/:source_id/delegate with JSON body {target_id, task, idempotency_key}. Evidence: molecule-core workspace-server/internal/handlers/delegation.go delegateRequest requires target_id and Delegate uses c.Param("id") as sourceID. Current molecule-sdk-python RemoteAgentClient.delegate posts to /workspaces/{target_id}/delegate and sends only {task,idempotency_key}; tests assert that wrong URL. This can make remote/external SDK delegation diverge from runtime molecule-mcp and from platform-owned workspaces. Fix: change SDK to POST /workspaces/{self.workspace_id}/delegate with target_id in body, update tests, and add a contract-style test that mirrors the server route shape.

Finding from communication-parity audit (2026-05-21). Server contract is POST /workspaces/:source_id/delegate with JSON body {target_id, task, idempotency_key}. Evidence: molecule-core workspace-server/internal/handlers/delegation.go delegateRequest requires target_id and Delegate uses c.Param("id") as sourceID. Current molecule-sdk-python RemoteAgentClient.delegate posts to /workspaces/{target_id}/delegate and sends only {task,idempotency_key}; tests assert that wrong URL. This can make remote/external SDK delegation diverge from runtime molecule-mcp and from platform-owned workspaces. Fix: change SDK to POST /workspaces/{self.workspace_id}/delegate with target_id in body, update tests, and add a contract-style test that mirrors the server route shape.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-sdk-python#26