Skip to content

feat: add ToolsConfig panel with individual tool toggles#67

Open
fallleave001 wants to merge 4 commits into
agegr:mainfrom
fallleave001:feat/tools-config
Open

feat: add ToolsConfig panel with individual tool toggles#67
fallleave001 wants to merge 4 commits into
agegr:mainfrom
fallleave001:feat/tools-config

Conversation

@fallleave001

Copy link
Copy Markdown

Updates since PR #39 (closed)

  • Bug fix v1: app/api/tools/route.ts — 存 [] 时不再删 key
  • Bug fix v2: lib/rpc-manager.ts[].length > 0 改为 Array.isArray(),空数组不被过滤
  • Bug fix v3: hooks/useAgentSession.ts — 新建会话时同样处理空数组
  • 以上三层修复确保 Disable all → Save → 新建会话后工具真正全禁

Summary

Replace the old wrench-icon Low/High/Off preset dropdown with a ToolsConfig
modal panel where each tool (built-in + extension) can be individually
toggled. Config is persisted to settings.json under activeTools, shared
with pi-cli.

Changes

File Change
app/api/tools/route.ts New — tool enumeration + read/write activeTools in settings.json
components/ToolsConfig.tsx New — modal with per-tool toggles, grouped by Built-in / Extensions
lib/rpc-manager.ts startRpcSession reads activeTools from settings.json
components/AppShell.tsx Added Tools button in left sidebar
components/ChatInput.tsx Removed old wrench-icon preset dropdown
hooks/useAgentSession.ts New sessions read saved config from /api/tools

Bug Fixes

v3 includes a fix for "Disable all" not persisting: empty activeTools array
was treated as "no config" in three places (API write/read, backend session
init, frontend session creation). All three are fixed.

Note

This PR is based on 28967e6 (v0.6.12). The upstream has since added IME
composition handling in ChatInput.tsx and workspace validation in
SessionSidebar.tsx — this PR modifies both files and will need conflict
resolution during merge.

fallleave added 4 commits May 31, 2026 15:10
… settings.json

- New ToolsConfig component with per-tool toggle switches (built-in + extensions)
- New /api/tools endpoint for tool enumeration and config persistence
- Tools button in left sidebar replaces old wrench-icon preset dropdown
- Config stored in settings.json 'activeTools' field, shared with pi-cli
- startRpcSession reads saved config on session creation
- getPresetFromTools uses superset matching for extension compatibility
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.

2 participants