opencode-native panics on session ID after a multibyte character
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 79/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- rust
- 领域
- cli, testing-qa
调研方向
从 crates/tui/src/features/session_links.rs 中的 mentions() 开始,尤其检查第 241 行附近的前缀检查,然后运行 issue 中的最小复现程序。查看相邻的会话链接解析测试,并添加会话 ID 前有一个多字节字符的测试覆盖;完成标准是该输入不再触发 panic,且会话 ID 得到正确处理。
由索引模型根据 Issue 内容生成。
描述
Description
opencode-native (Rust client on the oc-rust branch) panics while rendering a session message that contains a session ID after a multibyte character:
panicked at crates/tui/src/features/session_links.rs:241:37:
start byte index 83 is not a char boundary; it is inside '现' (bytes 82..85 of string)
mentions() checks the optional @session: prefix by slicing text[at - PREFIX.len()..at]. When no prefix is present, that byte offset can land inside a multibyte character. The TypeScript reference uses a regex and does not crash.
Plugins
None relevant; the JS host was off.
OpenCode version
Local cli-rs build from origin/oc-rust (d1df62cd7b), reported as opencode-native vlocal; server 2.2.0.
Steps to reproduce
- Build with
bun run --cwd packages/cli-rs cargo build --release --bin opencode-native. - Open a session whose Markdown contains a session ID after a multibyte character, e.g.
现abcd文ses_knownknownknownknownknownk. - The TUI panics in the session-links inline hook during
set_markdown.
Minimal unit reproducer: mentions("现abcd文ses_knownknownknownknownknownk").
Screenshot
Not applicable; terminal panic and the log entry are described above.
Operating System
macOS arm64
Terminal
Ghostty
- 主要语言
- TypeScript
- 星标
- 227k
- 派生
- 30.7k
- 平均合并
- 4 小时 35 分钟
- 30 天内合并 PR
- 498
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
area/cli platform/windows type/bug version/v2
难度 2/5 1-3 小时 新手友好度 70/100
anomalyco/opencode#64631 · 1 条评论 ·
维护者通常 1 天内回复
-
area/desktop platform/windows type/feature version/v2
难度 2/5 1-3 小时 新手友好度 78/100
anomalyco/opencode#64566 · 1 条评论 ·
维护者通常 1 天内回复
-
area/desktop platform/windows status/repro-plausible type/bug version/v2
难度 2/5 1-3 小时 新手友好度 64/100
anomalyco/opencode#64522 · 1 条评论 ·
维护者通常 1 天内回复
-
cli: plugin list shows - for ID of TUI-only plugins configured in cli.json可能已有人在做 @yash-alla 于 1 天前认领。 未关闭area/cli platform/windows type/feature version/v2
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#64175 · 1 条评论 ·
维护者通常 1 天内回复
-
area/desktop platform/windows type/feature version/v2
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#64077 · 3 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
ai-driven-qa bug claude Cosmetic
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
Domain / chatbot New
难度 2/5 1-3 小时 新手友好度 65/100
Inist-CNRS/lodex#3861 ·
维护者通常 1 天内回复
-
area:agent-sdk area:docs documentation enhancement
难度 2/5 1-3 小时 新手友好度 66/100
anthropics/claude-code#110914 ·
-
approved check:passed streams:remove
难度 1/5 1 小时以内 新手友好度 62/100
维护者通常 1 天内回复