Commit Graph
5481 Commits
Author SHA1 Message Date
Shivam Mishra eb86629ece fix: auth config 2025-10-06 09:29:59 +05:30
Shivam Mishra f01460d16c fix: scrolling UI 2025-10-06 09:28:21 +05:30
Shivam Mishra a49a36785b fix: form size 2025-10-06 09:16:12 +05:30
Shivam Mishra 1ed95629e5 fix: delete binding 2025-10-06 09:13:12 +05:30
Shivam Mishra 2d705f66a1 feat: remove feature flag 2025-10-06 08:33:41 +05:30
Shivam MishraandGitHub 2c3f5e966f Merge branch 'feat/captain-product-flows' into feat/custom-tools-frontend 2025-10-06 08:28:45 +05:30
Shivam Mishra 4c6d3376ef test: handle failing ipaddr lookup 2025-10-06 08:27:19 +05:30
Shivam Mishra 3e955b450b fix: naive url validation broke template syntax 2025-10-06 08:21:52 +05:30
Pranav 910a2de087 remove undefined methods from spec 2025-10-05 16:01:08 -07:00
Pranav 99884235a4 Update the associations to have a cleaner interface 2025-10-05 12:13:23 -07:00
Shivam Mishra b02ac1b794 fix: tools 2025-10-03 20:42:22 +05:30
Shivam Mishra 21ddbde89b fix: tool name 2025-10-03 20:36:53 +05:30
Shivam Mishra cb7a16b969 fix: validation 2025-10-03 20:36:29 +05:30
Shivam Mishra 15a1a8cd5f fix: tool 2025-10-03 20:35:40 +05:30
Shivam Mishra 30e0d6b610 feat: integrate delete 2025-10-03 20:00:40 +05:30
Shivam Mishra c2b801f5d8 feat: remove params from card 2025-10-03 20:00:29 +05:30
Shivam Mishra b1328b8574 feat: allow custom i18 key 2025-10-03 20:00:03 +05:30
Shivam Mishra 3860fd01ae feat: match store name 2025-10-03 19:59:47 +05:30
Shivam Mishra ac95f2fa2f fix: scope 2025-10-03 19:59:39 +05:30
Shivam Mishra e4631e4294 feat: allow edit 2025-10-03 19:48:50 +05:30
Shivam Mishra 5b8554d216 fix: click binding 2025-10-03 19:22:56 +05:30
Shivam Mishra af528353a2 fix: escape 2025-10-03 19:21:36 +05:30
Shivam Mishra 59bfe99295 fix: timestamp 2025-10-03 19:19:38 +05:30
Shivam Mishra 6947ea7f04 feat: better tool card 2025-10-03 19:19:34 +05:30
Shivam Mishra 90d4fcf95d fix: tool class name 2025-10-03 19:09:09 +05:30
Shivam Mishra 8dfc09dc35 fix: design 2025-10-03 18:43:03 +05:30
Shivam Mishra 650685a2e0 feat: add custom tool dialog 2025-10-03 18:15:24 +05:30
Shivam Mishra 3e3d5dda80 feat: add custom tools page 2025-10-03 18:02:23 +05:30
Shivam Mishra a54ad12bf1 feat: add custom tools frontend 2025-10-03 17:37:45 +05:30
Shivam Mishra 24bbf9f16c feat: add controller for custom tools 2025-10-03 17:37:24 +05:30
Shivam MishraandGitHub a4c15f4ea7 Merge branch 'develop' into feat/captain-product-flows 2025-10-03 17:02:20 +05:30
Shivam Mishra 77676d4a2f feat: stricter liquid rendering 2025-10-03 17:02:01 +05:30
Shivam Mishra 03af966d87 feat: add some safety against DNS rebinding 2025-10-03 16:59:45 +05:30
Shivam Mishra 62fead60a8 feat: add safe endpoint validation 2025-10-03 16:56:17 +05:30
Shivam Mishra 8ceefacfac feat: add schema validation 2025-10-03 16:29:33 +05:30
Shivam Mishra 8b9b2f75fe feat: enable tool declaration with params 2025-10-03 16:26:04 +05:30
Shivam Mishra 717a9fc919 feat: add params 2025-10-03 16:23:13 +05:30
Shivam Mishra 9f583ae3b1 feat: handle custom tools in scenario via assistant 2025-10-03 16:15:14 +05:30
Shivam Mishra 15555c80bd feat: include custom flag in custom tool metadata 2025-10-03 16:14:55 +05:30
Shivam Mishra da49e60d5b feat: handle custom tools in assistant 2025-10-03 16:13:22 +05:30
Shivam Mishra 6d3e0f473a fix: feature flag name 2025-10-03 15:59:02 +05:30
Shivam Mishra ccda8a77e5 feat: integrate custom tools with Captain scenarios
Add support for custom HTTP tools in scenario tool resolution and validation:
- Extend resolved_tools to load custom tool metadata from database
- Add resolve_tool_instance method to instantiate HttpTool for custom tools
- Update validation to include account-scoped custom tools in available tools
- Support mixed static and custom tool references in scenarios
- Filter out disabled custom tools at resolution time

