Repository navigation
fix(ptc): publish the allowed pool as resident when dynamic loading is off - #907
Merged
Nicholas023 merged 1 commit intoNov 13, 2026
Merged
Conversation
…s off Turning a PTC preset's dynamicTools off removed the loader and left the scope with no reachable API: the pool stayed selectable-only, so nothing could select it and nothing was published. A provider that cannot take dynamically added tools therefore lost every advanced OPS API, and ops_load_sdk with it. Publish the configured allowedTools pool plus result as resident while dynamic loading is off, so the same surface stays callable without progressive disclosure. residentTools stays authoritative: a scope that asked for no startup APIs keeps publishing none, which is the state the declaration-surface guard protects. Refs T-Auto#904
Nicholas023
force-pushed
the
fix-ptc-dynamic-tools-resident
branch
from
November 13, 2026 15:25
e2ad8ea to
fe08b34
Compare
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.
Closes #904
What was wrong
PTC 呈现下关闭某个预设的
dynamicTools(本例ops-ptc,配置dynamicTools: false+residentTools: true),该会话既不发布渐进式加载器,也没有任何常驻替代:ops_load_sdk消失,且allowedTools池里没有一个 API 可见。实测(改前):
ops_bash与ops_inspect_local_file可调用,而ops_grep、ops_glob、ops_read_files、ops_load_sdk全部undefined。故障会话session-bafe0878的tools:sdk段不含任何高级ops_*,模型只能回答「ops_load_sdk is not a function」。根因是
config.allowedTools只有一条通往可见的路径——被ops_load_sdk选中;加载器缺席时entry.selected恒空。关闭开关等于拆掉唯一通路,却没有补上替代通路,作用域落进不可达状态。最小复现:任意 PTC 预设行设
dynamicTools: false、residentTools: true,新建会话后查 SDK 名称集合。The change
dynamic === false时,把配置池allowedTools(含result)并入resident发布,而不是让它停在 selectable-only:src/publication/ptc.tstest/modes.test.mjsdynamicTools: false用例改为断言池作为常驻发布src/client/locales.tsdocs/configuration-reference.md、docs/配置参考.mdresidentTools/dynamicTools两行docs/dynamic-tool-directory.md、docs/动态工具目录.mddocs/CHANGELOG.md## [Unreleased]双语条目刻意没做的事:
test/ptc-declaration-surface.test.mjs保持通过)。residentTools失去权威性。residentTools: false+dynamicTools: false仍然不发布任何启动 API——那是 [BUG] PTC 关闭常驻与动态加载后,首轮仍声明 16 个 allowedTools 候选池(+22.5k tokens) #887 保护的状态,也是「显式要求无启动 API」的合法配置。ops_discover_tools。Validation
pull_request事件触发的CI requiredrun,URL 见下方代码块node scripts/verify-gate.mjs --skip-install的实际输出(见下)docs/CHANGELOG.md的## [Unreleased]已加中英条目package.json版本与optionalDependencies行为级红绿:只回退
src/publication/ptc.ts的exposed计算而不动测试,mode-ops-ptc dynamicTools off withdraws the loader but keeps the resident PTC surface立即变红(a loader-less scope publishes write_file as resident)。schema / 提示词字节影响:仅当
dynamicTools: false且residentTools开启时,SDK 声明集合从「仅 inspect」变为「inspect + 配置池」。这是该开关的既定目的——给不支持动态工具增删的提供商一条缓存友好路径(动态工具会让缓存命中失效)。默认配置(dynamicTools: true)的字节完全不变。跳过的 4 个套件均为非 Windows/环境相关:
linux-attributes、linux-shell、tui-host、tui-native。Environment
main的 commit:e7244444(0.5.5)npm ci --ignore-scripts+ 仓库内构建(未走 registry)