fix(scheduler): #1696 — detect A2A adapter errors in 2xx response body #1698
Reference in New Issue
Block a user
Delete Branch "fix/1696-scheduler-adapter-error-status"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes #1696. The scheduler recorded last_status='ok' when the adapter SDK threw internally but still returned HTTP 200, because fireSchedule only inspected proxyErr and statusCode. A2A JSON-RPC errors (and plain string error payloads) in the body were treated as success.
Changes
Test plan
The scheduler recorded last_status='ok' when the adapter SDK threw internally but still returned HTTP 200, because fireSchedule only inspected proxyErr and statusCode. A2A JSON-RPC errors (and plain string error payloads) in the body were treated as success. Changes: - Add a2aErrorFromBody() helper that checks respBody for JSON-RPC {"error":{"message":"..."}} and plain {"error":"..."} shapes. - In fireSchedule, when proxyErr is nil and status is 2xx, call a2aErrorFromBody; if an error message is found, set last_status to "error" and last_error to "A2A adapter error: <msg>". - Add adapterErrorProxy test double + TestFireSchedule_AdapterSDKError regression test. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>5-axis review: A2A adapter error detection in 2xx responses. Targets RFC #1696 (scheduler last_status=ok lies when SDK errors internally). Correctness ✓ (parses response body, not just HTTP code). Robustness ✓ (defensive against malformed body). Security ✓. Perf ✓. Readability ✓.
CEO-delegated 2nd approval per CTO GO (option 2). 1st approver verified above. Batch unblock 2026-05-23 02:17Z.