fix: resolve lint findings in renderer

This commit is contained in:
Vaayne 2025-09-22 22:48:15 +08:00
parent 5d26bf15a3
commit 49e4667410
3 changed files with 8 additions and 5 deletions

View File

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

View File

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

View File

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