Skip to content

Commit 061b2bc

Browse files
committed
Merge remote-tracking branch 'origin/main' into edburns/80-java-monorepo-add-phase-01
2 parents 69fcb7c + 43d6aef commit 061b2bc

82 files changed

Lines changed: 40540 additions & 9196 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dotnet/src/Generated/Rpc.cs

Lines changed: 9865 additions & 3764 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dotnet/src/Generated/SessionEvents.cs

Lines changed: 89 additions & 89 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dotnet/src/Polyfills/CodeAnalysisAttributes.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ internal sealed class StringSyntaxAttribute : Attribute
3030
{
3131
public const string Uri = nameof(Uri);
3232

33+
public const string Regex = nameof(Regex);
34+
3335
public StringSyntaxAttribute(string syntax)
3436
{
3537
Syntax = syntax;

dotnet/src/Session.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ public async Task LogAsync(string message, SessionLogLevel? level = null, bool?
14271427
ArgumentNullException.ThrowIfNull(message);
14281428
ThrowIfDisposed();
14291429

1430-
await Rpc.LogAsync(message, level, ephemeral, url, cancellationToken);
1430+
await Rpc.LogAsync(message, level, ephemeral: ephemeral, url: url, cancellationToken: cancellationToken);
14311431
}
14321432

14331433
/// <summary>

dotnet/src/Types.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2795,9 +2795,9 @@ public class PingResponse
27952795
/// </summary>
27962796
public string Message { get; set; } = string.Empty;
27972797
/// <summary>
2798-
/// Server timestamp when the ping was processed.
2798+
/// ISO 8601 timestamp when the ping was processed.
27992799
/// </summary>
2800-
public long Timestamp { get; set; }
2800+
public DateTimeOffset Timestamp { get; set; }
28012801
/// <summary>
28022802
/// Protocol version supported by the server.
28032803
/// </summary>

dotnet/test/E2E/ClientE2ETests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public async Task Should_Start_And_Connect_To_Server(bool useStdio)
2525

2626
var pong = await client.PingAsync("test message");
2727
Assert.Equal("pong: test message", pong.Message);
28-
Assert.True(pong.Timestamp >= 0);
28+
Assert.NotEqual(default, pong.Timestamp);
2929

3030
await client.StopAsync();
3131
Assert.Equal(ConnectionState.Disconnected, client.State);

dotnet/test/E2E/EventFidelityE2ETests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ await session.SendAsync(new MessageOptions
147147
Prompt = "What is 9+9? Reply with just the number.",
148148
});
149149

150-
var pendingEvent = await pendingMessagesModified;
151150
var answer = await TestHelper.GetFinalAssistantMessageAsync(session);
151+
var pendingEvent = await pendingMessagesModified;
152152

153153
Assert.NotNull(pendingEvent);
154154
Assert.Contains("18", answer?.Data.Content ?? string.Empty);

dotnet/test/E2E/HookLifecycleAndOutputE2ETests.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,12 @@ public async Task Should_Allow_PostToolUse_To_Return_ModifiedResult()
322322

323323
return Task.FromResult<PostToolUseHookOutput?>(new PostToolUseHookOutput
324324
{
325-
ModifiedResult = "modified by post hook",
325+
ModifiedResult = new ToolResultObject
326+
{
327+
TextResultForLlm = "modified by post hook",
328+
ResultType = "success",
329+
ToolTelemetry = new Dictionary<string, object>(),
330+
},
326331
SuppressOutput = false,
327332
});
328333
},

dotnet/test/E2E/ModeHandlersE2ETests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,10 @@ public async Task Should_Invoke_Auto_Mode_Switch_Handler_When_Rate_Limited()
103103
},
104104
});
105105

106+
const long expectedRetryAfter = 1;
106107
var requestedEventTask = GetNextEventOfTypeAllowingRateLimitAsync<AutoModeSwitchRequestedEvent>(
107108
session,
108-
evt => evt.Data.ErrorCode == "user_weekly_rate_limited" && evt.Data.RetryAfterSeconds == 1,
109+
evt => evt.Data.ErrorCode == "user_weekly_rate_limited" && evt.Data.RetryAfterSeconds == expectedRetryAfter,
109110
TimeSpan.FromSeconds(30),
110111
timeoutDescription: "auto_mode_switch.requested event");
111112
var completedEventTask = GetNextEventOfTypeAllowingRateLimitAsync<AutoModeSwitchCompletedEvent>(
@@ -137,7 +138,7 @@ public async Task Should_Invoke_Auto_Mode_Switch_Handler_When_Rate_Limited()
137138

138139
var requestedEvent = await requestedEventTask;
139140
Assert.Equal(request.ErrorCode, requestedEvent.Data.ErrorCode);
140-
Assert.Equal(request.RetryAfterSeconds, requestedEvent.Data.RetryAfterSeconds);
141+
Assert.Equal(expectedRetryAfter, requestedEvent.Data.RetryAfterSeconds);
141142

142143
var completedEvent = await completedEventTask;
143144
Assert.Equal(AutoModeSwitchResponse.Yes, completedEvent.Data.Response);

dotnet/test/E2E/RpcAdditionalEdgeCasesE2ETests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ public async Task Usage_GetMetrics_On_Fresh_Session_Returns_Zero_Tokens()
151151
var metrics = await session.Rpc.Usage.GetMetricsAsync();
152152

153153
// Fresh session = no LLM calls yet. Last-call counters and the user-request count
154-
// must be zero, and SessionStartTime must be a positive epoch (set at create-time).
154+
// must be zero, and SessionStartTime must be populated at create-time.
155155
Assert.Equal(0, metrics.LastCallInputTokens);
156156
Assert.Equal(0, metrics.LastCallOutputTokens);
157157
Assert.Equal(0, metrics.TotalUserRequests);
158-
Assert.True(metrics.SessionStartTime > 0, "SessionStartTime should be a positive epoch.");
158+
Assert.NotEqual(default, metrics.SessionStartTime);
159159
}
160160

161161
[Fact]

0 commit comments

Comments
 (0)