V2 config: ignore {file:...} in JSONC comments
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
この issue は V2 設定パーサーのトークン置換ロジックにあります。{file:...} トークンを処理するコードを探してください。おそらく src/config/parser.ts などのファイルにあります。修正では、// で始まる行だけでなく、JSONC コメント (// および /* */) 内のトークンをスキップする必要があります。まず、提供された再現手順を実行して失敗を確認し、次にリンクされているプルリクエスト #50899 を調べて、意図された修正のコンテキストを把握してください。
索引モデルが issue の本文から書いたものです。
説明
Description
In V2, a {file:...} token inside an inline // or /* ... */ comment in opencode.jsonc is treated as a real file reference. If that file does not exist, an otherwise valid config fails to load. The current substitution code skips only lines that begin with //.
Expected: comments are left alone; only active config values are substituted. Missing files in active values should still be errors.
Related #14478 concerned an active token shadowed by a commented duplicate in the older config path; here V2 dereferences tokens that occur only in comments.
Implementation: #50899 (targets v2).
Plugins
None
OpenCode version
V2 9c8a63e852722a9bced4a0de1179de58a85dfa20
Steps to reproduce
-
Create
opencode.jsoncwith:{ "username": "demo" // {file:./not-present.txt} } -
Load the configuration. It fails trying to read
not-present.txteven though the token is in a comment. A block comment containing the token has the same problem.
Screenshot and/or share link
Not applicable. A Core config regression test reproduces the failure with NotFound for missing-inline.txt before the fix.
Operating System
Linux x86_64
Terminal
Not applicable (Core test)
- 主要言語
- TypeScript
- スター
- 209k
- フォーク
- 27.5k
- 平均マージ
- 9時間 42分
- マージ済み PR(30日)
- 389
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anomalyco/opencode の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
bcgov/bc-wallet-mobile#4761 · コメント 1 件 ·
-
external-issue to-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100