({ thread, text, user })
| 26 | /** |
| 27 | * `thread.runAgent` can reject (backend failure, network error, etc). Unlike |
| 28 | * `onMention` (which wraps its own call), the slash-command handlers below |
| 29 | * called it bare, so a failure only surfaced as an unhandledRejection and the |
| 30 | * user saw nothing. This wraps the call so we always log and tell the user |
| 31 | * something went wrong instead of going silent. |
| 32 | */ |
| 33 | async function runAgentSafely( |
| 34 | commandName: string, |
| 35 | thread: Pick<ChannelThread, "runAgent" | "post">, |
| 36 | input: Parameters<ChannelThread["runAgent"]>[0], |
| 37 | sourceText?: string, |
| 38 | ): Promise<void> { |
| 39 | try { |
| 40 | await thread.runAgent(input); |
nothing calls this directly
no test coverage detected