fix(QA-audit #307 #308): asyncio lifecycle fix + push-mode queue support #317

Closed
core-be wants to merge 3 commits from fix/qa-audit-307-308 into main
Member

Summary

Two fixes from QA audit:

Issue #307 — regression (medium): workspace/tests/test_a2a_tools_inbox_wrappers.py — 14 tests pass in isolation, exit 1 in full suite. Root cause: _run() helper used asyncio.get_event_loop().run_until_complete() which bypasses pytest-asyncio's event-loop lifecycle. Fix: replaced with @pytest.mark.asyncio + async def / await.

Issue #308 — test gap (low): workspace/a2a_response.py push-mode queue handling (PR #278) had no tests. Fix: extend parse() to handle any non-null delivery_mode (poll/push/future), propagate the actual mode into Queued(method=, delivery_mode=), and add 3 fixtures + 4 test cases in test_a2a_response.py.

Test plan

  • cd workspace && python -m pytest tests/test_a2a_tools_inbox_wrappers.py -v — all 14 tests pass in isolation
  • cd workspace && python -m pytest tests/test_a2a_response.py -v — all push-mode cases covered
  • Full suite: cd workspace && python -m pytest — no new failures, no regressions

🤖 Generated with Claude Code

## Summary Two fixes from QA audit: **Issue #307 — regression (medium):** `workspace/tests/test_a2a_tools_inbox_wrappers.py` — 14 tests pass in isolation, exit 1 in full suite. Root cause: `_run()` helper used `asyncio.get_event_loop().run_until_complete()` which bypasses pytest-asyncio's event-loop lifecycle. Fix: replaced with `@pytest.mark.asyncio` + `async def` / `await`. **Issue #308 — test gap (low):** `workspace/a2a_response.py` push-mode queue handling (PR #278) had no tests. Fix: extend `parse()` to handle any non-null `delivery_mode` (poll/push/future), propagate the actual mode into `Queued(method=, delivery_mode=)`, and add 3 fixtures + 4 test cases in `test_a2a_response.py`. ## Test plan - [ ] `cd workspace && python -m pytest tests/test_a2a_tools_inbox_wrappers.py -v` — all 14 tests pass in isolation - [ ] `cd workspace && python -m pytest tests/test_a2a_response.py -v` — all push-mode cases covered - [ ] Full suite: `cd workspace && python -m pytest` — no new failures, no regressions 🤖 Generated with [Claude Code](https://claude.com/claude-code)
core-be added 3 commits 2026-05-10 13:16:48 +00:00
Two clean fixes toward building main, on top of fix/pluginresolver-conflict (d88a320f):
  1. go.sum: refreshed for go.moleculesai.app/plugin/gh-identity (was carrying the
     pre-suspension github.com path) — now resolves via the live go-import responder.
  2. router.go: moved the 'plugin drift queue (core#123)' block to AFTER the plgh
     handler is constructed (it was at line ~502, plgh declared at ~623 -> 'undefined: plgh').

Remaining (NOT fixed here — needs Core-BE; this is d88a320f's refactor):
  - main.go:341: router.Setup takes plugins.SourceResolver, but main.go passes
    *plugins.Registry (no Fetch/Scheme method). router.Setup's pluginResolver param
    type is wrong — should be *plugins.Registry or a narrow Register/Resolve/Schemes
    interface, not SourceResolver.
  - main.go:350: StartPluginDriftSweeper takes plugins.PluginResolver whose Resolve
    returns PluginResolver, but *Registry.Resolve returns SourceResolver. PluginResolver.Resolve's
    return type should be SourceResolver (or the param type should change).
  - PluginsHandler.WithSourceResolver(plugins.SourceResolver) is called with the
    registry in router.go — same class of mismatch downstream.
These need a design call on what the resolver interfaces should be — left for Core-BE.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix(internal#248): correct PluginResolver.Resolve return type to SourceResolver
Some checks failed
sop-tier-check / tier-check (pull_request) Failing after 1s
Secret scan / Scan diff for credential-shaped strings (pull_request) Failing after 2s
audit-force-merge / audit (pull_request) Has been skipped
fce46904ca
The interface declared Resolve(Source) (PluginResolver, error) but
*Registry.Resolve in source.go:133 returns SourceResolver. Compile-time
assertion `var _ PluginResolver = (*Registry)(nil)` at drift_sweeper.go:82
failed → broke main.go:341 router.Setup and main.go:350 StartPluginDriftSweeper.

Doc comment at drift_sweeper.go:68-69 already stated the intended shape
(returns the production SourceResolver from source.go, not another
PluginResolver) — this aligns the type with the documented contract.

PluginsHandler.WithSourceResolver is unaffected: router.go:545-565
intentionally `_ = pluginResolver`s it out per existing comment.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fix(QA-audit): asyncio lifecycle fix in inbox wrapper tests + push-mode queue support
Some checks failed
sop-tier-check / tier-check (pull_request) Failing after 2s
Secret scan / Scan diff for credential-shaped strings (pull_request) Failing after 2s
audit-force-merge / audit (pull_request) Has been skipped
60457935b3
Issue #307 (regression):
- test_a2a_tools_inbox_wrappers.py: replace _run() helper that called
  asyncio.get_event_loop().run_until_complete() with proper
  @pytest.mark.asyncio + async def / await. The legacy pattern bypasses
  pytest-asyncio's event-loop lifecycle, causing 14 tests to pass in
  isolation but exit-1 in the full suite.

Issue #308 (test gap):
- a2a_response.py: parse() only handled delivery_mode="poll" queue
  responses. Extend the queued-envelope check to match any non-null
  delivery_mode (poll, push, or future modes), and propagate the actual
  mode string into Queued(method=, delivery_mode=) so callers can
  distinguish poll vs push delivery.
- test_a2a_response.py: add 3 push-mode fixtures
  (push_queued_full/notify/no_method) and 4 test cases covering
  classification, delivery_mode field, method sentinel, and INFO log
  output.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
core-be closed this pull request 2026-05-10 13:17:56 +00:00
Some checks failed
sop-tier-check / tier-check (pull_request) Failing after 2s
Required
Details
Secret scan / Scan diff for credential-shaped strings (pull_request) Failing after 2s
Required
Details
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
1 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#317
No description provided.