Skip to content

Commit 724f529

Browse files
committed
Unskip getSessionMetadata E2E tests (CLI 1.0.12-0 adds support)
Now that the runtime includes session.getMetadata, enable the previously-skipped Node.js and .NET E2E tests. Both tests are updated to send a message and wait before querying metadata, matching the pattern used in the already-running Python and Go tests (session files aren't persisted until at least one exchange completes).
1 parent 776eb04 commit 724f529

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

dotnet/test/SessionTests.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,15 @@ public async Task Should_List_Sessions_With_Context()
407407
}
408408
}
409409

410-
// TODO: Re-enable once test harness CAPI proxy supports this test's session lifecycle
411-
[Fact(Skip = "Needs test harness CAPI proxy support")]
410+
[Fact]
412411
public async Task Should_Get_Session_Metadata_By_Id()
413412
{
414413
var session = await CreateSessionAsync();
415414

415+
// Send a message to persist the session to disk
416+
await session.SendAndWaitAsync(new MessageOptions { Prompt = "Say hello" });
417+
await Task.Delay(200);
418+
416419
var metadata = await Client.GetSessionMetadataAsync(session.SessionId);
417420
Assert.NotNull(metadata);
418421
Assert.Equal(session.SessionId, metadata.SessionId);

nodejs/test/e2e/session.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,14 @@ describe("Sessions", async () => {
4949
}
5050
});
5151

52-
// TODO: Re-enable once test harness CAPI proxy supports this test's session lifecycle
53-
it.skip("should get session metadata by ID", { timeout: 60000 }, async () => {
52+
it("should get session metadata by ID", { timeout: 60000 }, async () => {
5453
const session = await client.createSession({ onPermissionRequest: approveAll });
5554
expect(session.sessionId).toMatch(/^[a-f0-9-]+$/);
5655

56+
// Send a message to persist the session to disk
57+
await session.sendAndWait({ prompt: "Say hello" });
58+
await new Promise((r) => setTimeout(r, 200));
59+
5760
// Get metadata for the session we just created
5861
const metadata = await client.getSessionMetadata(session.sessionId);
5962

0 commit comments

Comments
 (0)