fix(scheduler): #1696 — detect A2A adapter errors in 2xx response body #1698

Merged
hongming merged 1 commits from fix/1696-scheduler-adapter-error-status into main 2026-05-23 02:18:48 +00:00
Member

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

  • Add a2aErrorFromBody() helper that checks respBody for JSON-RPC 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 the adapter message.
  • Add adapterErrorProxy test double + TestFireSchedule_AdapterSDKError regression test.

Test plan

  • New regression test verifies HTTP 200 + JSON-RPC error body records last_status='error'.
  • Run go test ./workspace-server/internal/scheduler/... in CI.
## 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 - Add a2aErrorFromBody() helper that checks respBody for JSON-RPC 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 the adapter message. - Add adapterErrorProxy test double + TestFireSchedule_AdapterSDKError regression test. ## Test plan - [x] New regression test verifies HTTP 200 + JSON-RPC error body records last_status='error'. - [ ] Run go test ./workspace-server/internal/scheduler/... in CI.
agent-dev-a added 1 commit 2026-05-23 01:27:29 +00:00
fix(scheduler): #1696 — detect A2A adapter errors in 2xx response body
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Waiting to run
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 4s
CI / Python Lint & Test (pull_request) Successful in 4s
CI / Detect changes (pull_request) Successful in 8s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 7s
E2E Chat / detect-changes (pull_request) Successful in 12s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 12s
Harness Replays / detect-changes (pull_request) Successful in 8s
E2E API Smoke Test / detect-changes (pull_request) Successful in 13s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 10s
Lint no tenant GITEA or GITHUB token write / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 5s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 4s
sop-checklist / na-declarations (pull_request) N/A: (none)
qa-review / approved (pull_request) Failing after 10s
sop-checklist / review-refire (pull_request) Has been skipped
gate-check-v3 / gate-check (pull_request) Successful in 13s
sop-checklist / all-items-acked (pull_request) Successful in 9s
security-review / approved (pull_request) Failing after 10s
sop-tier-check / tier-check (pull_request) Successful in 5s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 3s
CI / Canvas (Next.js) (pull_request) Successful in 4s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2s
E2E Chat / E2E Chat (pull_request) Successful in 5s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 9s
Harness Replays / Harness Replays (pull_request) Successful in 12s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m9s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 1m23s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Successful in 5m1s
CI / all-required (pull_request) Successful in 5m50s
audit-force-merge / audit (pull_request) Successful in 14s
efc48a26f8
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>
agent-dev-b approved these changes 2026-05-23 02:07:01 +00:00
agent-dev-b left a comment
Member

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 ✓.

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 ✓.
hongming approved these changes 2026-05-23 02:18:02 +00:00
hongming left a comment
Owner

CEO-delegated 2nd approval per CTO GO (option 2). 1st approver verified above. Batch unblock 2026-05-23 02:17Z.

CEO-delegated 2nd approval per CTO GO (option 2). 1st approver verified above. Batch unblock 2026-05-23 02:17Z.
hongming merged commit b6373e7026 into main 2026-05-23 02:18:48 +00:00
Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#1698