Re-export ModelPolicyState and ModelPickerCategory from the crate root alongside Model/ModelPolicy
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #2051 @rinceyuan による — マージされずにクローズ
評価
調査の方向性
types.rs を開き、すでに Model と ModelPolicy をエクスポートしている、整理された pub use crate::generated::api_types ブロックを確認します。そこに指定された 2 つの enum エクスポートを追加し、crate ルートのインポートがコンパイルできること、また ModelPolicyState と ModelPickerCategory にそれぞれのコンテナ型と同じようにアクセスできることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 10.5k
- フォーク
- 1.5k
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 64
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/copilot-sdk のほかの issue
-
Clarify SDK architecture and in-process runtime transport対応中かも @KalebCole が 6 日前に担当しました。 オープンdocumentation
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
github/copilot-sdk#2804 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Python ModelLimits drops max_output_tokens from model metadata対応中かも @HDMowri が 7 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github/copilot-sdk#2798 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
github/copilot-sdk#2793 ·
メンテナーはふだん 1 日以内に返信
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
github/copilot-sdk#2782 ·
メンテナーはふだん 1 日以内に返信
-
Rust: subagent lifecycle hooks are logged as unknown対応中かも @hackberry-lab が 10 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
github/copilot-sdk#2781 ·
メンテナーはふだん 1 日以内に返信
github/copilot-sdk の issue をすべて見る
似ている issue
-
refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
tomnewport/memprot-topo#55 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
WalletConnect/walletconnect-monorepo#7368 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
BU-Spark/se-chem-apll#47 ·
-
embed: handleTurboSignMessage header comment says the signing page posts to '*' (it never does)オープンdocumentation
難易度 2/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 70/100
udistrital/paginaweb_root#23 ·