fix: delete hallucinated tools
This commit is contained in:
parent
9d4ea20deb
commit
2d4cf55c39
3 changed files with 1 additions and 79 deletions
|
|
@ -1,9 +1,8 @@
|
||||||
|
import { Assistant, type AssistantConfig } from "@continuedev/sdk";
|
||||||
import chalk from "chalk";
|
import chalk from "chalk";
|
||||||
import * as fs from "fs";
|
|
||||||
import { CONTINUE_ASCII_ART } from "./asciiArt.js";
|
import { CONTINUE_ASCII_ART } from "./asciiArt.js";
|
||||||
import { MCPService } from "./mcp.js";
|
import { MCPService } from "./mcp.js";
|
||||||
import { getAllTools } from "./streamChatResponse.js";
|
import { getAllTools } from "./streamChatResponse.js";
|
||||||
import { Assistant, type AssistantConfig } from "@continuedev/sdk";
|
|
||||||
|
|
||||||
export function loadSystemMessage(
|
export function loadSystemMessage(
|
||||||
assistant: AssistantConfig
|
assistant: AssistantConfig
|
||||||
|
|
|
||||||
|
|
@ -135,35 +135,6 @@ const TUIChat: React.FC<TUIChatProps> = ({
|
||||||
return `Terminal(${args.command || ""})`;
|
return `Terminal(${args.command || ""})`;
|
||||||
case "view_diff":
|
case "view_diff":
|
||||||
return `Diff(${args.path || "."})`;
|
return `Diff(${args.path || "."})`;
|
||||||
|
|
||||||
// External Claude Code Tools (PascalCase)
|
|
||||||
case "Read":
|
|
||||||
return `Read(${args.file_path || args.path || ""})`;
|
|
||||||
case "Write":
|
|
||||||
return `Write(${args.file_path || ""})`;
|
|
||||||
case "Edit":
|
|
||||||
case "MultiEdit":
|
|
||||||
return `Edit(${args.file_path || ""})`;
|
|
||||||
case "Bash":
|
|
||||||
return `Terminal(${args.command || ""})`;
|
|
||||||
case "Glob":
|
|
||||||
return `Find(${args.pattern || ""})`;
|
|
||||||
case "Grep":
|
|
||||||
return `Search(${args.pattern || ""})`;
|
|
||||||
case "LS":
|
|
||||||
return `List(${args.path || ""})`;
|
|
||||||
case "NotebookRead":
|
|
||||||
return `Notebook(${args.notebook_path || ""})`;
|
|
||||||
case "NotebookEdit":
|
|
||||||
return `Notebook(${args.notebook_path || ""})`;
|
|
||||||
case "WebFetch":
|
|
||||||
return `Web(${args.url || ""})`;
|
|
||||||
case "WebSearch":
|
|
||||||
return `Search(${args.query || ""})`;
|
|
||||||
case "TodoWrite":
|
|
||||||
return `Todo(${args.todos?.length || 0} items)`;
|
|
||||||
case "Task":
|
|
||||||
return `Task(${args.description || ""})`;
|
|
||||||
default:
|
default:
|
||||||
// Handle MCP tools or unknown tools
|
// Handle MCP tools or unknown tools
|
||||||
if (name.startsWith("mcp__")) {
|
if (name.startsWith("mcp__")) {
|
||||||
|
|
|
||||||
|
|
@ -43,54 +43,6 @@ const ToolResultSummary: React.FC<ToolResultSummaryProps> = ({
|
||||||
case "view_diff":
|
case "view_diff":
|
||||||
return `Diff output (${lines} lines)`;
|
return `Diff output (${lines} lines)`;
|
||||||
|
|
||||||
// External Claude Code Tools (PascalCase)
|
|
||||||
case "Read":
|
|
||||||
// Try to extract file path from content if it contains line numbers
|
|
||||||
if (content.includes("→")) {
|
|
||||||
const pathMatch = content.match(/^(.+?):/);
|
|
||||||
const filePath = pathMatch ? pathMatch[1] : "file";
|
|
||||||
return `Read ${filePath} (${lines} lines)`;
|
|
||||||
}
|
|
||||||
return `Read tool output (${lines} lines)`;
|
|
||||||
|
|
||||||
case "Bash":
|
|
||||||
return `Command output (${lines} lines)`;
|
|
||||||
|
|
||||||
case "Glob":
|
|
||||||
const fileCount = lines;
|
|
||||||
return `Found ${fileCount} ${fileCount === 1 ? "file" : "files"}`;
|
|
||||||
|
|
||||||
case "Grep":
|
|
||||||
return `Found ${lines} ${lines === 1 ? "match" : "matches"}`;
|
|
||||||
|
|
||||||
case "LS":
|
|
||||||
return `Listed ${lines} ${lines === 1 ? "item" : "items"}`;
|
|
||||||
|
|
||||||
case "Write":
|
|
||||||
return "File written successfully";
|
|
||||||
|
|
||||||
case "Edit":
|
|
||||||
case "MultiEdit":
|
|
||||||
return "File edited successfully";
|
|
||||||
|
|
||||||
case "NotebookRead":
|
|
||||||
return `Read notebook (${lines} lines)`;
|
|
||||||
|
|
||||||
case "NotebookEdit":
|
|
||||||
return "Notebook edited successfully";
|
|
||||||
|
|
||||||
case "WebFetch":
|
|
||||||
return `Fetched web content (${lines} lines)`;
|
|
||||||
|
|
||||||
case "WebSearch":
|
|
||||||
return `Search results (${lines} lines)`;
|
|
||||||
|
|
||||||
case "TodoWrite":
|
|
||||||
return "Todo list updated";
|
|
||||||
|
|
||||||
case "Task":
|
|
||||||
return `Task completed (${lines} lines)`;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Handle MCP tools or unknown tools
|
// Handle MCP tools or unknown tools
|
||||||
if (toolName?.startsWith("mcp__")) {
|
if (toolName?.startsWith("mcp__")) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue