Skip to content

rust: re-export ModelPolicyState and ModelPickerCategory from crate root - #2051

Closed
rinceyuan wants to merge 1 commit into
github:mainfrom
rinceyuan:fix/rust-reexport-model-enums
Closed

rust: re-export ModelPolicyState and ModelPickerCategory from crate root#2051
rinceyuan wants to merge 1 commit into
github:mainfrom
rinceyuan:fix/rust-reexport-model-enums

Conversation

@rinceyuan

Copy link
Copy Markdown
Contributor

Closes #1674

\ModelPolicy\ and \Model\ are re-exported at the crate root, but their field-type enums \ModelPolicyState\ and \ModelPickerCategory\ are not. This forces consumers to reach into \copilot::rpc\ for types that logically belong alongside the already-exported structs.

This adds both enums to the curated \pub use\ block in \ ypes.rs, in alphabetical order.

Closes github#1674

Add ModelPickerCategory and ModelPolicyState to the curated pub use
block in types.rs. These enums are field types of Model and ModelPolicy
which are already re-exported, but the enums themselves required
importing from copilot::rpc.
@rinceyuan
rinceyuan requested a review from a team as a code owner July 22, 2026 03:30
@rinceyuan

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company=Microsoft

@rinceyuan

Copy link
Copy Markdown
Contributor Author

@stephentoub Tiny consistency fix — 2 missing enum re-exports for types whose parent structs are already at the crate root. Thanks!

@rinceyuan

Copy link
Copy Markdown
Contributor Author

Friendly follow-up — this has been open for 2 days. It's a one-line change (adding two enum re-exports to match the already-exported parent structs). Happy to address any feedback.

@rinceyuan

Copy link
Copy Markdown
Contributor Author

@stephentoub Second follow-up — this one-liner has been open 5 days. Would appreciate a quick 👍/👎 so I know if the approach is right. Happy to adjust.

@SteveSandersonMS

Copy link
Copy Markdown
Contributor

@rinceyuan A mixture of team events and folks out on vacation last week meant we've got a bit behind. We'll be catching up over the next few days.

@SteveSandersonMS

Copy link
Copy Markdown
Contributor

Thanks for identifying this inconsistency. The current crate-root re-export list is unfortunately already somewhat arbitrary, and adding individual types as omissions are discovered would make that boundary harder to explain and maintain. The same reasoning here also applies to several other generated field types.

We would prefer to define a clear policy for which generated types belong at the crate root, then have codegen produce that set automatically. Since that policy is not yet established, we do not want to extend the manually curated list further. All these types remain available through the intended github_copilot_sdk::rpc namespace, so we plan to close this PR rather than merge this particular change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-export ModelPolicyState and ModelPickerCategory from the crate root alongside Model/ModelPolicy

2 participants