Commit 1742053
Add TelemetryConfig builder methods
Final missing piece in the consumer-facing #[non_exhaustive] config
struct audit. `TelemetryConfig` had public optional fields (otlp_endpoint,
file_path, exporter_type, source_name, capture_content) and an
is_empty() helper, but no `new()` or `with_*` setters — leaving callers
to write `TelemetryConfig { otlp_endpoint: Some(...), ..Default::default() }`
which doesn't compile from outside the crate due to #[non_exhaustive].
Adds `TelemetryConfig::new()` (delegates to Default) and `with_*`
setters for all five fields, matching the existing pattern.
The is_empty() helper stays unchanged.
After this commit, every consumer-facing #[non_exhaustive] struct
in the SDK has a fluent builder: ClientOptions, TelemetryConfig,
Tool, CommandDefinition, CustomAgentConfig, InfiniteSessionConfig,
ProviderConfig, SessionConfig, ResumeSessionConfig,
SystemMessageConfig, MessageOptions, SessionFsConfig, TraceContext.
One unit test (telemetry_config_builder_composes) covering all five
setters + is_empty behavior on a fresh new(). Extends the existing
CHANGELOG "Builder ergonomics" round-out bullet.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent d20cd3e commit 1742053
2 files changed
Lines changed: 67 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
395 | | - | |
396 | | - | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
397 | 400 | | |
398 | 401 | | |
399 | 402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
541 | 581 | | |
542 | 582 | | |
543 | 583 | | |
| |||
1858 | 1898 | | |
1859 | 1899 | | |
1860 | 1900 | | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
1861 | 1922 | | |
1862 | 1923 | | |
1863 | 1924 | | |
| |||
0 commit comments