updated logToolUsage to use core "devdata/log" message
This commit is contained in:
parent
6635135ec6
commit
7fd52ff6c3
4 changed files with 11 additions and 6 deletions
|
|
@ -1,9 +1,11 @@
|
|||
import { useEffect } from "react";
|
||||
import { useContext, useEffect } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
import { IdeMessengerContext } from "../../../../context/IdeMessenger";
|
||||
import { useAppDispatch, useAppSelector } from "../../../../redux/hooks";
|
||||
import { selectCurrentToolCall } from "../../../../redux/selectors/selectCurrentToolCall";
|
||||
import { cancelToolCall } from "../../../../redux/slices/sessionSlice";
|
||||
import { callCurrentTool } from "../../../../redux/thunks/callCurrentTool";
|
||||
import { logToolUsage } from "../../../../redux/util";
|
||||
import { isJetBrains } from "../../../../util";
|
||||
import { BlockSettingsTopToolbar } from "./BlockSettingsTopToolbar";
|
||||
import { EditOutcomeToolbar } from "./EditOutcomeToolbar";
|
||||
|
|
@ -50,6 +52,8 @@ export function LumpToolbar() {
|
|||
} else if ((jetbrains ? altKey : metaKey) && event.key === "Backspace") {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
logToolUsage(toolCallState, false, true, ideMessenger);
|
||||
void dispatch(
|
||||
cancelToolCall({
|
||||
toolCallId: toolCallState.toolCallId,
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ function ParallelListeners() {
|
|||
state.toolCallId!,
|
||||
);
|
||||
if (toolCallState) {
|
||||
logToolUsage(toolCallState, true, true);
|
||||
logToolUsage(toolCallState, true, true, ideMessenger);
|
||||
}
|
||||
void dispatch(exitEdit({}));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,14 +123,14 @@ export const callCurrentTool = createAsyncThunk<void, undefined, ThunkApiType>(
|
|||
|
||||
if (streamResponse) {
|
||||
if (errorMessage) {
|
||||
logToolUsage(toolCallState, false, false, output);
|
||||
logToolUsage(toolCallState, false, false, extra.ideMessenger, output);
|
||||
dispatch(
|
||||
errorToolCall({
|
||||
toolCallId,
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
logToolUsage(toolCallState, true, true, output);
|
||||
logToolUsage(toolCallState, true, true, extra.ideMessenger, output);
|
||||
dispatch(
|
||||
acceptToolCall({
|
||||
toolCallId,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ContextItem, ToolCallState } from "core";
|
||||
import { DataLogger } from "core/data/log";
|
||||
import { IIdeMessenger } from "../../context/IdeMessenger";
|
||||
import { ChatHistoryItemWithMessageId } from "../slices/sessionSlice";
|
||||
import { RootState } from "../store";
|
||||
|
||||
|
|
@ -33,9 +33,10 @@ export function logToolUsage(
|
|||
toolCallState: ToolCallState,
|
||||
accepted: boolean,
|
||||
success: boolean,
|
||||
messenger: IIdeMessenger,
|
||||
finalOutput?: ContextItem[],
|
||||
) {
|
||||
void DataLogger.getInstance().logDevData({
|
||||
messenger.post("devdata/log", {
|
||||
name: "toolUsage",
|
||||
data: {
|
||||
toolCallId: toolCallState.toolCallId,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue