Three symbols are documented as deprecated in their comments but carry no deprecated option, so the deprecation never reaches generated SDKs. The repo already applies the option correctly in two other places, so this reads as an oversight rather than a decision.
Filing as an issue rather than a PR because CONTRIBUTING lists adding or modifying options as a non-accepted contribution — these are yours to own. Happy to send the patch if you would rather have it that way, but I did not want to open a PR against your stated policy.
Missing
| Location |
Comment |
proto/xai/api/v1/chat.proto:63 — optional int32 n = 8; |
"PLEASE NOTE: This field is deprecated and will be removed in the future." |
proto/xai/api/v1/usage.proto:35 — int32 num_sources_used = 8; |
"[DEPRECATED - live search feature has been deprecated so this field is redundant]" |
proto/xai/api/v1/documents.proto:64 — enum RankingMetric |
"Deprecated: Metric now comes from what is set in the collection creation." |
Already correct, for contrast
proto/xai/api/v1/chat.proto:596 — ROLE_FUNCTION = 4 [deprecated = true];
proto/xai/api/v1/documents.proto:92 — optional RankingMetric ranking_metric = 4 [deprecated = true];
Note the third row is the enum type RankingMetric. Its only consumer is ranking_metric, which is already deprecated, so marking the enum has no live callers.
Why it matters
buf.gen.yaml generates Python and TypeScript SDKs from these definitions, and the option is what surfaces the deprecation to end users — @deprecated JSDoc in bufbuild/es output (IDE strikethrough), and the deprecation marker in the Python/pyi output. Without it, someone writing against n or num_sources_used gets no signal from their editor, and the comment is only visible to people reading the .proto directly.
Measured with buf generate using buf.build/bufbuild/es:v2.8.0, counting @deprecated in the generated TypeScript before and after adding the three options:
| Generated file |
before |
after |
chat_pb.ts |
1 |
2 |
usage_pb.ts |
0 |
1 |
documents_pb.ts |
1 |
3 |
(documents_pb.ts gains two because the enum's generated schema constant is annotated alongside the enum.)
Suggested change
// chat.proto
optional int32 n = 8 [deprecated = true];
// usage.proto
int32 num_sources_used = 8 [deprecated = true];
// documents.proto
enum RankingMetric {
option deprecated = true;
...
}
Verified locally against 723dd2a with buf 1.72.0 — buf build, buf lint (your MINIMAL set) and buf breaking --against .git#ref=HEAD all pass. Adding the option changes no field numbers, types or wire format, so it is backward compatible.
Three symbols are documented as deprecated in their comments but carry no
deprecatedoption, so the deprecation never reaches generated SDKs. The repo already applies the option correctly in two other places, so this reads as an oversight rather than a decision.Filing as an issue rather than a PR because CONTRIBUTING lists adding or modifying options as a non-accepted contribution — these are yours to own. Happy to send the patch if you would rather have it that way, but I did not want to open a PR against your stated policy.
Missing
proto/xai/api/v1/chat.proto:63—optional int32 n = 8;proto/xai/api/v1/usage.proto:35—int32 num_sources_used = 8;proto/xai/api/v1/documents.proto:64—enum RankingMetricAlready correct, for contrast
proto/xai/api/v1/chat.proto:596—ROLE_FUNCTION = 4 [deprecated = true];proto/xai/api/v1/documents.proto:92—optional RankingMetric ranking_metric = 4 [deprecated = true];Note the third row is the enum type
RankingMetric. Its only consumer isranking_metric, which is already deprecated, so marking the enum has no live callers.Why it matters
buf.gen.yamlgenerates Python and TypeScript SDKs from these definitions, and the option is what surfaces the deprecation to end users —@deprecatedJSDoc inbufbuild/esoutput (IDE strikethrough), and the deprecation marker in the Python/pyi output. Without it, someone writing againstnornum_sources_usedgets no signal from their editor, and the comment is only visible to people reading the.protodirectly.Measured with
buf generateusingbuf.build/bufbuild/es:v2.8.0, counting@deprecatedin the generated TypeScript before and after adding the three options:chat_pb.tsusage_pb.tsdocuments_pb.ts(
documents_pb.tsgains two because the enum's generated schema constant is annotated alongside the enum.)Suggested change
Verified locally against
723dd2awith buf 1.72.0 —buf build,buf lint(yourMINIMALset) andbuf breaking --against .git#ref=HEADall pass. Adding the option changes no field numbers, types or wire format, so it is backward compatible.