fix(delegation): emit error_detail alongside error in /delegations rows (P1 #348) #1606
Reference in New Issue
Block a user
Delete Branch "fix/a2a-error-detail-field-rename"
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
P1 #348 sub-fix. The Python poll-mode A2A consumer
(
workspace/a2a_tools_delegation.py:184) readsterminal.get("error_detail")from/workspaces/:id/delegations,but the Go listDelegations handlers in
workspace-server/internal/handlers/delegation.goemitted onlyerror. On failure poll-mode silently lost the detail and fellthrough 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
errorkeep working.error_detailfield exposed in the JSON envelope; canvas/pythonconsumers that parse strict-schema would have to opt-in, none today.
Test plan
TestListDelegations_LedgerFailedIncludesErrorDetailnow pins both keysTestListDelegations_ActivityLogsFailedEmitsBothErrorKeyscovers fallback pathgo vetclean,go build ./internal/handlers/...cleanobserve poll-mode surfaces the real error instead of "delegation failed"
Refs P1 #348, RFC #2829 PR-2 follow-up.
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.APPROVED from core-be lens. PR adds
error_detailalongsideerrorin /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-qa lens. Test coverage extends existing /delegation tests; field-rename verified via JSON shape assertion. CI green.