Repository navigation
修复(OMP):OMP 18.2.x 下扩展加载失败(askToolRenderer 不再导出) - #347
Merged
Merged
Conversation
OMP moved its tool renderers into @oh-my-pi/pi-tui (can1357/oh-my-pi
0d6dbd32, 2026-09-17), so `pi.pi.askToolRenderer` is undefined on
18.2.x. The extension read three fields off it while building the
shadow Ask tool and threw on load:
Failed to load extension: undefined is not an object
(evaluating 'askToolRenderer.mergeCallAndResult')
With the extension gone, OMP sessions, permission cards and question
cards stop reaching CodeIsland entirely.
The renderer only decides how the shadow tool is drawn in the terminal.
Use it when OMP still exports it, and register the tool without custom
render fields when it does not. `AskTool` and `settings` are still
exported on 18.2.7, so nothing else changes.
Bump the extension to v8 so installed v7 copies are rewritten.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Owner
|
感谢!已合并(b591394)。借用原生 Ask 渲染器改成可选这个思路是对的——渲染器只管终端里怎么画,不该让整个扩展加载失败。探针核对 |
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.
关联
问题背景
OMP 在 2026-09-17 的提交 can1357/oh-my-pi@0d6dbd32(
refactor: migrated UI renderers to @oh-my-pi/pi-tui, decoupled core)里把所有工具的终端渲染器搬进了@oh-my-pi/pi-tui,@oh-my-pi/pi-coding-agent不再导出askToolRenderer。扩展在构造同名
ask工具时直接读pi.pi.askToolRenderer上的三个字段,于是在 OMP 18.2.x 上一加载就抛错:整个扩展没加载,后果不止 Ask:OMP 的会话状态、权限卡片、提问卡片全都到不了 CodeIsland。当前
main(v7 / app 1.0.33)仍然如此。在真实的 OMP 18.2.7 运行环境里用一个只读探针扩展核过
pi.pi上还剩什么:pi.pi.AskToolpi.pi.settingspi.pi.askToolRenderer运行时
import("@oh-my-pi/pi-tui/tools/ask")也试过,扩展的解析范围里找不到这个包,这条路走不通。修改内容
渲染器只决定同名
ask在终端里怎么画,不该因为它缺席就让整个扩展加载失败:askToolRenderer(旧版)→ 行为与之前完全一致;renderCall/renderResult/mergeCallAndResult,其余逻辑(原生 Ask 与 CodeIsland 竞速、答案校验、降级)一行未动。OMP extension 升级到
v8,已安装的v7会被自动覆盖;testOutdatedOmpExtensionsAreRewrittenToCurrentVersion的旧版本列表补上了v7。已知的外观差异
在 OMP 18.2.x 上,被扩展接管的
ask在终端一侧不再使用原生 Ask 的排版。按 OMP 源码(ToolExecutionComponent只在hasBuiltInTool(name)为真时才套用内置渲染器,而扩展顶替后该名字不再算内置)推断会退回通用的工具显示;这一点只读了代码,没有在交互式会话里实际看过。功能不受影响。要恢复原来的外观需要 OMP 重新向扩展开放这个渲染器,已另提 can1357/oh-my-pi#12680。
验证
bun test Tests/CodeIslandOmpExtensionTests:9 pass / 0 fail。新增两条:askToolRenderer也能加载」——在修改前的代码上以上面那句一模一样的TypeError失败,修改后通过;swift test --filter ConfigInstallerTests:67 tests,0 failures。omp命令都打印上面的Failed to load extension,修改后不再出现;omp -p,收到SessionStart→UserPromptSubmit→Stop三个事件(_source: pi),证明扩展在 18.2.7 里确实在工作。ask时终端的实际显示,以及岛上提问卡片的端到端作答。供发版时用的 CHANGELOG 文案(未改 CHANGELOG.md)
🤖 Generated with Claude Code