glob: literal null and undefined directory names search the workspace root
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- bun, typescript
調査の方向性
packages/core/src/tool/plugin/glob.tsから始めます。issueによると、リテラルのパスはundefinedに変換されます。指定されたパスがripgrep検索に渡るまでの流れを追います。packages/coreから提供されたBunスクリプトを使って再現し、null、undefined、ordinaryを比較します。指定した各ディレクトリの結果がそのディレクトリ内のファイルに限定され、リテラル名を対象とした回帰テストが追加されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
The glob tool interprets the literal directory names null and undefined as an omitted path. A search scoped to either directory instead runs from the workspace root and includes unrelated files, potentially hiding relevant results under the result limit. Other directory names work normally.
Reproduction
On dev commit 82666b6612cdb2ba13a7a26e150b21e897a80373, save the following as /tmp/oc-glob-repro.ts and run from packages/core:
bun -e "$(cat /tmp/oc-glob-repro.ts)"
import { Effect, Layer } from "effect"
import { AppNodeBuilder } from "@opencode/core/effect/app-node-builder"
import { makeLocationNode } from "@opencode/util/effect/app-node"
import { LayerNode } from "@opencode/util/effect/layer-node"
import { Environment } from "@opencode/core/environment/index"
import { Location } from "@opencode/core/location"
import { FileAccess } from "@opencode/core/file-access"
import { Permission } from "@opencode/core/permission"
import { Ripgrep } from "@opencode/core/ripgrep"
import { AbsolutePath } from "@opencode/core/schema"
import { Session } from "@opencode/core/session"
import { GlobTool } from "@opencode/core/tool/plugin/glob"
import { Tool } from "@opencode/core/tool"
import { location } from "./test/fixture/location"
import { permissionLayer } from "./test/lib/permission"
import { executeTool, registerToolPlugin, toolIdentity } from "./test/lib/tool"
import { mkdtemp, mkdir } from "node:fs/promises"
const dir = await mkdtemp("/tmp/oc-glob-")
await mkdir(`${dir}/null`)
await mkdir(`${dir}/undefined`)
await mkdir(`${dir}/ordinary`)
await Bun.write(`${dir}/null/inside.txt`, "x")
await Bun.write(`${dir}/undefined/inside.txt`, "x")
await Bun.write(`${dir}/ordinary/inside.txt`, "x")
await Bun.write(`${dir}/outside.txt`, "x")
const node = makeLocationNode({ name:"glob-repro", layer:Layer.effectDiscard(registerToolPlugin(GlobTool.Plugin)), deps:[Tool.node,Environment.node,Ripgrep.node,Location.node,FileAccess.node,Permission.node] })
const layer = AppNodeBuilder.build(LayerNode.group([Tool.node,node]), [Location.node.replace(Layer.succeed(Location.Service,Location.Service.of(location({directory:AbsolutePath.make(dir)})))),Permission.node.replace(permissionLayer({assert:()=>Effect.void}))])
await Effect.runPromise(Effect.gen(function*(){const registry=yield* Tool.Service; for(const path of ["null","undefined","ordinary"]) {const r=yield* executeTool(registry,{sessionID:Session.ID.make("ses_repro"),...toolIdentity,call:{type:"tool-call",id:`call-${path}`,name:"glob",input:{pattern:"*.txt",path}}}); console.log(path,JSON.stringify(r.output));}}).pipe(Effect.provide(layer)))
Actual: both null and undefined calls return all four files, including outside.txt; ordinary returns only ordinary/inside.txt. Logs show ripgrep runs at the workspace root for the first two calls and inside ordinary for the third. Expected: each supplied path scopes the search to that directory. This executes the registered GlobTool and real ripgrep, with a test permission fixture. glob.ts explicitly converts the two strings to undefined; its source blob matches upstream dev.
- 主要言語
- TypeScript
- スター
- 221k
- フォーク
- 29.6k
- 平均マージ
- 7時間 41分
- マージ済み PR(30日)
- 510
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
core: OpenRouter BYOK sessions record cost = 0 since v2.2.0 (ignores cost_details.upstream_inference_cost)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンreproduced
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#60558 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#60541 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
anomalyco/opencode#60529 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anomalyco/opencode#60469 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
TUI permission prompt for MCP tools doesn't show the call arguments対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
anomalyco/opencode#60350 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
Replace discontinued crypto-js in the theme対応中かも @aelmanaa が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
PaloAltoNetworks/docusaurus-openapi-docs#1689 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
solana-foundation/solana-web3.js#4015 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 90/100
ivopogace/opencode-courier#422 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
chapel-lang/chapel-vscode#158 ·
メンテナーはふだん 1 日以内に返信