Skip to content

fix(cc-task): delegate consult transfer list policy to SDK (CAI-8354) - #736

Open
rsarika wants to merge 6 commits into
webex:nextfrom
rsarika:fix/cai-8354-missing-queue-transfer-epic-cti
Open

fix(cc-task): delegate consult transfer list policy to SDK (CAI-8354)#736
rsarika wants to merge 6 commits into
webex:nextfrom
rsarika:fix/cai-8354-missing-queue-transfer-epic-cti

Conversation

@rsarika

@rsarika rsarika commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

COMPLETES CAI-8354

This pull request addresses

The embedded Contact Center widgets showed Consult/Transfer destination lists in a different order from Agent Desktop and duplicated policy that belongs in the SDK.

Depends on SDK: webex/webex-js-sdk#5179.

Changes

  • Delegate agent, queue, and entry-point destination policy to the SDK's specialized Consult/Transfer methods.
  • Keep dial-number loading on the SDK AddressBook service.
  • Forward the active Consult or Transfer action through initial loading and reloads.
  • Pass current-task media only where queue policy requires it.
  • Preserve SDK/backend list order and pagination metadata without widget-side sorting, filtering, or reconstruction.
  • Keep only UI loading, empty-state, and error presentation behavior in widgets.
  • Add and update store, task, component, fixture, and action-forwarding tests.
  • Add the coordinated CAI-8354 feature specification.

Impact

Agents, dial numbers, queues, and entry points now use SDK defaults out of the box. Widgets no longer make reusable ordering or eligibility decisions; consumers needing supported custom behavior can pass explicit SDK options.

Validation

  • Widgets full pre-commit test suite passed.
  • Store tests: 186 passed, 3 skipped.
  • Task tests: 260 passed.
  • Consult/Transfer popover tests: 25 passed.
  • Builds and style checks passed.
  • Feature specification and implementation delta validated.

Change Type

  • Bug fix
  • Internal policy delegation
  • Documentation update

GAI Coding Policy

  • GAI was used to create a draft that was subsequently customized or modified.

@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-736.d1b38q61t1z947.amplifyapp.com

@rsarika
rsarika marked this pull request as ready for review August 19, 2026 14:42
@rsarika
rsarika requested a review from a team as a code owner August 19, 2026 14:42

@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: 6ae5a6c414

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

{CATEGORY_AGENTS}
</Button>
{allowConsultToQueue && (
{isAgentsTabVisibleFlag && (

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 Stop rendering a hidden Agents category

When accessBuddyTeam is NONE, this condition hides only the Agents button; selectedCategory still initializes to Agents, and the list body still renders buddyAgents whenever that category is selected. Consequently, opening the popover can display and allow selection of agents that the desktop profile explicitly hides. Initialize the selection to the first visible category or also gate agent loading and rendering on isAgentsTabVisibleFlag.

Useful? React with 👍 / 👎.

import {CallControlProps} from '../task.types';
import {CallControlComponent} from '@webex/cc-components';
import {isUnacceptedCampaignPreview} from '../Utils/task-util';
import {ITask} from '@webex/contact-center';

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 Import task types through the store boundary

Import ITask from @webex/cc-store rather than directly from @webex/contact-center in this widget shell and the matching CallControlCAD shell. The store already re-exports this type, and these new imports bypass the repository's required store-only SDK boundary, coupling a widget package that does not declare the SDK dependency directly to the SDK.

AGENTS.md reference: AGENTS.md:L59-L62

Useful? React with 👍 / 👎.

@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: 7395d5788d

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

consultTransferDestinations: {
consult:
overrides?.consultTransferDestinations?.consult ??
base.consultTransferDestinations.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.

P1 Badge Add destination arrays to the Jest SDK defaults

In the @webex/cc-task and @webex/cc-store unit suites, tests/setupContactCenterMock.js mocks getDefaultUIControls() with only activeLeg, main, and consult. Consequently, the many tests that call createMockTaskUIControls() reach this dereference with base.consultTransferDestinations undefined and throw before their assertions run. Update both SDK mocks to include the consult/transfer destination arrays, or make this fixture provide a safe fallback.

Useful? React with 👍 / 👎.

@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: 3cc7a18f13

ℹ️ 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 +582 to +584
const agents = await store.getBuddyAgents(action);
logger.info(`Loaded ${agents.length} buddy agents`, {module: 'helper.ts', method: 'loadBuddyAgents'});
setBuddyAgents(agents);

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 Prevent stale agent loads after action switches

When an agent opens Consult and then opens Transfer before the Consult request finishes, both requests update the same buddyAgents state without checking which action is still active. If the Consult response resolves last, the Transfer popover displays the Consult-eligible population and allows selecting an agent the SDK excluded from transfers; an earlier request failure can similarly erase the current result. Track the latest action/request and ignore stale completions, or cancel the previous request.

Useful? React with 👍 / 👎.

@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: 9e9b5ccbb0

ℹ️ 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 +1113 to +1114
...(filter ? {filter} : {}),
...(params ?? {}),

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 Preserve the task channel filter when merging parameters

When a non-telephony task is active and a direct @webex/cc-store caller supplies params.filter, spreading params after the generated filter overwrites the complete queueType/channelType/active predicate. The SDK request can therefore return queues for the wrong task channel; the same merge ordering is repeated in getEntryPoints. Combine the predicates or otherwise ensure the task-scoping filter cannot be replaced.

Useful? React with 👍 / 👎.

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