Skip to content

Conversation

@lefarcen
Copy link
Contributor

@lefarcen lefarcen commented Dec 19, 2025

Reverts #1872

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Removed the "list files" tool functionality from the skill engine.
  • Chores

    • Removed internal tool rendering components for file operations.
    • Updated tool visibility filtering logic.
    • Cleaned up unused tool definitions and related translations.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

Walkthrough

This pull request comprehensively removes the list_files feature from the codebase. Changes span the API layer (skill engine service), builtin tool definitions, UI renderers, service logic, translations, and system prompts. The toolset exposure logic in ToolService is also simplified by removing internal flag filtering.

Changes

Cohort / File(s) Summary
API Service & Tool Registration
apps/api/src/modules/skill/skill-engine.service.ts, apps/api/src/modules/skill/skill.service.ts
Removed listFiles method from ReflyService integration in skill engine; removed list_files from fixed builtin toolsets
Tool Service Core
apps/api/src/modules/tool/tool.service.ts
Simplified shouldExposeToolset method signature by removing internal flag option and filtering logic
Builtin Tool Definitions
packages/agent-tools/src/builtin/index.ts, packages/agent-tools/src/builtin/interface.ts, packages/agent-tools/src/inventory.ts
Removed ListFiles class, toolset definition, and related exports from builtin tools; removed listFiles from ReflyService interface; removed corresponding inventory mapping
Internal Tool Renderers
packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/default-renderer.tsx, .../list-files-renderer.tsx, .../read-file-renderer.tsx, .../index.tsx, .../index.scss, .../types.ts
Deleted entire internal tool renderer infrastructure including DefaultInternalRenderer, ListFilesRenderer, ReadFileRenderer components, types interfaces, and shimmer animation styling
Tool-Call Rendering
packages/ai-workspace-common/src/components/markdown/plugins/tool-call/render.tsx
Removed import and conditional rendering logic for InternalToolRenderer; eliminated internal-tool rendering path
Internationalization
packages/i18n/src/en-US/ui.ts, packages/i18n/src/zh-Hans/ui.ts
Removed translation keys for internalTool.readFile and internalTool.listFiles from English and Simplified Chinese locales
System Prompt
packages/skill-template/src/prompts/node-agent.ts
Removed list_files tool description from Node Agent system prompt

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • ToolService.shouldExposeToolset refactor: Verify that removal of internal flag filtering doesn't inadvertently expose system/internal toolsets elsewhere in the codebase
  • Internal renderer infrastructure removal: Ensure no other code paths reference the deleted InternalToolRenderer or internal tool renderer types
  • Cross-package consistency: Confirm all references to list_files and ListFiles have been removed from skill engine, builtin tools, inventory, and UI layers

Possibly related PRs

  • PR #1872: Directly inverse relationship—the main PR removes additions that were introduced in PR #1872 (ReflyService.listFiles, builtin list_files tool, internal tool renderers, and ToolService.shouldExposeToolset internal flag)
  • PR #1690: Also modifies builtin toolset inventory registration by removing tool entries
  • PR #1687: Modifies the same node-agent prompt file to adjust tool documentation

Suggested reviewers

  • mrcfps

Poem

🐰 A whisker-twitched cleanup, files removed with care,
No more list_files dancing through the air,
Renderers retired, prompts now lean,
The cleanest codebase ever seen! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: reverting a previous feature that added internal builtin tools with compact rendering.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-1872-feat/mashu/list-tools

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/agent-tools/src/builtin/index.ts (1)

140-151: internal: true flag has no effect due to removed filtering logic.

The internal: true flag added to BuiltinGetTimeDefinition will not prevent this tool from being exposed because the filtering logic in apps/api/src/modules/tool/tool.service.ts (line 81-84) no longer checks the internal flag.

This creates dead code where the flag is set but has no functional impact.

♻️ Duplicate comments (1)
packages/agent-tools/src/builtin/index.ts (1)

166-177: internal: true flag has no effect due to removed filtering logic.

