fix(a2a): delegate_task returns str(result) for empty-parts responses #283

Closed
infra-runtime-be wants to merge 2 commits from runtime/fix-delegate-empty-parts-regression into main

2 Commits

Author SHA1 Message Date
02fb193847 fix(a2a): delegate_task returns str(result) for empty-parts responses
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 16s
sop-tier-check / tier-check (pull_request) Failing after 16s
audit-force-merge / audit (pull_request) Has been skipped
Before:
  return parts[0].get("text", "(no text)") if parts else str(data["result"])

When parts=[] (empty list), this falls through to str(data["result"]),
which always returns "(no text)" for the SSOT parse result variant.

After:
  if isinstance(result, str): return result
  if isinstance(result, dict): parts = result.get("parts", []); ...
  return str(result)

Fixes the regression where {"result": {"parts": []}} returns "(no text)"
instead of the actual string result body. Also correctly handles
plain-string result bodies ({"result": "my response"}).

Fixes molecule-core#279.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 10:06:36 +00:00
8f6e6d6ecc fix(workspace): default PLATFORM_URL to host.docker.internal in all modules
KI-014 follow-on: inside a workspace container, localhost refers to the
container itself, not the platform. Four files had the Docker-aware
if-branch correct but fell through to localhost:8080 as the non-Docker
fallback — effectively making the Docker path the ONLY path that works,
since local dev on Mac/Linux can also resolve host.docker.internal via
the Docker daemon's built-in resolver.

Fix: unify the default to host.docker.internal in both branches, so
the env-var override always works and no caller ever silently falls
back to the wrong address.

- a2a_cli.py: else branch hardcoded localhost → host.docker.internal
- consolidation.py: same
- coordinator.py: same
- builtin_tools/temporal_workflow.py: two inline os.environ.get defaults
  replaced with a _platform_url() helper for DRY + consistent detection

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 10:06:36 +00:00