Re-export ModelPolicyState and ModelPickerCategory from the crate root alongside Model/ModelPolicy
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #2051 của @rinceyuan — đã đóng, không merge
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Mở types.rs và kiểm tra block pub use crate::generated::api_types đã được chọn lọc, vốn đã export Model và ModelPolicy. Thêm hai enum export được nêu tên vào đó, sau đó xác minh rằng các import ở crate root biên dịch được và ModelPolicyState cùng ModelPickerCategory có thể được truy cập bên cạnh các kiểu container tương ứng của chúng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The crate-root prelude (pub use types::*) surfaces a curated set of
generated protocol types, but omits two enums that are the field types
of structs already re-exported there. This makes the model-info surface
inconsistent: you can name the container struct at the crate root but
must reach through copilot::rpc for the enum that one of its fields
holds.
Details
types.rs curates the public re-export block:
/// Re-exports of generated protocol types that are part of the SDK's
/// public API surface. ...
pub use crate::generated::api_types::{
Model, ModelBilling, ModelCapabilities, ModelCapabilitiesLimits, ModelCapabilitiesLimitsVision,
ModelCapabilitiesSupports, ModelList, ModelPolicy, PermissionDecision,
PermissionDecisionApproveOnce, PermissionDecisionReject, PermissionDecisionUserNotAvailable,
};
Two enums are missing from that list even though they are the declared
field types of structs that are in it:
ModelPolicy.state: ModelPolicyState—ModelPolicyis re-exported;ModelPolicyStateis not.Model.model_picker_category: Option<ModelPickerCategory>—Modelis re-exported;ModelPickerCategoryis not.
Consequence
A consumer that pattern-matches on policy.state or reads
model.model_picker_category can refer to copilot::Model /
copilot::ModelPolicy from the crate root, but has to import the field
enums from a different path:
use copilot::{Model, ModelPolicy}; // crate root
use copilot::rpc::{ModelPolicyState, ModelPickerCategory}; // only here
Because the curated list looks complete, it's easy to assume the whole
model-info surface lives at the crate root and be surprised these two
don't. It's a small ergonomics/consistency papercut, not a correctness
issue (both are reachable via copilot::rpc).
Suggested fix
Add ModelPolicyState and ModelPickerCategory to the curated
pub use crate::generated::api_types::{ ... } block in types.rs, so
the full model-info type set is reachable from the crate root alongside
Model and ModelPolicy.
- Ngôn ngữ chính
- TypeScript
- Star
- 10.5k
- Fork
- 1.5k
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 63
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/copilot-sdk
-
Clarify SDK architecture and in-process runtime transportCó thể đã có người làm @KalebCole đã nhận 6 ngày trước. Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
github/copilot-sdk#2804 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Python ModelLimits drops max_output_tokens from model metadataCó thể đã có người làm @HDMowri đã nhận 8 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
github/copilot-sdk#2798 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
github/copilot-sdk#2793 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/copilot-sdk#2782 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Rust: subagent lifecycle hooks are logged as unknownCó thể đã có người làm @hackberry-lab đã nhận 10 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
github/copilot-sdk#2781 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của github/copilot-sdk
Issue tương tự
-
[bug] diagnostics.dumpBody:Buffer 形态请求(透传 lane)跳过 dumps/ 落盘,仅留 raw/-unknown-Có thể đã có người làm @ranxianglei đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ranxianglei/billion-context#2421 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pending triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
nuxt/test-utils#1842 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
MoonshotAI/kimi-code#4146 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
farbenmeer/tapi#531 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày