Skip to content

fix(a2a): cancel(), capabilities, push store, startup crash fix (closes #173 #174 #175 #204) - #198

Merged
HongmingWang-Rabbit merged 2 commits into
mainfrom
fix/a2a-compat-batch-173-174-175
Apr 15, 2026
Merged

fix(a2a): cancel(), capabilities, push store, startup crash fix (closes #173 #174 #175 #204)#198
HongmingWang-Rabbit merged 2 commits into
mainfrom
fix/a2a-compat-batch-173-174-175

Conversation

@HongmingWang-Rabbit

@HongmingWang-Rabbit HongmingWang-Rabbit commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Four A2A compliance and correctness fixes in one batch.

#173cancel() emits TaskStatusUpdateEvent(state=canceled, final=True)

The stub was a silent no-op. Clients waiting on a canceled task got no state update — a protocol violation. Now enqueues the correct event. Test: test_cancel_emits_canceled_event.

#174 — Advertise stateTransitionHistory=True in AgentCapabilities

Tells microsoft/agent-framework clients they can request full task history.

#175 — Wire push notification store in DefaultRequestHandler

Replaced omitted push_config_store / push_sender with:

  • push_config_store = InMemoryPushNotificationConfigStore()
  • push_sender = BasePushNotificationSender(httpx.AsyncClient(), push_config_store)

The same store instance is shared between handler and sender.

#204 — Fix PushNotificationSender abstract class crash (QA finding)

Original commit used PushNotificationSender() (ABC, has abstract send_notification). This raised TypeError: Can't instantiate abstract class on every workspace startup. Fixed by using BasePushNotificationSender (concrete).

Also adds tests/test_main_startup.py with 12 regression tests preventing re-introduction of this bug:

  • 4 source-code guards (import/instantiation/wiring/syntax)
  • 4 real SDK checks (abstract/concrete status, constructor signature, DefaultRequestHandler push_sender default)
  • 4 capability guards (stateTransitionHistory, pushNotifications, shared store, cancel not a stub)

Test plan

  • test_cancel_emits_canceled_event — PASS
  • test_main_startup.py — 12/12 PASS
  • python3 -m pytest in workspace-template/1159 passed, 0 failed
  • python3 -m pytest in sdk/python/132 passed, 0 failed

🤖 Generated with Claude Code

Backend Engineer and others added 2 commits April 15, 2026 17:58
…h store (#173 #174 #175)

#173 — implement cancel() in LangGraphA2AExecutor: emits
TaskStatusUpdateEvent(state=canceled, final=True) so clients see the
state transition rather than silence. Removes pragma: no cover.
Test: test_cancel_emits_canceled_event.

#174 — add stateTransitionHistory=True to AgentCapabilities in main.py
so microsoft/agent-framework clients know they can request full task
history via the A2A protocol.

#175 — wire InMemoryPushNotificationConfigStore and PushNotificationSender
into DefaultRequestHandler so the advertised pushNotifications capability
is backed by a real store. Both classes live in a2a.server.tasks (a2a-sdk
0.3.25); import confirmed by probe.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit 9a23180 into main Apr 15, 2026
HongmingWang-Rabbit pushed a commit that referenced this pull request Apr 15, 2026
… class)

Closes #204. PR #198 wired push_sender=PushNotificationSender() into
DefaultRequestHandler to satisfy #175's push-notification capability,
but PushNotificationSender in a2a-sdk is an abstract base class and
cannot be instantiated. Every workspace container crashed on startup
with TypeError.

Reverted to DefaultRequestHandler's defaults. The pushNotifications
capability still appears in AgentCard.capabilities (advertised to A2A
clients) but actual implementation of the sender is deferred to a
Phase-H follow-up that subclasses PushNotificationSender properly.

Existing pytest suite unchanged (the crash was only at runtime on
main.py import, which no existing test exercises directly).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit HongmingWang-Rabbit changed the title fix(a2a): A2A protocol compliance — cancel(), capabilities, push store (closes #173 #174 #175) fix(a2a): cancel(), capabilities, push store, startup crash fix (closes #173 #174 #175 #204) Apr 15, 2026
HongmingWang-Rabbit pushed a commit that referenced this pull request Apr 15, 2026
…ht sweep

Captures ~27 PRs merged across both repos this session: security
hardening cluster (#94/#99/#106/#110/#119/#162/#155/#167/#185/#200/#203/
#209/#233), data-integrity fixes (#212/#224/#236), CI runner migration
(#186), platform/scheduler reliability (#95/#149/#207/#206), workspace
runtime features (#205/#208/#198/#216/#225/#235/#231), code-review
follow-ups (#228/#232).

Updated counts: 816 Go (+70), 1180 Python (+40), 453 vitest (unchanged
— UI/a11y patches), 97 jest (unchanged).

CLAUDE.md additions:
- Idle Loop section (#205) under Architectural Patterns
- Admin auth middleware variants section linking docs/runbooks/admin-auth.md
- Migration runner section explaining the .down.sql filter (#212)
- Per-route auth notes in the API table (PATCH field-whitelist, CanvasOrBearer
  on PUT /canvas/viewport, AdminAuth on bundles/events/templates-import/
  approvals-pending/admin-liveness)
- Database section updated with workspace_auth_tokens auto-revoke (#110),
  scheduler.error_detail surfacing (#206), workspace_schedules.last_status
  'skipped' state (#207)

PLAN.md additions:
- New Recently launched (overnight sweep) section with full PR/issue index
- Phase status updated (B–G now complete, H partial)
- Live infrastructure deltas (migration fix, token rotation, legal pages)
- Outstanding items consolidated

Edit-history file expanded from the tick-9 stub to a full session record
covering malware cleanup, CI runner migration, security cluster, data
integrity, infra/feature/code-review batches, and outstanding user
actions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
…-175

fix(a2a): A2A protocol compliance — cancel(), capabilities, push store (closes #173 #174 #175)
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
… class)

Closes #204. PR #198 wired push_sender=PushNotificationSender() into
DefaultRequestHandler to satisfy #175's push-notification capability,
but PushNotificationSender in a2a-sdk is an abstract base class and
cannot be instantiated. Every workspace container crashed on startup
with TypeError.

Reverted to DefaultRequestHandler's defaults. The pushNotifications
capability still appears in AgentCard.capabilities (advertised to A2A
clients) but actual implementation of the sender is deferred to a
Phase-H follow-up that subclasses PushNotificationSender properly.

Existing pytest suite unchanged (the crash was only at runtime on
main.py import, which no existing test exercises directly).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
…ht sweep

Captures ~27 PRs merged across both repos this session: security
hardening cluster (#94/#99/#106/#110/#119/#162/#155/#167/#185/#200/#203/
#209/#233), data-integrity fixes (#212/#224/#236), CI runner migration
(#186), platform/scheduler reliability (#95/#149/#207/#206), workspace
runtime features (#205/#208/#198/#216/#225/#235/#231), code-review
follow-ups (#228/#232).

Updated counts: 816 Go (+70), 1180 Python (+40), 453 vitest (unchanged
— UI/a11y patches), 97 jest (unchanged).

CLAUDE.md additions:
- Idle Loop section (#205) under Architectural Patterns
- Admin auth middleware variants section linking docs/runbooks/admin-auth.md
- Migration runner section explaining the .down.sql filter (#212)
- Per-route auth notes in the API table (PATCH field-whitelist, CanvasOrBearer
  on PUT /canvas/viewport, AdminAuth on bundles/events/templates-import/
  approvals-pending/admin-liveness)
- Database section updated with workspace_auth_tokens auto-revoke (#110),
  scheduler.error_detail surfacing (#206), workspace_schedules.last_status
  'skipped' state (#207)

PLAN.md additions:
- New Recently launched (overnight sweep) section with full PR/issue index
- Phase status updated (B–G now complete, H partial)
- Live infrastructure deltas (migration fix, token rotation, legal pages)
- Outstanding items consolidated

Edit-history file expanded from the tick-9 stub to a full session record
covering malware cleanup, CI runner migration, security cluster, data
integrity, infra/feature/code-review batches, and outstanding user
actions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant