Use TimeToLive (TimeSpan?) instead of TtlMs (long?) in public APIs#1644
Draft
Copilot wants to merge 3 commits into
Draft
Use TimeToLive (TimeSpan?) instead of TtlMs (long?) in public APIs#1644Copilot wants to merge 3 commits into
TimeToLive (TimeSpan?) instead of TtlMs (long?) in public APIs#1644Copilot wants to merge 3 commits into
Conversation
…ic APIs Co-authored-by: PranavSenthilnathan <12225508+PranavSenthilnathan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Consistently use TimeToLive instead of TTL in public APIs
Rename Jun 12, 2026
TtlMs/DefaultTtlMs to TimeToLiveMs/DefaultTimeToLiveMs in public APIs
PranavSenthilnathan
requested changes
Jun 12, 2026
| /// </summary> | ||
| [JsonPropertyName("ttlMs")] | ||
| public long? TtlMs { get; set; } | ||
| public long? TimeToLiveMs { get; set; } |
Contributor
There was a problem hiding this comment.
This should just be a TimeSpan? named TimeToLive and it should use the custom converter TimeSpanMillisecondsConverter. Same for the others as well.
Contributor
Author
There was a problem hiding this comment.
Done. Changed all five occurrences (CreateTaskResult, GetTaskResult, TaskStatusNotificationParams, McpTaskInfo, and InMemoryMcpTaskStore.DefaultTimeToLive) from long? to TimeSpan?, introduced TimeSpanMillisecondsConverter for JSON serialization (the wire format "ttlMs" number is preserved), and updated all usages and tests.
…llisecondsConverter Co-authored-by: PranavSenthilnathan <12225508+PranavSenthilnathan@users.noreply.github.com>
Copilot
AI
changed the title
Rename
Use Jun 12, 2026
TtlMs/DefaultTtlMs to TimeToLiveMs/DefaultTimeToLiveMs in public APIsTimeToLive (TimeSpan?) instead of TtlMs (long?) in public APIs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ttlabbreviation in public APIs is hard to read. This PR spells it out asTimeToLiveand also changes the type fromlong?(milliseconds) toTimeSpan?for a more idiomatic .NET API. A newTimeSpanMillisecondsConverterhandles JSON serialization so the wire format is unchanged.Changes
New type
TimeSpanMillisecondsConverter— aJsonConverter<TimeSpan>that reads/writes millisecond integers on the wireRenamed and retyped identifiers
McpTaskInfolong? TtlMsTimeSpan? TimeToLiveCreateTaskResultlong? TtlMsTimeSpan? TimeToLiveGetTaskResultlong? TtlMsTimeSpan? TimeToLiveTaskStatusNotificationParamslong? TtlMsTimeSpan? TimeToLiveInMemoryMcpTaskStorelong? DefaultTtlMsTimeSpan? DefaultTimeToLiveThe JSON wire format property name (
"ttlMs") is unchanged — only C# identifiers and types are affected.