Skip to content

feat: add ToolsConfig panel with individual tool toggles - #78

Closed
fallleave001 wants to merge 5 commits into
agegr:mainfrom
fallleave001:feat/tools-config-v2
Closed

fallleave001 wants to merge 5 commits into
agegr:mainfrom
fallleave001:feat/tools-config-v2

Conversation

@fallleave001

Copy link
Copy Markdown
Contributor

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

  • app/api/tools/route.ts — New API endpoint for tool enumeration + read/write activeTools in settings.json
  • components/ToolsConfig.tsx — New modal with per-tool toggles, grouped by Built-in / Extensions · System / Extensions · Project
  • components/ToolPanel.tsx — Added sourceInfo to ToolEntry type
  • lib/rpc-manager.ts — Reads activeTools from settings.json when starting a session
  • components/AppShell.tsx — Added Tools button in sidebar
  • components/ChatInput.tsx — Removed wrench-icon preset dropdown
  • components/SessionSidebar.tsx — Added Tools button
  • hooks/useAgentSession.ts — Reads saved config from /api/tools

Bug Fixes

  • "Disable all" now correctly persists: empty activeTools array is handled
    properly in API storage, backend session init, and frontend session creation.
  • Extension tools are split into "System" and "Project" groups, matching the
    SkillsConfig pattern.

Notes

Closes #67. Supersedes #39.
Rebased on upstream v0.6.16 with zero conflicts.
Adds extension System/Project grouping matching SkillsConfig.
Includes all 3 Disable-all bug fixes from previous review feedback.

… 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
cnbattle added a commit to cnbattle/pi-web that referenced this pull request Jun 23, 2026
…upstream

PR agegr#83: fix extension/package tools available in pi-web new sessions
PR agegr#80: load extension models in web model selector
PR agegr#78: add ToolsConfig panel with individual tool toggles
PR agegr#65: add scroll-to-bottom control for chat sessions
PR agegr#75: add rehype-raw plugin to render HTML tables in markdown
PR agegr#76: fix stack overflow on large session files (+TTL cache)
@agegr

agegr commented Jun 24, 2026

Copy link
Copy Markdown
Owner

当前 pi CLI 并不支持 settings.json 里的 activeTools 配置项。CLI 启动时工具选择主要来自 --tools / --exclude-tools / --no-tools 等参数,以及默认内置工具和已加载扩展工具;不会读取 ~/.pi/agent/settings.json.activeTools。

所以这个 PR 目前把工具选择写到 activeTools 后,只能被 pi-web 自己消费,不能真正和 pi CLI 共享配置。

@agegr agegr closed this Jun 24, 2026
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