fix: 为 session.get() 添加MiMoCode兼容性#12
Merged
Merged
Conversation
Author
Owner
|
感谢你对本项目提交的修复!我会尽快推送更新。 |
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.


摘要
修复 opencode-visual-cache 插件在 MiMoCode TUI 中的 session.get() 兼容性问题。
问题
MiMoCode 的 TUI Plugin API 中没有 session.get() 方法,导致插件在 src/index.tsx:434 处崩溃。当前 MiMoCode 的 session API 提供 messages()、status()、goal()、cwd()、count()、diff()、todo()、task()、permission()、question() 等方法,但没有 get() 这一便利方法。
改动
对 session.get() 调用c——调用前检查方法是否存在,不存在时降级为 undefined。插件在第 438-459 行已通过 ?? 默认值优雅处理 null/undefined 的 session 值,无需额外修改。
兼容性