The internal: true flag added to BuiltinExecuteCodeDefinition will not prevent this tool from being exposed because the filtering logic in apps/api/src/modules/tool/tool.service.ts (line 81-84) no longer checks the internal flag.

This creates dead code where the flag is set but has no functional impact.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27e4824 and 62ecc3d.

📒 Files selected for processing (16)
  • apps/api/src/modules/skill/skill-engine.service.ts (0 hunks)
  • apps/api/src/modules/skill/skill.service.ts (0 hunks)
  • apps/api/src/modules/tool/tool.service.ts (2 hunks)
  • packages/agent-tools/src/builtin/index.ts (2 hunks)
  • packages/agent-tools/src/builtin/interface.ts (0 hunks)
  • packages/agent-tools/src/inventory.ts (0 hunks)
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/default-renderer.tsx (0 hunks)
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/index.scss (0 hunks)
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/index.tsx (0 hunks)
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/list-files-renderer.tsx (0 hunks)
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/read-file-renderer.tsx (0 hunks)
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/types.ts (0 hunks)
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/render.tsx (0 hunks)
  • packages/i18n/src/en-US/ui.ts (0 hunks)
  • packages/i18n/src/zh-Hans/ui.ts (0 hunks)
  • packages/skill-template/src/prompts/node-agent.ts (0 hunks)
💤 Files with no reviewable changes (14)
  • packages/i18n/src/zh-Hans/ui.ts
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/index.scss
  • packages/skill-template/src/prompts/node-agent.ts
  • packages/i18n/src/en-US/ui.ts
  • apps/api/src/modules/skill/skill-engine.service.ts
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/render.tsx
  • packages/agent-tools/src/builtin/interface.ts
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/read-file-renderer.tsx
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/index.tsx
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/types.ts
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/default-renderer.tsx
  • packages/agent-tools/src/inventory.ts
  • apps/api/src/modules/skill/skill.service.ts
  • packages/ai-workspace-common/src/components/markdown/plugins/tool-call/internal-tool-renderers/list-files-renderer.tsx
🧰 Additional context used
📓 Path-based instructions (16)
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,ts,jsx,tsx}: Always use optional chaining (?.) when accessing object properties
Always use nullish coalescing (??) or default values for potentially undefined values
Always check array existence before using array methods
Always validate object properties before destructuring
Always use single quotes for string literals in JavaScript/TypeScript code

**/*.{js,ts,jsx,tsx}: Use semicolons at the end of statements
Include spaces around operators (e.g., a + b instead of a+b)
Always use curly braces for control statements
Place opening braces on the same line as their statement

**/*.{js,ts,jsx,tsx}: Group import statements in order: React/framework libraries, third-party libraries, internal modules, relative path imports, type imports, style imports
Sort imports alphabetically within each import group
Leave a blank line between import groups
Extract complex logic into custom hooks
Use functional updates for state (e.g., setCount(prev => prev + 1))
Split complex state into multiple state variables rather than single large objects
Use useReducer for complex state logic instead of multiple useState calls

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{js,ts,tsx,jsx,py,java,cpp,c,cs,rb,go,rs,php,swift,kt,scala,r,m,mm,sql}

📄 CodeRabbit inference engine (.cursor/rules/00-language-priority.mdc)

**/*.{js,ts,tsx,jsx,py,java,cpp,c,cs,rb,go,rs,php,swift,kt,scala,r,m,mm,sql}: All code comments MUST be written in English
All variable names, function names, class names, and other identifiers MUST use English words
Comments should be concise and explain 'why' rather than 'what'
Use proper grammar and punctuation in comments
Keep comments up-to-date when code changes
Document complex logic, edge cases, and important implementation details
Use clear, descriptive names that indicate purpose
Avoid abbreviations unless they are universally understood

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/00-language-priority.mdc)

Use JSDoc style comments for functions and classes in JavaScript/TypeScript

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/01-code-style.mdc)

**/*.{js,jsx,ts,tsx}: Use single quotes for string literals in TypeScript/JavaScript
Always use optional chaining (?.) when accessing object properties in TypeScript/JavaScript
Always use nullish coalescing (??) or default values for potentially undefined values in TypeScript/JavaScript
Always check array existence before using array methods in TypeScript/JavaScript
Validate object properties before destructuring in TypeScript/JavaScript
Use ES6+ features like arrow functions, destructuring, and spread operators in TypeScript/JavaScript
Avoid magic numbers and strings - use named constants in TypeScript/JavaScript
Use async/await instead of raw promises for asynchronous code in TypeScript/JavaScript

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/03-typescript-guidelines.mdc)

