opencode-native panics on session ID after a multibyte character

オープン 初心者向け
#64,389 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@18o がすでに取り組んでいます。

2026年11月17日 から。

  • #64390 @18o による — オープン

評価

難易度
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 の本文から書いたものです。

説明

area/tui platform/macos status/repro-plausible type/bug version/v2
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
  1. Build with bun run --cwd packages/cli-rs cargo build --release --bin opencode-native.
  2. Open a session whose Markdown contains a session ID after a multibyte character, e.g. 现abcd文ses_knownknownknownknownknownk.
  3. 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分
マージ済み PR(30日)
498

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。