Skip to content

feedback command: flag a trace from Cursor chat (no langsmith ui needed)#9

Open
Hari Harish (harisaiharish) wants to merge 1 commit into
mainfrom
hariharish/user-feedback
Open

feedback command: flag a trace from Cursor chat (no langsmith ui needed)#9
Hari Harish (harisaiharish) wants to merge 1 commit into
mainfrom
hariharish/user-feedback

Conversation

@harisaiharish

@harisaiharish Hari Harish (harisaiharish) commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

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

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>
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