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

EnterWorktree called by a teammate moves the lead and every other in-process teammate

クローズ 初心者向け
#198 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

まず src/tools/AgentTool/agentToolUtils.ts の teammate ツールフィルターと、src/constants/tools.ts の許可されたツール一覧を読みます。teammate フィルターを実行し、EnterWorktree と ExitWorktree が含まれないことを確認するテストを追加し、その後テストが通るように許可されたツール一覧を更新します。Issue では、テストは現在 main で失敗するとされています。in-process の teammate に対して両方のツールが除外されれば完了です。

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

説明

bug
What happens

In-process teammates share one process with the lead. When one teammate calls EnterWorktree, the lead and all other teammates in that process switch to its worktree too.

Cause
  • EnterWorktree changes process-wide state: process.chdir, setCwd and setOriginalCwd (src/tools/EnterWorktreeTool/EnterWorktreeTool.ts:94-96).
  • Teammates are allowed to call it: ENTER_WORKTREE_TOOL_NAME and EXIT_WORKTREE_TOOL_NAME are in ASYNC_AGENT_ALLOWED_TOOLS (src/constants/tools.ts:69-70), which is the tool filter for async agents and in-process teammates (src/tools/AgentTool/agentToolUtils.ts:100).
  • Per-agent working directories exist only through runWithCwdOverride (src/utils/cwd.ts), which ordinary subagents use and teammates do not.
Example
  1. The lead creates a team with teammates A and B in the same process.
  2. A calls EnterWorktree.
  3. The lead's and B's next file reads and writes, Bash commands and permission checks (anything that reads getCwd() or getOriginalCwd()) run in A's worktree. Edits meant for the user's project land in A's worktree, and the other way round.
Proposed fix
  • Short term: remove EnterWorktree and ExitWorktree from the tools in-process teammates get.
  • Later, if teammates should have their own worktrees: make the working directory per teammate by wrapping the teammate's run (runWithTeammateContext in src/utils/swarm/inProcessRunner.ts) in runWithCwdOverride, and record the path in the team file's worktreePath so the UI can show it. That belongs to #166, which is on hold.
Tests

A test that runs a teammate's tool filter and asserts EnterWorktree and ExitWorktree are absent; it fails on current main.

Part of #162.

主要言語
TypeScript
スター
490
フォーク
47
平均マージ
10時間 53分
マージ済み PR(30日)
81

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

GoDiao/dreamcoder のほかの issue

GoDiao/dreamcoder の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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