mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 21:42:27 +08:00
fix: resolve lint findings in renderer
This commit is contained in:
parent
5d26bf15a3
commit
49e4667410
@ -4,7 +4,7 @@ import { FileText } from 'lucide-react'
|
||||
import { ToolTitle } from './GenericTools'
|
||||
import type { WriteToolInput, WriteToolOutput } from './types'
|
||||
|
||||
export function WriteTool({ input, output }: { input: WriteToolInput; output?: WriteToolOutput }) {
|
||||
export function WriteTool({ input }: { input: WriteToolInput; output?: WriteToolOutput }) {
|
||||
return (
|
||||
<AccordionItem
|
||||
key="tool"
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Alert, Button, Spinner } from '@heroui/react'
|
||||
import { useAgent } from '@renderer/hooks/agents/useAgent'
|
||||
import { useSessions } from '@renderer/hooks/agents/useSessions'
|
||||
import { useUpdateSession } from '@renderer/hooks/agents/useUpdateSession'
|
||||
import { useRuntime } from '@renderer/hooks/useRuntime'
|
||||
import { useAppDispatch } from '@renderer/store'
|
||||
import {
|
||||
@ -27,7 +26,6 @@ const Sessions: React.FC<SessionsProps> = ({ agentId }) => {
|
||||
const { t } = useTranslation()
|
||||
const { agent } = useAgent(agentId)
|
||||
const { sessions, isLoading, error, deleteSession, createSession } = useSessions(agentId)
|
||||
const updateSession = useUpdateSession(agentId)
|
||||
const { chat } = useRuntime()
|
||||
const { activeSessionId, sessionWaiting } = chat
|
||||
const dispatch = useAppDispatch()
|
||||
@ -70,7 +68,7 @@ const Sessions: React.FC<SessionsProps> = ({ agentId }) => {
|
||||
}
|
||||
dispatch(setSessionWaitingAction({ id, value: false }))
|
||||
},
|
||||
[agentId, deleteSession, dispatch, sessions]
|
||||
[agentId, deleteSession, dispatch, sessions, t]
|
||||
)
|
||||
|
||||
const currentActiveSessionId = activeSessionId[agentId]
|
||||
|
||||
@ -108,7 +108,12 @@ export function openAIToolsToMcpTool(
|
||||
export async function callBuiltInTool(toolResponse: MCPToolResponse): Promise<MCPCallToolResponse | undefined> {
|
||||
logger.info(`[BuiltIn] Calling Built-in Tool: ${toolResponse.tool.name}`, toolResponse.tool)
|
||||
|
||||
if (toolResponse.tool.name === 'think') {
|
||||
if (
|
||||
toolResponse.tool.name === 'think' &&
|
||||
typeof toolResponse.arguments === 'object' &&
|
||||
toolResponse.arguments !== null &&
|
||||
!Array.isArray(toolResponse.arguments)
|
||||
) {
|
||||
const thought = toolResponse.arguments?.thought
|
||||
return {
|
||||
isError: false,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user