feedback command: flag a trace from Cursor chat (no langsmith ui needed)#9
Open
Hari Harish (harisaiharish) wants to merge 1 commit into
Open
feedback command: flag a trace from Cursor chat (no langsmith ui needed)#9Hari Harish (harisaiharish) wants to merge 1 commit into
Hari Harish (harisaiharish) wants to merge 1 commit into
Conversation
Add an in-chat /langsmith (alias /ls) command that attaches LangSmith
feedback to the turn the user just saw — no LangSmith UI needed:
/langsmith good [comment] 👍 score 1
/langsmith bad [comment] 👎 score 0
/langsmith flag [comment] 🚩 bookmark (value "flagged")
/langsmith <free text> 📝 comment-only note
/langsmith usage help
beforeSubmitPrompt intercepts the command, posts feedback via
Client.createFeedback (key user_feedback), and cancels the submission
with {"continue":false,"user_message":...} so it never reaches the
agent. All feedback shares one key so an ingestion engine can filter
by score/comment.
Feedback targets the last finalized turn: buildTurnRuns now returns
{runId, traceId} and stop persists it as ConversationState.last_trace
via the new reduceRecordLastTrace reducer. Replica-only configs are
supported (one Client per WriteReplica with an apiKey).
New src/feedback.ts (pure parser, fully unit-tested). 66 tests green,
build + lint clean. README documents the command.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ca920d3 to
e6b2cc6
Compare
1cf56c9 to
496247a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an in-chat /langsmith (alias /ls) command that attaches LangSmith feedback to the turn the user just saw:
/langsmith good [comment] → score 1
/langsmith bad [comment] → score 0
/langsmith flag [comment] → bookmark (value "flagged")
/langsmith [comment] → comment-only note
/langsmith → usage help
all feedback shares one key so an ingestion engine can filter by score/comment.
feedback targets the last finalized turn.
current drawback: cursor's misleading (dismissible) fake-failure dialog cannot be prevented