forked from cline/cline
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: Add telemetry tracking for task terminations and user intent classification #8835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
roomote
wants to merge
1
commit into
main
Choose a base branch
from
feat/telemetry-terminations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+132
−6
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -183,6 +183,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro | |
| const [primaryButtonText, setPrimaryButtonText] = useState<string | undefined>(undefined) | ||
| const [secondaryButtonText, setSecondaryButtonText] = useState<string | undefined>(undefined) | ||
| const [didClickCancel, setDidClickCancel] = useState(false) | ||
| const [terminationClickCount, setTerminationClickCount] = useState(0) | ||
| const virtuosoRef = useRef<VirtuosoHandle>(null) | ||
| const [expandedRows, setExpandedRows] = useState<Record<number, boolean>>({}) | ||
| const prevExpandedRowsRef = useRef<Record<number, boolean>>() | ||
|
|
@@ -412,6 +413,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro | |
| setPrimaryButtonText(t("chat:resumeTask.title")) | ||
| setSecondaryButtonText(t("chat:terminate.title")) | ||
| setDidClickCancel(false) // special case where we reset the cancel button state | ||
| setTerminationClickCount(0) // Reset termination click count when resuming | ||
| break | ||
| case "resume_completed_task": | ||
| setSendingDisabled(false) | ||
|
|
@@ -470,6 +472,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro | |
| everVisibleMessagesTsRef.current.clear() // Clear for new task | ||
| setCurrentFollowUpTs(null) // Clear follow-up answered state for new task | ||
| setIsCondensing(false) // Reset condensing state when switching tasks | ||
| setTerminationClickCount(0) // Reset termination click count for new task | ||
| // Note: sendingDisabled is not reset here as it's managed by message effects | ||
|
|
||
| // Clear any pending auto-approval timeout from previous task | ||
|
|
@@ -730,7 +733,9 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro | |
| const trimmedInput = text?.trim() | ||
|
|
||
| if (isStreaming) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding an inline comment to explain that the first cancel click is interpreted as a course correction, while subsequent clicks indicate task abandonment. |
||
| vscode.postMessage({ type: "cancelTask" }) | ||
| const newClickCount = terminationClickCount + 1 | ||
| setTerminationClickCount(newClickCount) | ||
| vscode.postMessage({ type: "cancelTask", clickCount: newClickCount }) | ||
| setDidClickCancel(true) | ||
| return | ||
| } | ||
|
|
@@ -769,7 +774,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro | |
| setClineAsk(undefined) | ||
| setEnableButtons(false) | ||
| }, | ||
| [clineAsk, startNewTask, isStreaming], | ||
| [clineAsk, startNewTask, isStreaming, terminationClickCount], | ||
| ) | ||
|
|
||
| const { info: model } = useSelectedModel(apiConfiguration) | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variables
taskHistoryandcurrentTaskItemare declared but never used in the telemetry tracking logic. These can be removed to clean up the code.