Test coverage includes validation, resolution, and execution paths for
custom tools with account isolation and enable/disable states.
2025-10-03 15:53:48 +05:30
Shivam Mishra 99eb27706b feat: add http tool for custom tools 2025-10-03 15:47:40 +05:30
Shivam Mishra aed90b4f00 feat: add toolable concern 2025-10-03 15:40:44 +05:30
Sivin VargheseandGitHub 0d721bc898 chore: UI improvement in auth screens (#12573)
# Pull Request Template

## Type of change

### Screenshots

**Before**
<img width="694" height="767" alt="image"
src="https://github.com/user-attachments/assets/4a92816a-c13e-4750-88fc-b05fd6d05db6"
/>

<img width="395" height="690" alt="image"
src="https://github.com/user-attachments/assets/eac0f15c-7c0f-4c20-942d-fbebdaec903e"
/>

<img width="506" height="753" alt="image"
src="https://github.com/user-attachments/assets/b14bbf5a-5e0a-4ca5-91e2-dcc93b22ac26"
/>


**After**
<img width="694" height="767" alt="image"
src="https://github.com/user-attachments/assets/6984c8af-0e98-4688-bda4-fc5ceb3227ca"
/>

<img width="411" height="682" alt="image"
src="https://github.com/user-attachments/assets/3b0f2c13-e4ea-4edc-9146-3c017d301a13"
/>
<img width="509" height="682" alt="image"
src="https://github.com/user-attachments/assets/2090d3ed-36ef-4684-8185-3a0e6b1b0c15"
/>



## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
2025-10-03 15:31:58 +05:30
Shivam Mishra ac90cb4e31 feat: add custom tool 2025-10-03 15:09:37 +05:30
Shivam Mishra ad84274245 feat: add captain custom tool feature flag 2025-10-03 15:02:53 +05:30
Chatwoot BotandGitHub c29a08f0ca chore: Update translations (#12555) 2025-10-02 18:24:12 +05:30
66cfef9298 feat: Add WhatsApp health monitoring and self-service registration completion (#12556)
Fixes
https://linear.app/chatwoot/issue/CW-5692/whatsapp-es-numbers-stuck-in-pending-due-to-premature-registration


###  Problem  
Multiple customers reported that their WhatsApp numbers remain stuck in
**Pending** in WhatsApp Manager even after successful onboarding.

- Our system triggers a **registration call**
(`/<PHONE_NUMBER_ID>/register`) as soon as the number is OTP verified.
- In many cases, Meta hasn’t finished **display name
review/provisioning**, so the call fails with:

  ```
  code: 100, error_subcode: 2388001
  error_user_title: "Cannot Create Certificate"
error_user_msg: "Your display name could not be processed. Please edit
your display name and try again."
  ```

- This leaves the number stuck in Pending, no messaging can start until
we manually retry registration.
- Some customers have reported being stuck in this state for **7+
days**.

###  Root cause  
- We only check `code_verification_status = VERIFIED` before attempting
registration.
- We **don’t wait** for display name provisioning (`name_status` /
`platform_type`) to be complete.
- As a result, registration fails prematurely and the number never
transitions out of Pending.

### Solution  

#### 1. Health Status Monitoring  
- Build a backend service to fetch **real-time health data** from Graph
API:
  - `code_verification_status`  
  - `name_status` / `display_name_status`  
  - `platform_type`  
  - `throughput.level`  
  - `messaging_limit_tier`  
  - `quality_rating`  
- Expose health data via API
(`/api/v1/accounts/:account_id/inboxes/:id/health`).
- Display this in the UI as an **Account Health tab** with clear badges
and direct links to WhatsApp Manager.

#### 2. Smarter Registration Logic  
- Update `WebhookSetupService` to include a **dual-condition check**:  
  - Register if:  
    1. Phone is **not verified**, OR  
2. Phone is **verified but provisioning incomplete** (`platform_type =
NOT_APPLICABLE`, `throughput.level = NOT_APPLICABLE`).
- Skip registration if number is already provisioned.  
- Retry registration automatically when stuck.  
- Provide a UI banner with complete registration button so customers can
retry without manual support.

### Screenshot
<img width="2292" height="1344" alt="CleanShot 2025-09-30 at 16 01
03@2x"
src="https://github.com/user-attachments/assets/1c417d2a-b11c-475e-b092-3c5671ee59a7"
/>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-10-02 11:25:48 +05:30
Sivin VargheseandGitHub 109aaa2341 fix: Display proper conversation ID with click-to-open in SLA reports (#12570) 2025-10-02 08:18:54 +05:30