Repository navigation
feat: add ToolsConfig panel with individual tool toggles - #39
Closed
fallleave001 wants to merge 1 commit into
Closed
fallleave001 wants to merge 1 commit into
fallleave001 wants to merge 1 commit into
Conversation
… 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
Owner
|
测了下有点小bug。用户点了 “Disable all” 后下一次仍会启用默认工具。 |
Contributor
Author
|
Bug 已修复。根因是三处代码都把空数组 [] 当成了"没配置",导致 Disable all → 新建会话后又启用了默认工具:
三处均已修复,测试通过。方便的话 reopen 一下,谢谢 🙏 |
This was referenced Jun 9, 2026
brynne8
added a commit
to brynne8/pi-web
that referenced
this pull request
Nov 29, 2026
Open a session that loads a skill and read the System panel: the <available_skills> block is a wall of ". pi writes the skill list into the prompt as XML and escapes it with escapeXml (pi-coding-agent dist/core/skills.js), which escapes " and ' as well, though element text asks only for &, < and >. One skill whose description lists 89 quoted trigger phrases arrives with 178 " in it, which reads as noise rather than as the prompt it is. Unfold the five entities escapeXml emits, plus &agegr#39; for the same apostrophe written numerically, before rendering. The unfold is one regex pass, not a chain of replaces: text that really contained """ reached the prompt as "&quot;" and comes back as ", not as a quote, so nothing unfolds twice. What the panel shows is the prompt as authored; the request still carries the escaped bytes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述 / Summary
新增 ToolsConfig 面板,每个工具(内置 + 扩展)可单独开关,替代旧的 Low/High/Off 预设下拉菜单。配置持久化到
settings.json的activeTools字段,pi-cli 也可共享。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.jsonunderactiveTools, shared with pi-cli.改动 / Changes
app/api/tools/route.tsactiveToolsinsettings.jsoncomponents/ToolsConfig.tsxlib/rpc-manager.tsstartRpcSessionreadsactiveToolsfromsettings.json;set_toolssupportsexactflagcomponents/AppShell.tsxcomponents/ChatInput.tsxhooks/useAgentSession.ts/api/tools, fall back to old presetscomponents/ToolPanel.tsxgetPresetFromToolsuses superset matching for extension compatibility向后兼容 / Backward Compatibility
set_tools不加exact: true时仍保留所有已注册工具(含扩展)settings.json中的activeTools字段对旧版 pi-cli 无影响(忽略未知字段)set_toolswithoutexact: truestill preserves all registered tools (including extensions)activeToolsinsettings.jsonis ignored by older pi-cli versions