Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

glob: literal null and undefined directory names search the workspace root

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

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

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bun, typescript
領域
cli, tooling

調査の方向性

packages/core/src/tool/plugin/glob.tsから始めます。issueによると、リテラルのパスはundefinedに変換されます。指定されたパスがripgrep検索に渡るまでの流れを追います。packages/coreから提供されたBunスクリプトを使って再現し、null、undefined、ordinaryを比較します。指定した各ディレクトリの結果がそのディレクトリ内のファイルに限定され、リテラル名を対象とした回帰テストが追加されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

reproduced
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

環境構築

はじめの一歩

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

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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