Constrain `run_factory` to registered factory names to prevent repeated guesses
まだ誰も着手していません。
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
Summary
run_factory can be exposed with an unconstrained name argument even when no matching factory is registered. The model can interpret tool availability as factory availability, invent plausible names, and retry them serially.
Originally reported from the VS Code Agents Window in microsoft/vscode#329551.
Observed behavior
With Copilot CLI 1.0.78 and GPT-5.6 Sol, one session produced 13 distinct model-authored run_factory calls. Every call failed immediately with:
RpcResponseError: No factory registered with name "<name>"
The model first tried eight implementation-oriented names:
apply_findingcode_implementation_factorysingle_taskimplementationcode-taskfix-factoryrepo_taskreview_then_implement
It later tried five more names for video analysis:
video_analysisanalyze_videosingle_video_analysisvideo-analysismedia_analysis
These were separate assistant-authored calls after each rejection, not host retries. No factory ran.
Steps to reproduce
- Expose
run_factoryin a session where no matching factories are registered. - Ask the agent to perform a routine single-session task, such as a small implementation or media-analysis task.
- Observe that the model may invent and repeatedly retry factory names.
Expected behavior
Invalid factory names should be impossible or strongly bounded. Ideally:
- Dynamically constrain
nameto registered factory names. - Do not expose
run_factorywhen there are no registered factories or resumable runs. - If dynamic enum generation is not possible, require registry discovery before invocation and include available names in validation errors.
- Enforce exactly one of
nameandresumeFromRunIdat the schema level.
Actual behavior
name is effectively a free-form string, so failures occur only after a costly tool round trip. Prompt guidance to use factories selectively did not prevent repeated guesses.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、リポジトリ内で run_factory ツールのスキーマ、ファクトリーレジストリ、検証パスを特定します。登録済みの名前と再開可能な実行がどのように公開されているかを追跡し、続いてツール呼び出しまたはスキーマ検証に関する既存のテストを特定します。無効な名前がツールとのラウンドトリップの前に排除され、name と resumeFromRunId の排他性が強制されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- shell
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100