github / github/copilot-cli

Constrain `run_factory` to registered factory names to prevent repeated guesses

Đang mở
#4,425 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

area:agents area:tools
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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_finding
  • code_implementation_factory
  • single_task
  • implementation
  • code-task
  • fix-factory
  • repo_task
  • review_then_implement

It later tried five more names for video analysis:

  • video_analysis
  • analyze_video
  • single_video_analysis
  • video-analysis
  • media_analysis

These were separate assistant-authored calls after each rejection, not host retries. No factory ran.

Steps to reproduce
  1. Expose run_factory in a session where no matching factories are registered.
  2. Ask the agent to perform a routine single-session task, such as a small implementation or media-analysis task.
  3. 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 name to registered factory names.
  • Do not expose run_factory when 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 name and resumeFromRunId at 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng việc xác định schema của công cụ run_factory, registry của factory và đường dẫn validation trong repository. Theo dõi cách các tên đã đăng ký và các lần chạy có thể tiếp tục được cung cấp, sau đó xác định các test hiện có cho việc gọi công cụ hoặc validation schema; được xem là hoàn tất khi các tên không hợp lệ bị chặn trước một tool round trip và tính loại trừ lẫn nhau giữa name và resumeFromRunId được áp dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
shell
Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.