Skip to content

feat(whatsapp): send handover note and target role on take and pass - #1683

Merged
viethung0o0 merged 4 commits into
mainfrom
feat/thread-control-metadata-target-role
Nov 10, 2026
Merged

viethung0o0 merged 4 commits into
mainfrom
feat/thread-control-metadata-target-role

Conversation

@viethung0o0

@viethung0o0 viethung0o0 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Take and pass can now carry a handover note, and pass can name the role that receives the conversation. Available from the public API, the inbox and the flow step.
  • Inbox: the Release button becomes a small menu with Release or Pass to a partner, which opens a dialog to pick the role and add a note. Take over asks for an optional note. The escalation partner can pass to any other role.
  • Messenger refuses partner roles it cannot honor instead of ignoring them.
  • Handover notes are kept out of error logs.

Test plan

  • Unit tests for the affected packages and apps, plus type check, lint and check:invariants
  • Routing chain test on a throwaway database
  • Manual check of the inbox dialogs and the flow step editor on a local build
  • Re-run the Meta partner scenarios that pass or take with a note (SC-2, SC-5, SC-6, SC-7) with a real second app

The handover note (metadata) was dropped by the channel registry for every
action and no surface could target a role, so the Meta Partner Testing Guide
steps that pass or take with a note (SC-2, SC-5, SC-6, SC-7) could not run.

- registry forwards targetRole and metadata; a release never carries a note,
  and a pass to escalation is sent as an untargeted pass
- public API, builder action and flow step accept targetRole and metadata
  with the same validation (note up to 2000 chars, no calls role)
- inbox: Pass to a partner dialog with role picker and note, Take over
  confirms with an optional note, the escalation partner may pass too
- log the Meta fbtrace_id on a rejected send and keep it on a refused take
- chain test now asserts the real thread_control request bodies
@github-actions github-actions Bot added the feature New feature or request label Nov 9, 2026
… note out of error logs

A rejected thread_control call logged the raw ky error, which keeps the request
body, so a private handover note reached the logs. Strip the body on that
endpoint only and cover it with a regression test (note absent, Meta error
body and fbtrace_id still present).

- one useCloseWhenSettled hook for the Pass and Take dialogs
- the channel registry is the single place that drops a release's note
- plain isPass const in the flow step instead of a ternary with an await
- drop a pointless useMemo and three unused exports
@viethung0o0
viethung0o0 marked this pull request as draft November 10, 2026 00:17
@viethung0o0
viethung0o0 marked this pull request as ready for review November 10, 2026 00:53
@viethung0o0
viethung0o0 merged commit 1f1c429 into main Nov 10, 2026
14 checks passed
hello-jackytruong referenced this pull request in hello-jackytruong/ChatWorkAI Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants