fix(task-refactor): bug bash fixes#692
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3dee3c13ca
ℹ️ 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".
| const heldEntries = consultEntries.filter((media) => media.isHold === true); | ||
| const candidates = heldEntries.length > 0 ? heldEntries : consultEntries; |
There was a problem hiding this comment.
Stop preferring stale held consult legs
When a previous consult leg remains in interaction.media with isHold: true and the agent starts a new consult whose newer consult media is not held, this filter discards the newer leg before the recency comparison runs. In that re-consult scenario calculateConsultTimerData will keep using the stale held media and show Consult on Hold with the old timestamp even though the current consult is active; compare recency across all consult entries first, then derive hold state from the selected current leg.
Useful? React with 👍 / 👎.
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0997f74b68
ℹ️ 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".
| const agentId = currentTask?.data?.agentId; | ||
| const selfConsultState = agentId && currentTask?.data?.interaction?.participants?.[agentId]?.consultState; |
There was a problem hiding this comment.
Pass the real agent id into consult phase detection
When the SDK does not set data.consultStatus and the switch-control fallback is not in the disabled state, pending consult detection depends on reading the current participant's consultState; however currentTask.data.agentId is not populated by the task/store code (the component already receives agentId as a prop), so selfConsultState stays undefined. In that consult-requested state this falls through to active, causing filterButtonsForConsultation to hide the main transfer button that this change is trying to keep visible until the consulted party joins.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb05919b43
ℹ️ 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".
| if (nextConsultLabel === TIMER_LABEL_CONSULT_ON_HOLD) { | ||
| writeConsultHoldAnchor(interactionId, nextConsultTimestamp); |
There was a problem hiding this comment.
Refresh consult hold anchor when backend timestamp arrives
When an EP/DN consult switches to main before the SDK has populated holdTimestamp, calculateConsultTimerData now returns Consult on Hold using the Date.now()/session fallback, and this line persists that fallback. If the same consult media later receives the real holdTimestamp while isHold, mediaResourceId, and consultState stay unchanged, this effect's dependency list does not re-run, so the consult timer remains anchored to the local fallback instead of the backend event time. Include the consult media holdTimestamp as a primitive dependency or avoid persisting fallback timestamps as final anchors.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1108467a51
ℹ️ 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".
| const latestTaskData = taskWithSnapshot.state?.context?.taskData; | ||
| const snapInteraction = latestTaskData?.interaction; | ||
| const dataInteraction = currentTask.data?.interaction as InteractionWithMedia | undefined; | ||
| const participant = dataInteraction?.participants?.[agentId] ?? snapInteraction?.participants?.[agentId]; |
There was a problem hiding this comment.
Use the snapshot participant with snapshot consult data
When the initiator's state-machine snapshot is fresher than currentTask.data (the case handled by preferring snapInteraction for Agent 1), this still takes the participant from dataInteraction first. If currentTask.data still has consultState: 'consultInitiated' or lacks the new consultTimestamp while state.context.taskData already has the accepted consult, calculateConsultTimerData uses the stale participant and returns Consult Requested/timestamp 0 instead of the snapshot's active or held consult timer on switch-to-main. Pick the participant from the same interaction selected for the consult phase.
Useful? React with 👍 / 👎.
COMPLETES #< INSERT LINK TO ISSUE >
This pull request addresses
Contact Center Call Control regressions in the task-refactor build around hold state, consult timers, and conference participant list visibility during multi-party flows.
Hold & consult timer issues
Conference participant list issues
by making the following changes
Hold logic (main CAD chip + timer)
Consult leg timer (Agent 1 initiator CAD)
Conference participant list
Quality
Change Type
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging
Make sure to have followed the contributing guidelines before submitting.