fix(delegation): emit error_detail alongside error in /delegations rows (P1 #348) #1606

Merged
core-devops merged 1 commits from fix/a2a-error-detail-field-rename into staging 2026-05-20 13:32:34 +00:00
Owner

Summary

P1 #348 sub-fix. The Python poll-mode A2A consumer
(workspace/a2a_tools_delegation.py:184) reads
terminal.get("error_detail") from /workspaces/:id/delegations,
but the Go listDelegations handlers in
workspace-server/internal/handlers/delegation.go emitted only
error. On failure poll-mode silently lost the detail and fell
through to the generic "delegation failed" string — leaving the
canvas "FAILED TO DELIVER" with no actionable reason.

Both ledger-path (listDelegationsFromLedger) and activity_logs-path
(listDelegationsFromActivityLogs) now emit BOTH keys.

Risk

  • Additive only. Existing canvas UI consumers reading error keep working.
  • New error_detail field exposed in the JSON envelope; canvas/python
    consumers that parse strict-schema would have to opt-in, none today.
  • No DB migration, no flag, no env change.

Test plan

  • TestListDelegations_LedgerFailedIncludesErrorDetail now pins both keys
  • new TestListDelegations_ActivityLogsFailedEmitsBothErrorKeys covers fallback path
  • go vet clean, go build ./internal/handlers/... clean
  • post-merge: stage a delegation that fails on agents-team workspace,
    observe poll-mode surfaces the real error instead of "delegation failed"

Refs P1 #348, RFC #2829 PR-2 follow-up.

## Summary P1 #348 sub-fix. The Python poll-mode A2A consumer (`workspace/a2a_tools_delegation.py:184`) reads `terminal.get("error_detail")` from `/workspaces/:id/delegations`, but the Go listDelegations handlers in `workspace-server/internal/handlers/delegation.go` emitted only `error`. On failure poll-mode silently lost the detail and fell through to the generic "delegation failed" string — leaving the canvas "FAILED TO DELIVER" with no actionable reason. Both ledger-path (`listDelegationsFromLedger`) and activity_logs-path (`listDelegationsFromActivityLogs`) now emit BOTH keys. ## Risk - Additive only. Existing canvas UI consumers reading `error` keep working. - New `error_detail` field exposed in the JSON envelope; canvas/python consumers that parse strict-schema would have to opt-in, none today. - No DB migration, no flag, no env change. ## Test plan - [x] `TestListDelegations_LedgerFailedIncludesErrorDetail` now pins both keys - [x] new `TestListDelegations_ActivityLogsFailedEmitsBothErrorKeys` covers fallback path - [x] `go vet` clean, `go build ./internal/handlers/...` clean - [ ] post-merge: stage a delegation that fails on agents-team workspace, observe poll-mode surfaces the real error instead of "delegation failed" Refs P1 #348, RFC #2829 PR-2 follow-up.
hongming added 1 commit 2026-05-20 10:25:03 +00:00
fix(delegation): emit error_detail alongside error in /delegations rows (P1 #348)
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 3s
CI / Detect changes (pull_request) Successful in 9s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 22s
E2E API Smoke Test / detect-changes (pull_request) Successful in 13s
E2E Chat / detect-changes (pull_request) Successful in 10s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 6s
Harness Replays / detect-changes (pull_request) Successful in 4s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 8s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 10s
gate-check-v3 / gate-check (pull_request) Successful in 7s
qa-review / approved (pull_request) Successful in 7s
security-review / approved (pull_request) Successful in 4s
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request) Successful in 4s
sop-tier-check / tier-check (pull_request) Successful in 5s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 59s
CI / Platform (Go) (pull_request) Successful in 6m14s
CI / Canvas (Next.js) (pull_request) Successful in 7m28s
CI / Python Lint & Test (pull_request) Successful in 7m16s
CI / all-required (pull_request) Successful in 5m56s
Harness Replays / Harness Replays (pull_request) Successful in 6s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 4s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 1m59s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 1m55s
E2E Chat / E2E Chat (pull_request) Failing after 8m15s
audit-force-merge / audit (pull_request) Successful in 3s
5d6dccfb18
The Python poll-mode A2A consumer in a2a_tools_delegation.py:184 reads
`terminal.get("error_detail")` from `/workspaces/:id/delegations` rows,
but the Go listDelegations handlers emitted only `error`. When a
delegation failed, polling silently lost the failure reason and fell
through to the generic "delegation failed" string — leaving the canvas
"FAILED TO DELIVER" surface with no actionable detail.

Both ledger-path (listDelegationsFromLedger) and activity_logs-path
(listDelegationsFromActivityLogs) now emit BOTH keys: `error_detail`
(canonical, what poll-mode reads) and `error` (kept for back-compat
with existing canvas UI consumers).

Regression tests pin both keys for both code paths.

Refs P1 #348, RFC #2829 PR-2 follow-up.
core-be approved these changes 2026-05-20 13:32:33 +00:00
core-be left a comment
Member

APPROVED from core-be lens. PR adds error_detail alongside error in /delegation responses — surface-actionable failure-reason per feedback_surface_actionable_failure_reason_to_user. Both fields populated (backwards compat via dual-emit). Small UX/observability win. CI/all-required=success.

APPROVED from core-be lens. PR adds `error_detail` alongside `error` in /delegation responses — surface-actionable failure-reason per feedback_surface_actionable_failure_reason_to_user. Both fields populated (backwards compat via dual-emit). Small UX/observability win. CI/all-required=success.
core-qa approved these changes 2026-05-20 13:32:33 +00:00
core-qa left a comment
Member

APPROVED from core-qa lens. Test coverage extends existing /delegation tests; field-rename verified via JSON shape assertion. CI green.

APPROVED from core-qa lens. Test coverage extends existing /delegation tests; field-rename verified via JSON shape assertion. CI green.
core-devops merged commit 3a1654818c into staging 2026-05-20 13:32:34 +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#1606