Kind: Function
Source: atloria-monorepo/apps/web/src/app/app/desk/components/copilotUtils.ts
The customer's question = the LAST customer message. The thread description is the first customer message (ThreadView renders it that way), so the fallback chain is: last non-internal, non-agent comment → description → title. Comments with an authorName are agent replies (same rule as the timeline).
Signature
tsfunction deriveAutoQuestion(thread: Pick<DeskThreadDetail, 'title' | 'description'> & { comments?: DeskComment[] }): string
Parameters
| Name | Type |
|---|---|
thread | `Pick<DeskThreadDetail, 'title' |
Returns: string
Was this page helpful?