Skip to content

feat: AI Assist & Copilot#1046

Open
devi-r wants to merge 32 commits intodevelopfrom
feat/copilot-menu
Open

feat: AI Assist & Copilot#1046
devi-r wants to merge 32 commits intodevelopfrom
feat/copilot-menu

Conversation

@devi-r
Copy link
Copy Markdown
Contributor

@devi-r devi-r commented Mar 25, 2026

Description

Add Copilot AI Assist menu to chat reply box

Summary

  • Adds a sparkle button to the reply bar (between + and message input) that opens an AI-powered copilot menu
  • Copilot menu renders as an overlay above the reply box with actions: Improve reply, Change tone, Fix grammar, Suggest reply, Summarize conversation
  • "Change tone" opens a bottom sheet with 5 tone options (Professional, Friendly, Straightforward, Casual, Confident)
  • During generation: + hides, sparkle moves to leftmost, "Copilot is thinking..." replaces input, send button disabled
  • On result: generated content shown in bordered preview with discard (X) and accept (checkmark) buttons, follow-up input enabled
  • Accept inserts copilot output into reply box, discard restores original text
  • API calls hit captain/tasks/* REST endpoints (rewrite, summarize, reply_suggestion, follow_up)

Fixes: https://linear.app/chatwoot/issue/CW-3898/ai-assist
Designs : Figma

ai-assist.mp4

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have tested in both Android and iOS platform
  • My changes generate no new warnings

devi-r added 27 commits March 20, 2026 17:29
@devi-r devi-r marked this pull request as draft March 25, 2026 08:36
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 295b290014

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@devi-r devi-r marked this pull request as ready for review March 30, 2026 04:03
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 439f261c01

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6ce41c639

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@devi-r devi-r requested a review from muhsin-k March 30, 2026 06:15
@devi-r
Copy link
Copy Markdown
Contributor Author

devi-r commented Mar 30, 2026

@codex please review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa947dd291

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +136 to +139
copilotAbortRef.current?.abort();
dispatch(resetCopilot());
setIsCopilotMenuOpen(false);
}, [conversationId, dispatch, setIsCopilotMenuOpen]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Dismiss tone sheet when changing conversations

The conversation-change reset aborts requests and closes the Copilot menu, but it never dismisses toneSelectionSheetRef. If a user opens “Change tone” in conversation A, navigates to conversation B, and then taps a tone in the still-open sheet, handleToneSelected will execute Copilot in B even though the sheet was opened from A. This can trigger unintended AI rewrites in the wrong chat; dismiss the tone sheet in this reset path as well.

Useful? React with 👍 / 👎.

Comment on lines +47 to +49
state.isGenerating = false;
state.showEditor = false;
state.error = action.error.message ?? 'Failed to generate content';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Show Copilot failures instead of silently closing editor

On executeCopilotAction.rejected, the reducer hides the Copilot editor and only stores an error string in state, but this feature does not render that error anywhere. In API/network failure cases, users just see the UI revert with no feedback and cannot tell why generation failed. Either keep an inline error state visible or surface a toast/alert when this path runs.

Useful? React with 👍 / 👎.

COPILOT_ACTIONS.FRIENDLY,
];

export const CONTENT_REQUIRED_ACTIONS = [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONTENT_REQUIRED_ACTIONS is defined but never used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants