Skip to content

feat(cc-widgets): wire AI summary workflows - #750

Open
rsarika wants to merge 37 commits into
webex:nextfrom
rsarika:codex/ai-summary-widget-integration
Open

rsarika wants to merge 37 commits into
webex:nextfrom
rsarika:codex/ai-summary-widget-integration

Conversation

@rsarika

@rsarika rsarika commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Connects consult/transfer, receiving-agent and post-call summary views to the merged SDK-backed store. Includes #749 through c35ee005, including the missing-content fallback, callback cleanup, and panel style consolidation. Review cleanup uses the existing CallControl utilities for wrap-up completion, shares destination mappings and empty-state text, and uses useEffect for the popover layout latch. Summary controls and text use Momentum, interaction logic lives in local helper.ts, and receiver summary handling uses early returns.

Widget adapters read store.cc.aiSummaries, pass raw SDK content unchanged, and supply local edited values separately. Edits, copy counts and deferred feedback update the SDK response record inside runInAction; callbacks reject stale task/content identities. Unchanged edits do not modify the response, and reverting a structured edit removes its override. Receiver feedback uses the displayed SDK payload when calling the store.

Consult/transfer sends the initiator response as the operation starts. Wrap-up awaits its summary response before calling the original Task's wrap-up operation. Direct MobX dependencies are declared for the adapters.

The branch includes #749's store declaration-build fix. It also removes obsolete onAISummaryStatusChange plumbing and AISummaryStatusDetail re-exports that referenced APIs removed from the merged store. The React sample and contract/module docs match the current API. The consult/transfer test mock returns the current store submission result. Existing CallControl Web Component callbacks, observed attributes and container-prop filtering remain covered by integration tests.

@webex/cc-store is upgraded to @webex/contact-center@3.12.0-next.158 from the next release track, which provides the summary APIs missing from stable 3.12.0. Only the store declares the SDK directly. The React sample infers its station-logout response type from the store API and no longer has a separate SDK dependency. The lockfile, shared profile team fixture and module docs match the new SDK, and an obsolete team-type error suppression is removed.

Fixes the consult view remaining on “Getting summary” after the SDK reports success. Registration now makes the widget-owned cc.aiSummaries map observable.ref; replacing the map notifies summary observers on request start, completion, failure and local response changes. SDK instances and summary payloads retain their original identities, and registering the same SDK instance again preserves existing summaries. Store/task specs and contracts describe this reactive update path.

Corrects the overlapping summary text shown in the consult screen. The #749 component update applies automatic height to the Momentum button host and wraps its button-text part, so paragraphs and bullet lists reserve their full height. The shared correction also applies to post-call summaries, including narrow layouts and disabled previews.

Empty or whitespace-only structured fields now render no label or row in consult/transfer and post-call summaries. A focused editor stays mounted when cleared, and its blank row disappears after editing ends. Raw SDK values and cleared local response keys are preserved; clipboard formatting already omits blank sections.

Dependencies

#748 is merged; #749 must merge before this PR. Review the widget integration layer.

Verification

Under Node 24.17.0 and Yarn 4.5.1, on the merged tree:

  • yarn run build passed across all included workspaces with generated store declarations.
  • Affected-package unit tests passed: 1,077 component tests, 335 task tests, 73 AI Assistant tests, and 2 Web Component tests. Total: 77 suites, 1,487 tests, and 234 snapshots; 4 existing component tests remain skipped.
  • Style checks passed for @webex/cc-components, @webex/cc-task, @webex/cc-ai-assistant, and @webex/cc-widgets.
  • yarn workspace samples-cc-react-app exec tsc --noEmit passed.
  • Review cleanup passed all 1,150 affected-package tests and 234 snapshots, both package style checks and source builds, plus the full repository unit and style checks in the commit hook.
  • Full repository unit-test and style checks passed after the SDK upgrade, removal of the sample dependency and summary reactivity fix.
  • Four real-MobX store regressions cover mid-call/post-call completion, request failure and repeated registration. Three failed before the observability fix; all four pass with it, without another task event.
  • Browser inspection with the actual summary component, installed Momentum package and panel styles confirmed the overlap before the fix and correct section heights afterward. Consult/post-call layouts, narrow widths, long text, disabled previews and keyboard editing/focus were checked with synthetic props.
  • Local browser inspection with synthetic empty and whitespace-only fields confirmed those labels are hidden in both editable summary modes. Populating an optional field shows it again; clearing a focused editor keeps it mounted until blur and then removes the empty row with keyboard focus moving to the next control.
  • git diff --check passed.

@rsarika
rsarika requested a review from a team as a code owner October 9, 2026 05:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T04:56:09.309983Z db0855f New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: 57dfea3335

ℹ️ 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".

'on-recording-toggle',
'conference-enabled',
]);
expectObservedAttributes(AI_ASSISTANT_TAG, [

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve wellness attributes in the AI Assistant expectation

In the cc-widgets Jest/jsdom suite, WebAIAssistant still declares seven wellness props in src/wc.ts (onWellnessBreakOffered through wellnessBreakOverlayTarget), and r2wc includes each declared prop in observedAttributes. This newly added exact-equality assertion omits all of them, so the cc-widgets unit suite has a guaranteed failure; include the existing dashed wellness attributes or avoid asserting the unrelated element here.

Useful? React with 👍 / 👎.

Use SDK summary types directly and send only changed structured sections. Guard superseded request results, pair task listener cleanup, and require the original task for post-call submission. Repair the lockfile for immutable installs.
@aws-amplify-us-east-2

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-750.d1b38q61t1z947.amplifyapp.com

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@rsarika rsarika added the validated Indicates that the PR is ready for actions label Oct 20, 2026
not at all.

**Where it appears**
- `packages/contact-center/store/src/storeEventsWrapper.ts` (dozens of setters and event handlers wrap writes in `runInAction`) , `packages/contact-center/task/src/helper.ts` , `packages/contact-center/user-state/src/helper.ts`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please check if this update is correct

Comment thread ai-docs/GETTING_STARTED.md Outdated
```
A fresh clone (or a new git worktree) has no `node_modules`; `yarn install` followed by `yarn build:dev` must complete before any per-package test or cross-package import will resolve.

The store's `build:src` bundles JavaScript, then runs `build:types` to type-check and

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This update in spec doesn't seem to have anything to do with AI Assistant Summary so check if this update is useful here

__esModule: true,
default: {
cc: {
aiSummaries: {},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe it should be kept inside apiAIAssistant object

"@webex/cc-store": "workspace:*",
"@webex/cc-ui-logging": "workspace:*",
"lottie-web": "5.13.0",
"mobx": "6.13.5",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need to add this package here ? It is already globally present

}
const branchKey = `mid-call:receiver:${interactionId}`;
const content = entry.content;
if (content?.areTranscriptsAvailable === false) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is this condition and can you please elaborate on what does this property stand for: areTranscriptsAvailable

document.fonts?.removeEventListener('loadingdone', resize);
};
}, [value]);
return <textarea {...props} ref={ref} rows={1} value={value} />;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please check if there is an equivalent momentum component

onMouseEnter={() => handleActionMouseEnter('copy')}
onMouseLeave={() => handleActionMouseLeave('copy')}
>
<button

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use momentum component and there are other places also where I see this, fix this eveyrwhere

}
};

const handleCopy = async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have existing methods already present for like, dislike and copy controls. I believe we should have a common handling to use these feedback actions for every ai-assistant feature. Seems lot of redundancy there to keep defining new handlers everytime

Please check these methods: toggleActionControls and copySuggestion

onRetry?: never;
};

export type AISummaryMidCallReceiverProps = AISummaryBaseProps & {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is definitely scope of optimizations for these types. mode, onEdit, onRetry, getReceiverCopyText these seem to be repeating in every type and they are optional anyway. Also types should not have strict assigned string values like how we have done for mode. Value assignment should happen at the code level. Also why we have never fields in the type

@github-actions github-actions Bot removed the validated Indicates that the PR is ready for actions label Oct 20, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

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

Copy link
Copy Markdown

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: d0ed20e6ce

ℹ️ 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 +257 to +258
if (button.menuType !== 'Keypad' && isTelephony) {
void aiSummary?.requestMidCallSummary?.(action === 'Transfer' ? 'TRANSFER' : 'CONSULT');

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 Request enabled digital mid-call summaries

When midCallEnabled is set on a chat, email, or social task, this isTelephony guard skips the only call to requestMidCallSummary. getAISummaryProps still creates a generating mid-call view for every SDK-enabled media type, and that view is passed into ConsultTransferPopoverComponent, so opening Consult or Transfer on those tasks leaves the summary spinner permanently pending. Invoke the callback for every enabled view, or omit the view for media that are intentionally unsupported.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@Kesari3008 Kesari3008 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As discussed over call, please check the remaining comments

{renderLauncherButton()}
</div>
) : (
renderLauncherButton()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

canViewReceiverSummary() is not needed here and we can remove the method renderLauncherButton().

renderReceiverSummaryTrigger()} renderLauncherButton()

canViewReceiverSummary() is present inside renderReceiverSummaryTrigger so that should take care of it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment is still not addressed

</div>
) : null}
{summary.surface === 'content' && receiverActionsVisible ? (
<AISummary

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Inside AISummary component, we can have conditions based on these props to control what's going o render


// Keep keyed, controlled edits inside one visual surface. Never parse edited labels
// back into SDK keys or introduce a second scrollbar inside the containing panel.
const SummaryEditor: React.FC<AISummaryEditorProps> = ({value, onChange, ...props}) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Evaluate if different components created here along with render methods are really needed and if we have a way to optimize them and also try to name them more accurately


useLayoutEffect(restoreFocus);

const handleFocusCapture = (event: FocusEvent<HTMLDivElement>) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What are these handlers needed for and I have noticed similar handler in some other file so please check and also we have existing methods: copySuggestion and toggleActionsControls for handling the copy button clikc, thumbs up and thumbs down. Try to have a common implementation for ahndling these buttons for different AI Assistant features

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@rsarika
rsarika force-pushed the codex/ai-summary-widget-integration branch from b960d5f to 03f49a5 Compare October 20, 2026 10:10
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@rsarika
rsarika force-pushed the codex/ai-summary-widget-integration branch from 03f49a5 to ab897d9 Compare October 20, 2026 11:00
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@rsarika
rsarika force-pushed the codex/ai-summary-widget-integration branch from ab897d9 to c18c8e9 Compare October 20, 2026 12:00
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@rsarika
rsarika force-pushed the codex/ai-summary-widget-integration branch from c18c8e9 to f47d8bd Compare October 20, 2026 13:08
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@rsarika
rsarika force-pushed the codex/ai-summary-widget-integration branch from f47d8bd to f2eef6e Compare October 20, 2026 13:49
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@rsarika
rsarika force-pushed the codex/ai-summary-widget-integration branch from f2eef6e to 0849d99 Compare October 20, 2026 14:38
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@rsarika
rsarika force-pushed the codex/ai-summary-widget-integration branch from 0849d99 to 321bd0c Compare October 21, 2026 14:06
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

Reuse adaptive summary cards and shared copy and feedback actions. Match Momentum consult, transfer, and wrap-up interactions, preserve staged selections and summary exclusion, and synchronize SDK response handling, regression tests, and module contracts.
@rsarika
rsarika force-pushed the codex/ai-summary-widget-integration branch from 321bd0c to db0855f Compare October 22, 2026 04:47

@Kesari3008 Kesari3008 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please test thoroughly not just summary feature but also suggested responses and consult and transfer flows because there are too many changes on the existing code impacting existing features and make a vidcast of that

{renderLauncherButton()}
</div>
) : (
renderLauncherButton()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment is still not addressed

method: 'copySuggestion',
method: 'copyToClipboard',
});
return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please test these changes for Suggested Responses as well because it gets used there too

// Stash callbacks in refs so the render effect only re-runs when the card
// itself changes — fresh inline parent callbacks would otherwise force a
// full re-parse and re-fetch of every image on each render.
const onUserActionRef = useRef(onUserAction);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This code is related to suggested responses also and these changes might impact the existing feature to break. So either test the feature and ensure nothing breaks or verify these changes

{AI_ASSISTANT_SUMMARY_MESSAGES.editSummary}
</Button>
) : null}
{showCopy ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would there ever be a scenario where copy option is not there so evaluate if we really need this condition

This branch has not been deployed

No deployments
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