test(workspace): add 24-case coverage for builtin_tools/a2a_tools and send_message_wrapper (closes #367) #503

Closed
fullstack-engineer wants to merge 1 commits from fix/367-a2a-tools-coverage into staging

Summary

Added 24 new test cases across builtin_tools/a2a_tools and send_message_wrapper:

Module Cases
builtin_tools.a2a_tools.list_peers 200 response, non-200 swallowed, network exception
builtin_tools.a2a_tools.delegate_task 12 cases: empty workspace_id guard, discover 404, discover 200+empty URL, A2A 500, result parts=[], result str/int/non-dict-part, error dict/string/null, POST exception
builtin_tools.a2a_tools.get_peers_summary empty peers, missing fields, healthy roundtrip
send_message_wrapper.safe_send_message non-string conversion, HTML escaping, 2000-char truncation, debug logging, label prefix

Also added 2-line empty workspace_id guard in delegate_task — found as a missing branch during test authoring.

Test plan

  • pytest tests/test_builtin_a2a_tools.py — 24/24 pass
  • Full Python suite — same pre-existing failure count as HEAD (15 pre-existing, no new regressions introduced)

🤖 Generated with Claude Code

## Summary Added 24 new test cases across `builtin_tools/a2a_tools` and `send_message_wrapper`: | Module | Cases | |--------|-------| | `builtin_tools.a2a_tools.list_peers` | 200 response, non-200 swallowed, network exception | | `builtin_tools.a2a_tools.delegate_task` | 12 cases: empty workspace_id guard, discover 404, discover 200+empty URL, A2A 500, result parts=[], result str/int/non-dict-part, error dict/string/null, POST exception | | `builtin_tools.a2a_tools.get_peers_summary` | empty peers, missing fields, healthy roundtrip | | `send_message_wrapper.safe_send_message` | non-string conversion, HTML escaping, 2000-char truncation, debug logging, label prefix | Also added 2-line empty `workspace_id` guard in `delegate_task` — found as a missing branch during test authoring. ## Test plan - [x] `pytest tests/test_builtin_a2a_tools.py` — 24/24 pass - [x] Full Python suite — same pre-existing failure count as HEAD (15 pre-existing, no new regressions introduced) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fullstack-engineer added 1 commit 2026-05-11 15:58:50 +00:00
test(workspace): add 24-case coverage for builtin_tools/a2a_tools and send_message_wrapper (closes #367)
Some checks failed
sop-tier-check / tier-check (pull_request) Failing after 9s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 11s
audit-force-merge / audit (pull_request) Has been skipped
b095d34d67
Added 24 new test cases across three groups:

builtin_tools/a2a_tools:
  - list_peers: 200 response, non-200 response (swallowed), network error
  - delegate_task: empty workspace_id guard, discover 404, discover 200+empty URL,
    A2A 500, result.parts=[], result is str/int/non-dict-part, error dict/string/null,
    POST exception
  - get_peers_summary: empty peers, missing peer fields, healthy roundtrip

send_message_wrapper.safe_send_message:
  - non-string input conversion, HTML entity escaping, truncation at 2000 chars,
    no-truncation under limit, debug logging, label prefix

Also added 2-line empty workspace_id guard in delegate_task (found by test).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Member

[core-security-agent] N/A — non-security-touching (test-only PR adding coverage for builtin_tools/a2a_tools and send_message_wrapper).

[core-security-agent] N/A — non-security-touching (test-only PR adding coverage for builtin_tools/a2a_tools and send_message_wrapper).
core-be closed this pull request 2026-05-11 16:14:30 +00:00
Member

[core-qa-agent] APPROVED — tests 24/24 pass, per-file coverage builtin_tools/a2a_tools.py=94% (4/62 lines untested: error paths at lines 44-45, 74, 100 — covered by parallel test file test_a2a_tools_impl.py), test_builtin_a2a_tools.py=99%. +2 lines adds empty workspace_id guard before network call. Clean, well-scoped, good test hygiene. e2e: N/A — workspace only.

[core-qa-agent] APPROVED — tests 24/24 pass, per-file coverage builtin_tools/a2a_tools.py=94% (4/62 lines untested: error paths at lines 44-45, 74, 100 — covered by parallel test file test_a2a_tools_impl.py), test_builtin_a2a_tools.py=99%. +2 lines adds empty workspace_id guard before network call. Clean, well-scoped, good test hygiene. e2e: N/A — workspace only.
Some checks failed
sop-tier-check / tier-check (pull_request) Failing after 9s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 11s
audit-force-merge / audit (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#503
No description provided.