Skip to content

feat: follow-up suggestions + bump capabilitiesVersion to 66 - #17

Merged
chintandesai-cimulate merged 5 commits into
mainfrom
follow-up-suggestions-refresh
Oct 14, 2026
Merged

chintandesai-cimulate merged 5 commits into
mainfrom
follow-up-suggestions-refresh

Conversation

@shilpi1998

@shilpi1998 shilpi1998 commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Follow-up suggestions from agent responses: Extracts display_text from suggestions blocks in the BYON response envelope (extractMessageSuggestions in tokens.ts) and populates followUpSuggestions in widget state on every SET_ANSWER.
  • Conversational pill flow: PDP pills show on widget load. After the shopper asks a question, only follow-up suggestions from the SCRT2 response are shown — no PDP backfill, no refresh button.
  • Lifecycle: followUpSuggestions clears on ASK_QUESTION (so stale suggestions don't linger) and RESET_CONVERSATION (SPA navigation between PDPs).
  • Default capabilitiesVersion bumped from "65" to "66": Version 65 drops all context variables; 66 is the minimum that supports StructuredValue, which commerce_agent_context requires for the PDP context payload.
  • No existing behavior changed: parsePdpQuestions cap preserved, all pre-existing reducer actions unchanged.

Files changed

File What
src/tokens.ts extractMessageSuggestions() + collectSuggestions() helper
src/provider/types.ts followUpSuggestions state field
src/provider/reducer.ts Populate follow-ups on SET_ANSWER, clear on ASK_QUESTION and RESET_CONVERSATION
src/components/QuestionPills.tsx PDP pills before first question, follow-ups after
src/sdk/client.ts Default capabilitiesVersion → "66" (was "65")
tests/tokens.test.ts 8 tests for extractMessageSuggestions
tests/provider/reducer.test.ts Tests for followUpSuggestions lifecycle
tests/sdk/client.test.ts Updated expected capabilitiesVersion to "66"

Test plan

  • npx tsc --noEmit — clean
  • npx vitest run — 209 tests pass
  • Manual: load widget with PDP questions, verify pills show on mount
  • Manual: ask a question, verify only follow-up suggestions from the agent response appear
  • Manual: verify no pills appear if the agent returns no suggestions
  • Manual: ask another question, verify stale follow-ups clear while the new answer loads
  • Manual: navigate to a different PDP, verify PDP pills re-appear for the new product
  • Manual: verify context variables are not dropped (capabilitiesVersion 66)

Extract follow-up suggestions from the BYON response envelope's
`suggestions` blocks and render them as pills below the answer.
Follow-ups fill the shelf first; remaining slots backfill with
unused PDP pills up to MAX_PDP_QUESTIONS. A circular refresh button
lets the shopper rotate to different questions when available.
…ust, trim comments

- Revert parsePdpQuestions cap removal (keep at MAX_PDP_QUESTIONS)
- Restore extractMessageSuggestions cap
- Refresh icon only appears after a question is asked and pool > 5
- Cycling: empty currentlyVisible resets dismissedQuestions
- Shorten all new comments to max 2 lines
…w-ups after a question

PDP pills show on widget load; after a question is asked, only follow-up
suggestions from the agent response are shown. Removed: RefreshIcon,
.pill-refresh CSS, REFRESH_PILLS action, dismissedQuestions state, and
all related tests.
Version 65 drops all context variables; 66 is the minimum that
supports StructuredValue, which commerce_agent_context requires.
@shilpi1998 shilpi1998 changed the title feat: follow-up suggestions + refresh pill button feat: follow-up suggestions + bump capabilitiesVersion to 66 Oct 14, 2026
@chintandesai-cimulate
chintandesai-cimulate merged commit 5465048 into main Oct 14, 2026
1 check passed
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