Skip to content

feat(kitchen-sink): persist conversation ids and feedback - #229

Open
gabrielelpidio wants to merge 4 commits into
mainfrom
gabriel/add-conversation-id-examples
Open

feat(kitchen-sink): persist conversation ids and feedback#229
gabrielelpidio wants to merge 4 commits into
mainfrom
gabriel/add-conversation-id-examples

Conversation

@gabrielelpidio

@gabrielelpidio gabrielelpidio commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds persistent conversation ID support to the kitchen-sink support agent example to enable multi-turn conversation correlation in traces and feedback.

Changes

  • Pass from the UI through the API to support agent spans
  • Update capability helpers to accept
  • Store on feedback links for trace correlation

Note

Medium Risk
Touches both UI state/persistence and the support-agent request/trace plumbing; regressions could break chat history, conversation selection, or feedback/trace correlation, though changes are scoped to the kitchen-sink example.

Overview
Adds persistent, multi-conversation support to the kitchen-sink support-agent console page: a sidebar ConversationList, create/select/delete flows, and localStorage-backed message history via new useConversations.

Threads conversationId end-to-end by updating useSupportChat and the support-response API to include it, and propagates it into support-agent capability spans/feedback links (plus centralizes the capability name constant). Feedback submission now uses the specific assistant message’s stored links rather than the last agent result, enabling correct per-message trace correlation across conversations.

Written by Cursor Bugbot for commit 47a2af8. This will update automatically on new commits. Configure here.

@pkg-pr-new

pkg-pr-new Bot commented Feb 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/axiomhq/ai/axiom@229

commit: 47a2af8

@gabrielelpidio
gabrielelpidio force-pushed the gabriel/add-conversation-id-examples branch from bbfa8d6 to c0dc545 Compare February 6, 2026 00:32
gabrielelpidio and others added 4 commits February 11, 2026 22:28
…LITY_NAME constant

- Add conversation persistence with localStorage via useConversations hook
- Add conversation list/selector UI component
- Pass conversationId to API and set as span attribute for telemetry
- Export CAPABILITY_NAME constant and use it across all eval files

Amp-Thread-ID: https://ampcode.com/threads/T-019c05e1-7db0-7084-a8e0-fa92e3e8d21d
Co-authored-by: Amp <amp@ampcode.com>
…aces

- Pass conversationId from frontend through API to all support agent spans
- Add gen_ai.conversation.id attribute to GenAI spans via withSpan
- Include conversationId in FeedbackLinks for trace correlation
- Update categorizeMessage and extractTicketInfo to accept conversationId
- Follows OpenTelemetry GenAI semantic conventions

Amp-Thread-ID: https://ampcode.com/threads/T-019c0b09-d2b6-71a9-8710-1361f8cfe781
Co-authored-by: Amp <amp@ampcode.com>
- Store traceId/spanId with each assistant message in localStorage
- Use per-message links for sendFeedback instead of latest result
- Add StoredMessage and FeedbackLinksData types to conversations.ts
- Enables accurate feedback for any message in conversation history

Amp-Thread-ID: https://ampcode.com/threads/T-019c0b09-d2b6-71a9-8710-1361f8cfe781
Co-authored-by: Amp <amp@ampcode.com>
@gabrielelpidio
gabrielelpidio force-pushed the gabriel/add-conversation-id-examples branch from c0dc545 to 47a2af8 Compare February 12, 2026 02:31

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

return remaining.length > 0 ? remaining[0].id : null;
}
return prev;
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale closure in deleteConversation selects deleted conversation

Medium Severity

The setCurrentId updater inside deleteConversation reads conversations from the outer closure instead of the latest state. The setConversations call above correctly uses a functional updater with prev, but the conversations variable referenced on line 124 is the stale value captured in the useCallback closure. If multiple deletions occur before a re-render, the fallback logic may select an already-deleted conversation as currentId.

Fix in Cursor Fix in Web

setMessages,
updateTitle: updateConversationTitle,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Feedback state not reset on conversation switch

Medium Severity

The feedbackGiven state (keyed by message index) is never cleared when switching conversations. After giving feedback on, say, message index 2 in one conversation, switching to another conversation will incorrectly show that same feedback indicator on its message index 2. The state needs to be reset when currentId changes.

Fix in Cursor Fix in Web

setResult(null);
setError(null);
}
}, [conversationId, getMessages]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Conversation switch doesn't reset loading state, corrupts UI

Medium Severity

When switching conversations, the useEffect resets result and error but not isLoading. If a request is in-flight for conversation A and the user switches to conversation B, the "Thinking..." indicator shows on conversation B and the input is disabled — even though B has no pending request. Worse, when A's response arrives, the stale handleSubmit closure calls setLocalMessages and setResult with A's data, overwriting B's view with the wrong conversation's messages.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

1 participant