Commit Graph

1889 Commits

Author SHA1 Message Date
Abhinav Raut a097ca8536 fix create conversation API ignoring external_user_id for existing contacts 2026-08-11 11:36:11 +05:30
Abhinav Raut 948ffd8cda Merge pull request #478 from abhinavxd/fix-ai-agent-otp-flow
fix AI agent OTP verification flow
v2.7.0
2026-08-08 12:46:38 +05:30
Abhinav Raut b3c162381a fix AI agent OTP verification flow
The verification tools and OTP prompt block loaded for every unverified
customer, so an assistant with no account-acting tools still asked people
for an email code it had no use for. The worker now checks the assistant's
tools first and skips both unless one is flagged requires_verification. A
lookup error fails open and keeps the flow.

The send tool's result did not say which address it mailed, so the model
filled one in from chat history. After a sibling conversation rebound the
contact's email, it named the old address while the mail went to the new
one. The result now names the address and mentions the spam folder.

The prompt did not say to check every code the customer sends, so after one
rejection the model declared the next code wrong without calling the tool
and handed off to a human.
2026-08-08 12:40:04 +05:30
Abhinav Raut b228e7bb07 Merge pull request #477 from abhinavxd/fix-automation-action-combobox-type
fix agent avatars showing in non-agent automation action dropdowns
2026-08-08 11:07:23 +05:30
Abhinav Raut 071190832b fix agent avatars showing in non-agent automation action dropdowns 2026-08-08 11:04:31 +05:30
Abhinav Raut d435af7d61 Merge pull request #441 from chahat-101/network-status-banner
show connection status banner to agents
2026-08-07 23:58:12 +05:30
Abhinav Raut 2552c8ef53 restyle connection banner as floating pill and fix focus reconnect 2026-08-07 23:57:25 +05:30
Abhinav Raut 64e74300cf Merge pull request #469 from abhinavxd/new-automations
New automations
2026-08-07 23:36:52 +05:30
Abhinav Raut 4710177ca0 skip disabled agents and blank emails in notify action 2026-08-07 22:52:21 +05:30
Abhinav Raut cb96d9f087 pass all previous values when claiming an unassigned conversation 2026-08-07 22:41:19 +05:30
Abhinav Raut 057d798fd7 add missing evaluator operator and field tests 2026-08-07 22:06:23 +05:30
Abhinav Raut ca7aad6a0a snapshot previous values before reopening conversation on incoming message 2026-08-07 21:37:41 +05:30
Abhinav Raut 49f287f843 add tests for automation loop guards 2026-08-07 21:33:24 +05:30
chahat-101 b5f414471c Use warning design tokens for connection banner 2026-08-07 21:17:15 +05:30
chahat-101 d180bfbedc Merge remote-tracking branch 'upstream/main' into network-status-banner 2026-08-07 20:57:38 +05:30
Abhinav Raut e67aa28baf suppress only automation's own events, not concurrent agent updates
Automation update events now carry the actor. A suppressed conversation drops only system-user events (the engine's own in-flight actions), so an agent updating the conversation during that window is evaluated instead of silently dropped. Autoassigner events still trigger automations since they arrive outside the suppress window.
2026-08-07 20:42:06 +05:30
Abhinav Raut 9f55a73674 Merge pull request #476 from abhinavxd/macro-usage-count
count macro usage for content-only macros
2026-08-07 20:21:33 +05:30
Abhinav Raut cc3f428008 count macro usage for content-only macros
Macros with no actions never hit the apply endpoint, so their usage count
stayed at zero. The frontend now calls apply whenever a macro was picked, and
drafts store the macro id so a macro survives switching conversations.
2026-08-07 19:53:46 +05:30
Abhinav Raut 51a7b95e17 Merge pull request #474 from abhinavxd/ai-request-timeout
raise request timeout to 120s for LLM-backed AI endpoints
2026-08-06 15:43:17 +05:30
Abhinav Raut c6961da6aa raise request timeout to 120s for LLM-backed AI endpoints 2026-08-06 15:38:27 +05:30
Abhinav Raut ae0b6ee9f2 rework notify action with subject, message and picked recipients
The notify action only created a fixed in-app notification and recipients
were typed as a raw team:<id> / user:<id> DSL where typos silently notified
nobody. Now:

- recipients are picked by name (assignee, assigned team, any team or agent)
- admin writes the subject and message; both show in the bell notification
  and go out as an email (message plus conversation link, wrapped in the
  default outgoing email template, so nothing is hardcoded in English)
- the action serializes as typed fields {subject, message, recipients}
  instead of a positional value array

Also: previous_* condition fields are hidden for time triggers and populated
on message events (previous = current) so those rules can actually match,
action row widths now follow the RuleBox pattern (fixed type select, value
widgets fill the row), and three new i18n keys merged into existing globals.
2026-08-06 02:38:38 +05:30
Abhinav Raut 89b40f9dac add compact webhooks endpoint and fix previous_* automation values 2026-08-06 00:17:13 +05:30
Abhinav Raut c4270f48d3 reject non-positive webhook IDs for targeted delivery
strconv.Atoi accepts "0" and negative values, and the delivery worker treats a
non-positive WebhookID as a fan out to every subscriber of the event. So a
malformed target value sent the conversation payload to unintended webhooks.
Reject it in the action and drop it in TriggerWebhook as well.
2026-08-05 22:55:09 +05:30
Abhinav Raut aa0deedd48 fix automation rule feedback loops and scope the starts with operator
An automation rule that listens on an event and then writes the same field
re-fires its own event, so the rule matches again and loops forever. Status
already returned early on a no-op write, but priority and user assignment did
not, so those two could spin a worker doing a DB write per lap. Add the same
unchanged-value guard to both.

Suppression while the engine applies actions was a plain flag in a sync.Map,
so with more than one worker on the same conversation the first one to finish
deleted the key while the other was still applying actions. Make it a refcount
so each worker releases only its own claim.

The starts with operator is only implemented by the automation evaluator, not
the SQL filter builder, so give automation text fields their own operator list
instead of adding it to the shared one.

Also switch the notify action to its own recipients field type, fix the snooze
duration hint since the backend only takes Go duration units, trim and
lowercase notify recipient entries, and treat a missing previous value as no
match rather than an empty string.
2026-08-05 18:01:20 +05:30
Abhinav Raut fa591deb7a add i18n keys for new automation actions 2026-08-05 16:16:03 +05:30
Abhinav Raut 2aa4a1a86e Merge branch 'main' into new-automations
# Conflicts:
#	i18n/da-DK.json
#	i18n/de-DE.json
#	i18n/es-ES.json
#	i18n/fa-IR.json
#	i18n/fr-FR.json
#	i18n/it-IT.json
#	i18n/ja-JP.json
#	i18n/mr-IN.json
#	i18n/pt-BR.json
#	internal/conversation/conversation.go
2026-08-05 16:14:06 +05:30
Abhinav Raut 178136cda5 add notify, snooze and trigger webhook automation actions 2026-08-05 16:12:55 +05:30
Abhinav Raut a482f0753f Update ROADMAP.md 2026-08-05 12:28:30 +05:30
Abhinav Raut 13168b006e Update ROADMAP.md 2026-08-05 12:28:23 +05:30
Abhinav Raut 67f885d21a Merge pull request #467 from abhinavxd/pr433-imap-junk-parts
PR-433
2026-08-05 12:25:07 +05:30
Abhinav Raut 086eb4e448 skip junk email parts and name nameless attachments on IMAP ingest
Disposition-less parts with no content-id and no filename (bounce reports, pgp signatures, calendar bodies) no longer become attachments. Parts without a filename now get one from their content type instead of being saved as ".".
2026-08-05 12:06:04 +05:30
Abhinav Raut 2a3eefcd2b Merge pull request #461 from abhinavxd/add-decryp-cli
Add CLI helper for decrypting crypto payloads
2026-08-04 16:29:22 +05:30
Abhinav Raut 037956a0a9 check encryption key length 2026-08-04 16:18:35 +05:30
Abhinav Raut 8613203b64 Add CLI helper for decrypting crypto payloads 2026-08-04 14:06:40 +05:30
Abhinav Raut 22300bd800 Merge pull request #425 from abhinavxd/fix/draft-inline-cid-scope
scope draft inline image resolution to unattached media
2026-08-02 10:44:20 +05:30
Abhinav Raut 46c6f84cfc Merge remote-tracking branch 'origin/main' into fix/draft-inline-cid-scope
# Conflicts:
#	internal/media/media.go
#	internal/media/queries.sql
2026-08-02 10:27:25 +05:30
Abhinav Raut d32cb5a767 Merge pull request #460 from abhinavxd/fix/otp-verify-email-binding
bind OTP verification to the attested email so a sibling conversation can't rebind the contact to an unverified address
2026-08-02 10:25:32 +05:30
Abhinav Raut 2d8f9534cf resolve draft inline media scoped to the draft's own conversation so pasted same-conversation images keep working 2026-08-02 10:18:22 +05:30
Abhinav Raut 642b5a1942 add tests for the OTP verification email binding 2026-08-02 10:08:09 +05:30
Abhinav Raut 3f7c50c885 treat a pending OTP without an attested email as expired 2026-08-02 10:05:50 +05:30
Abhinav Raut d855a45a66 bind OTP verification to the attested email so a sibling conversation can't rebind the contact to an unverified address 2026-08-02 09:57:17 +05:30
Abhinav Raut 85ed93a03e Merge pull request #428 from Anandumv/fix/widget-contrast-color-luminance
fix(widget): gamma-correct luminance in contrastColor
2026-08-01 20:08:52 +05:30
Abhinav Raut 1d3c56b88f Merge remote-tracking branch 'origin/main' into fix/widget-contrast-color-luminance 2026-08-01 19:57:42 +05:30
Abhinav Raut 5c5611257a Merge pull request #458 from abhinavxd/fix/ai-link-loss
Fix/ai link loss
v2.6.1
2026-07-31 18:33:38 +05:30
Abhinav Raut 95b9993ea5 fall back to english for untranslated backend strings 2026-07-31 18:14:51 +05:30
Abhinav Raut 2e89586a11 send links to the LLM as markdown so drafts keep real hyperlinks
Transcripts flattened links to "text ( url )", so the model copied that shape and drafts came back with the URL in brackets instead of a link. HTML to text for the LLM now writes "[text](url)", which Markdown2HTML turns back into an anchor.
2026-07-31 18:02:22 +05:30
Abhinav Raut da378e7615 refine reply drafting instructions for clarity and precision 2026-07-31 17:33:00 +05:30
Abhinav Raut 0efd643146 move improve-draft plain-text fallback to the server 2026-07-31 17:20:05 +05:30
Abhinav Raut fa4305d880 address PR review: stricter HTML detection and fence label punctuation 2026-07-31 17:02:37 +05:30
Abhinav Raut a5a029d894 fix lossy text conversions in AI features 2026-07-31 16:36:04 +05:30