**/*.{ts,tsx}: Avoid using any type whenever possible - use unknown type instead with proper type guards
Always define explicit return types for functions, especially for public APIs
Prefer extending existing types over creating entirely new types
Use TypeScript utility types (Partial<T>, Pick<T, K>, Omit<T, K>, Readonly<T>, Record<K, T>) to derive new types
Use union types and intersection types to combine existing types
Always import types explicitly using the import type syntax
Group type imports separately from value imports
Minimize creating local type aliases for imported types

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{js,ts,jsx,tsx,css,json}

📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)

Maximum line length of 100 characters

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{js,ts,jsx,tsx,css,json,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)

Use 2 spaces for indentation, no tabs

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{js,ts,jsx,tsx,css,json,yml,yaml,md}

📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)

No trailing whitespace at the end of lines

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
apps/api/src/**/*.{controller,service}.ts

📄 CodeRabbit inference engine (.cursor/rules/06-api-structure.mdc)

Implement proper error handling in API modules

Files:

  • apps/api/src/modules/tool/tool.service.ts
**/*.{css,scss,sass,less,js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/09-design-system.mdc)

**/*.{css,scss,sass,less,js,jsx,ts,tsx}: Primary color (#155EEF) should be used for main brand color in buttons, links, and accents
Error color (#F04438) should be used for error states and destructive actions
Success color (#12B76A) should be used for success states and confirmations
Warning color (#F79009) should be used for warnings and important notifications
Info color (#0BA5EC) should be used for informational elements

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.cursor/rules/09-i18n-guidelines.mdc)

**/*.{tsx,ts}: Use the translation wrapper component and useTranslation hook in components
Ensure all user-facing text is translatable

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{tsx,ts,json}

📄 CodeRabbit inference engine (.cursor/rules/09-i18n-guidelines.mdc)

Support dynamic content with placeholders in translations

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{tsx,ts,jsx,js,vue,css,scss,less}

📄 CodeRabbit inference engine (.cursor/rules/11-ui-design-patterns.mdc)

**/*.{tsx,ts,jsx,js,vue,css,scss,less}: Use the primary blue (#155EEF) for main UI elements, CTAs, and active states
Use red (#F04438) only for errors, warnings, and destructive actions
Use green (#12B76A) for success states and confirmations
Use orange (#F79009) for warning states and important notifications
Use blue (#0BA5EC) for informational elements
Primary buttons should be solid with the primary color
Secondary buttons should have a border with transparent or light background
Danger buttons should use the error color
Use consistent padding, border radius, and hover states for all buttons
Follow fixed button sizes based on their importance and context
Use consistent border radius (rounded-lg) for all cards
Apply light shadows (shadow-sm) for card elevation
Maintain consistent padding inside cards (p-4 or p-6)
Use subtle borders for card separation
Ensure proper spacing between card elements
Apply consistent styling to all form inputs
Use clear visual indicators for focus, hover, and error states in form elements
Apply proper spacing between elements using 8px, 16px, 24px increments
Ensure proper alignment of elements (left, center, or right)
Use responsive layouts that work across different device sizes
Maintain a minimum contrast ratio of 4.5:1 for text

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{tsx,ts,jsx,js,vue}

📄 CodeRabbit inference engine (.cursor/rules/11-ui-design-patterns.mdc)

**/*.{tsx,ts,jsx,js,vue}: Include appropriate loading states for async actions in buttons
Group related form elements with appropriate spacing
Provide clear validation feedback for forms
Ensure proper labeling and accessibility for form elements
Ensure all interactive elements are keyboard accessible
Include appropriate ARIA attributes for complex components
Provide alternative text for images and icons
Support screen readers with semantic HTML elements

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/08-contributing-guidelines.mdc)

**/*.{ts,tsx,js,jsx}: Follow the TypeScript/JavaScript style guidelines
Ensure code is well-tested and documented

Files:

  • apps/api/src/modules/tool/tool.service.ts
  • packages/agent-tools/src/builtin/index.ts
**/index.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/05-code-organization.mdc)

Use index files to export multiple components from a directory

Files:

  • packages/agent-tools/src/builtin/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build / Build

Comment on lines +81 to 84
private shouldExposeToolset(key?: string): boolean {
if (!key) return true;
if (this.isDeprecatedToolset(key)) return false;
// Filter out internal/system-level toolsets (e.g., read_file, list_files)
if (options?.internal) return false;
return true;
return !this.isDeprecatedToolset(key);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# First, let's find the tool.service.ts file and examine the method around lines 81-84
find . -name "tool.service.ts" -type f | head -5

# Also search for shouldExposeToolset method definition
echo "=== Searching for shouldExposeToolset method definition ==="
rg -n "shouldExposeToolset" --type=ts -B 2 -A 3 | head -50

# Search for internal: true in tool definitions
echo "=== Searching for internal: true ==="
rg -n "internal:\s*true" --type=ts | head -30

# Search for isDeprecatedToolset method
echo "=== Searching for isDeprecatedToolset method ==="
rg -n "isDeprecatedToolset" --type=ts -B 2 -A 5 | head -50

Repository: refly-ai/refly

Length of output: 3883


🏁 Script executed:

#!/bin/bash

# Find the tool.service.ts file
TOOL_SERVICE=$(find . -name "tool.service.ts" -type f 2>/dev/null | head -1)

if [ -z "$TOOL_SERVICE" ]; then
  echo "tool.service.ts not found, searching for similar files..."
  find . -path "*/tool/*" -name "*.service.ts" -type f | head -10
else
  echo "Found: $TOOL_SERVICE"
  echo ""
  echo "=== Lines 75-90 of tool.service.ts ==="
  sed -n '75,90p' "$TOOL_SERVICE" | cat -n
  echo ""
  echo "=== Full shouldExposeToolset method ==="
  rg -n "shouldExposeToolset" "$TOOL_SERVICE" -A 10
fi

# Search for internal flag usage
echo ""
echo "=== Searching for internal: true in builtin tools ==="
find . -path "*/builtin/*" -name "*.ts" -type f | head -5

Repository: refly-ai/refly

Length of output: 3135


🏁 Script executed:

#!/bin/bash

# Find and examine tool.service.ts
find . -name "tool.service.ts" -type f 2>/dev/null | while read file; do
  echo "Found: $file"
  echo "=== Lines 75-95 ==="
  head -95 "$file" | tail -20 | cat -n
  
  # Look for the shouldExposeToolset method
  echo ""
  echo "=== shouldExposeToolset method ==="
  grep -n "shouldExposeToolset\|isDeprecatedToolset" "$file"
done

# Search for internal: true
echo ""
echo "=== Tools marked as internal: true ==="
find . -path "*/builtin/*" -name "*.ts" -exec grep -l "internal:\s*true" {} \;

Repository: refly-ai/refly

Length of output: 1374


🏁 Script executed:

#!/bin/bash
# Search the entire repo for tool.service.ts and examine it

find . -type f -name "tool.service.ts" 2>/dev/null | while IFS= read -r file; do
  echo "=== Found: $file ==="
  # Print lines around 81-84
  awk 'NR>=75 && NR<=90 {print NR": "$0}' "$file"
  
  echo ""
  echo "=== Method signatures for shouldExposeToolset ==="
  grep -n "shouldExposeToolset" "$file" | head -20
  
  echo ""
  echo "=== Method signatures for isDeprecatedToolset ==="
  grep -n "isDeprecatedToolset" "$file"
done

echo ""
echo "=== Checking for internal: true in tool definitions ==="
find . -type f \( -name "*.ts" -o -name "*.tsx" \) 2>/dev/null | xargs grep -l "internal:\s*true" | head -10

Repository: refly-ai/refly

Length of output: 1225


🏁 Script executed:

#!/bin/bash

# Locate tool.service.ts
echo "=== Locating tool.service.ts ==="
git ls-files "**/tool.service.ts" 2>/dev/null || find . -name "tool.service.ts" -type f 2>/dev/null

echo ""
echo "=== All usages of shouldExposeToolset ==="
git grep -n "shouldExposeToolset" 2>/dev/null || grep -rn "shouldExposeToolset" --include="*.ts" .

echo ""
echo "=== All tools marked as internal: true ==="
git grep -n "internal:\s*true" 2>/dev/null | head -20 || grep -rn "internal:\s*true" --include="*.ts" . | head -20

Repository: refly-ai/refly

Length of output: 1025


🏁 Script executed:

#!/bin/bash

echo "=== Files in apps/api/src/modules/tool/ ==="
git ls-files "apps/api/src/modules/tool/" 2>/dev/null || find apps/api/src/modules/tool -type f 2>/dev/null

echo ""
echo "=== Files in packages/agent-tools/ ==="
git ls-files "packages/agent-tools/" 2>/dev/null || find packages/agent-tools -type f 2>/dev/null | head -20

echo ""
echo "=== Searching for shouldExposeToolset ==="
git grep -n "shouldExposeToolset" 2>/dev/null || grep -rn "shouldExposeToolset" . 2>/dev/null | head -20

Repository: refly-ai/refly

Length of output: 5495


🏁 Script executed:

#!/bin/bash

# List repository structure
echo "=== Repository structure ==="
ls -la

echo ""
echo "=== Check for apps directory ==="
if [ -d "apps" ]; then
  find apps -type f -name "*.service.ts" | head -10
fi

echo ""
echo "=== Check for packages directory ==="
if [ -d "packages" ]; then
  find packages -type f -name "index.ts" | grep builtin | head -5
fi

echo ""
echo "=== Search for shouldExposeToolset anywhere ==="
find . -type f \( -name "*.ts" -o -name "*.js" \) -exec grep -l "shouldExposeToolset" {} \; 2>/dev/null | head -10

Repository: refly-ai/refly

Length of output: 2868


🏁 Script executed:

#!/bin/bash

echo "=== Examining packages/agent-tools/src/builtin/index.ts for internal: true tools ==="
grep -n -B 10 "internal:\s*true" packages/agent-tools/src/builtin/index.ts | head -80

echo ""
echo "=== Checking if internal flag is used elsewhere in the codebase ==="
grep -rn "\.internal" --include="*.ts" apps/api/src/modules/tool/ | head -20

echo ""
echo "=== Checking ToolsetDefinition interface ==="
grep -rn "interface ToolsetDefinition\|type ToolsetDefinition" --include="*.ts" | head -5

echo ""
echo "=== Search for where internal property is defined in tool definitions ==="
grep -rn "internal\s*:" --include="*.ts" packages/agent-tools/src/builtin/ | head -20

Repository: refly-ai/refly

Length of output: 1864


🏁 Script executed:

#!/bin/bash

# Get more context about the internal: true tools
echo "=== Tools with internal: true in packages/agent-tools/src/builtin/index.ts ==="
awk '/internal:\s*true/ {for(i=1;i<=20;i++) {print NR-i": "prev[NR%20]; getline; prev[NR%20]=$0} print NR": "$0}' packages/agent-tools/src/builtin/index.ts | head -100

# Better approach - just show tool definitions
echo ""
echo "=== First tool with internal: true (around line 142) ==="
sed -n '135,150p' packages/agent-tools/src/builtin/index.ts

echo ""
echo "=== Second tool with internal: true (around line 155) ==="
sed -n '148,163p' packages/agent-tools/src/builtin/index.ts

echo ""
echo "=== Third tool with internal: true (around line 168) ==="
sed -n '161,176p' packages/agent-tools/src/builtin/index.ts

# Check if internal is documented
echo ""
echo "=== Search for internal property usage in API ==="
grep -rn "internal" packages/agent-tools/src/builtin/interface.ts

Repository: refly-ai/refly

Length of output: 2706


🏁 Script executed:

#!/bin/bash

# Read the actual tools to see structure
cat packages/agent-tools/src/builtin/index.ts | head -200 | tail -100

Repository: refly-ai/refly

Length of output: 2653


🏁 Script executed:

#!/bin/bash

# Get the full structure of one tool definition with internal: true
sed -n '130,175p' packages/agent-tools/src/builtin/index.ts

echo ""
echo "=== Check if internal property is defined in ToolsetDefinition ==="
grep -A 20 "export.*ToolsetDefinition\|interface ToolsetDefinition" packages/agent-tools/src/builtin/interface.ts

echo ""
echo "=== Check if internal flag is ever read in tool.service.ts ==="
grep -n "internal" apps/api/src/modules/tool/tool.service.ts

Repository: refly-ai/refly

Length of output: 1210


🏁 Script executed:

#!/bin/bash

# Check recent commits to tool.service.ts
echo "=== Recent commits to tool.service.ts ==="
cd apps/api/src/modules/tool && git log -10 --oneline tool.service.ts

echo ""
echo "=== Git diff for shouldExposeToolset method changes ==="
cd ../../../.. && git show HEAD:apps/api/src/modules/tool/tool.service.ts 2>/dev/null | grep -A 10 "shouldExposeToolset\|private shouldExposeToolset"

echo ""
echo "=== Check git blame for the shouldExposeToolset method ==="
git blame -L81,84 apps/api/src/modules/tool/tool.service.ts

Repository: refly-ai/refly

Length of output: 2500


🏁 Script executed:

#!/bin/bash

# Find where ToolsetDefinition is defined
echo "=== ToolsetDefinition type definition ==="
grep -r "type ToolsetDefinition\|interface ToolsetDefinition" --include="*.ts" packages/ | grep -v ".gen.ts" | head -5

# Look at one of the definitions
DEFS_FILE=$(grep -r "type ToolsetDefinition\|interface ToolsetDefinition" --include="*.ts" packages/ | grep -v ".gen.ts" | cut -d: -f1 | head -1)

if [ -n "$DEFS_FILE" ]; then
  echo ""
  echo "=== $DEFS_FILE ==="
  grep -A 30 "type ToolsetDefinition\|interface ToolsetDefinition" "$DEFS_FILE" | head -35
fi

echo ""
echo "=== Check if internal property appears in generated types ==="
grep -A 30 "type ToolsetDefinition" packages/request/src/requests/types.gen.ts | head -40

Repository: refly-ai/refly

Length of output: 1413


Clean up or restore internal flag usage in builtin tools.

This is a revert of the internal toolset filtering feature. However, the three builtin tools (get_time, read_file, execute_code) remain marked with internal: true in their definitions, while the shouldExposeToolset() method no longer checks this property. The internal field is still defined in ToolsetDefinition (in the generated types) but has no runtime effect.

Either remove the internal: true flags from the tool definitions in packages/agent-tools/src/builtin/index.ts, or restore the filtering logic in shouldExposeToolset() to respect them. This prevents leaving orphaned metadata that suggests functionality that no longer exists.

🤖 Prompt for AI Agents
In apps/api/src/modules/tool/tool.service.ts around lines 81-84,
shouldExposeToolset() currently ignores the ToolsetDefinition.internal flag,
leaving builtin tools marked internal with no effect; either remove the
internal: true flags from the three builtin tool definitions in
packages/agent-tools/src/builtin/index.ts (get_time, read_file, execute_code) so
metadata matches runtime, or update shouldExposeToolset() to return false when
the toolset definition has internal === true (i.e., after the existing checks,
add a check that if key maps to a toolset with internal flag set then do not
expose it); implement one of these two fixes so metadata and runtime behavior
are consistent.

@mrcfps mrcfps merged commit 3e0d335 into main Dec 19, 2025
2 checks passed
@mrcfps mrcfps deleted the revert-1872-feat/mashu/list-tools branch December 19, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants