Repository navigation
fix(platform): surface approval rejection ConvexError codes in all approval cards (#2009) - #2259
Conversation
…ApprovalError helper (#2009)
Desk review — #2259 (fixes #2009)Verdict: NOT READY — one blocking gap. CI is fully green and the UI test suite passes (727 chat tests + the migrated 🔴 Blocking — the human-input Submit path is left opaque (in scope of #2009)
onError: (err) => {
setError(err instanceof Error ? err.message : tCommon('errorSubmitFailed'));
},This is the exact bug #2009 describes, and the issue calls it out by name: "Human input responses are directly user-triggered (the 'Submit' button in the approval card). When the server rejects, the user sees no feedback." The mutation here ( Fix: route this Non-blocking notes (not required to merge)
NOT READY — CHANGES REQUIRED: wire the |
What
Closes #2009.
The backend approval mutations (
approvals/mutations.ts,agent_tools/human_input/mutations.ts) were already converted toConvexError({ code })for every user-facing rejection in #2172. However, only the integration approval card and the human-input card actually mapped those structured codes to actionable messages.The five remaining approval cards still did:
For a
ConvexError,err.messageis the prod-redacted opaque"Server Error"string — the structuredcodelives onerr.data. So rejecting an approval (or hittingUNAUTHENTICATED/NOT_FOUND) in these cards surfaced an opaque server error, exactly the symptom #2009 describes.Changes
mapApprovalError(previously local tointegration-approval-card.tsx) into a sharedapp/features/chat/lib/map-approval-error.ts, with its unit test moved alongside.mapApprovalError, keying off the structuredConvexErrorcode and falling back to the card's generic message for anything unrecognized:workflow-run-approval-card.tsxworkflow-update-approval-card.tsxworkflow-creation-approval-card.tsxdocument-write-approval-card.tsxknowledge-write-approval-card.tsxintegration-approval-card.tsxnow imports the shared helper.Verification
vitest(UI project): chat feature suite — 727 tests pass, including the migratedmap-approval-error.test.ts.tsc --noEmit: clean.oxlint --type-awareon all changed files: 0 warnings, 0 errors.