Hook inputs: expose the active chat model

Đang mở
#2,851 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.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
developer-experience

Hướng nghiên cứu

Start from the shared hook input type (BaseHookInput) and the event-specific inputs the issue names: UserPromptSubmit, PreToolUse and PostToolUse. Find where the session and timestamp fields are populated, and check whether the host already supplies any model data before adding an optional model object shaped like { id, vendor, family? }. Done means every hook event carries the field, or the issue records that the host cannot provide it.

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

Mô tả

Context
This continues a request originally filed against VS Code - microsoft/vscode#301152 ("Add model field to Copilot agent hook inputs") — which was closed as the hooks surface moved to the Copilot SDK. The underlying gap wasn't resolved, only relocated. A related sibling request, #2810 ("expose the active agent and the approval mode"), covers agent identity and approval mode but not the model — this issue is specifically about the LLM model.

Problem
Hook inputs (BaseHookInput and the event-specific types, e.g. UserPromptSubmit, PreToolUse, PostToolUse) carry sessionId, timestamp, workingDirectory, etc., but no identifier for which chat model is active for that call. There is currently no reliable way for an external hook process to determine this:

vscode.lm.selectChatModels() returns models matching a selector, not the one currently selected in the chat UI.
The Chat Participant API's request.model is accurate, but only available inside a chat participant's own request handler, not to hooks, which fire on all chat activity regardless of whether a participant is invoked.
Reading transcript_path / host storage is an undocumented, fragile workaround that can silently break on any host update.

Use case
We build developer tooling on top of UserPromptSubmit that needs to behave differently depending on which chat model is active (e.g., adjusting behavior to a model's known characteristics, or attributing telemetry per model). This is a different use case from the original issue's security/policy-enforcement angle (model allow/denylisting), but hits the identical missing field: there's currently no supported way to know which model is active from a hook.

Proposed solution
Add a model field to the common hook input fields sent to all hook events:

model?: {
  id: string;
  vendor: string;
  family?: string;
};

Matches the shape already returned by vscode.lm's LanguageModelChat objects, so existing model metadata concepts carry over directly.

Why it matters
Without this, any hook-based tool that wants to reason about "which model is this developer using right now" has no supported way to find out - only fragile, undocumented workarounds that can break without notice.

Ngôn ngữ chính
Java
Star
10.7k
Fork
1.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

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.

Issue khác của github/copilot-sdk

Tất cả issue của github/copilot-sdk

Issue tương tự

Thêm issue về Java

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.