GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(server): pin that Claude turn snapshots drop SDK messages · pingdotgg/t3code@fafbc6f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/provider/Layers
    • ClaudeAdapter.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/provider/Layers/ClaudeAdapter.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/provider/Layers/ClaudeAdapter.test.ts
+50Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6691,6 +6691,56 @@ describe("ClaudeAdapterLive", () => {
66916691
);
66926692
});
66936693

6694+
it.effect("completed turns keep their ids but not the SDK messages", () => {
6695+
const harness = makeHarness();
6696+
return Effect.gen(function* () {
6697+
const adapter = yield* ClaudeAdapter;
6698+
const session = yield* adapter.startSession({
6699+
threadId: THREAD_ID,
6700+
provider: ProviderDriverKind.make("claudeAgent"),
6701+
runtimeMode: "full-access",
6702+
});
6703+
const turn = yield* adapter.sendTurn({
6704+
threadId: session.threadId,
6705+
input: "hello",
6706+
attachments: [],
6707+
});
6708+
const completedFiber = yield* Stream.filter(
6709+
adapter.streamEvents,
6710+
(event) => event.type === "turn.completed",
6711+
).pipe(Stream.runHead, Effect.forkChild);
6712+
6713+
harness.query.emit({
6714+
type: "assistant",
6715+
session_id: "sdk-session-1",
6716+
uuid: "assistant-1",
6717+
parent_tool_use_id: null,
6718+
message: {
6719+
id: "assistant-message-1",
6720+
content: [{ type: "text", text: "Hi" }],
6721+
},
6722+
} as unknown as SDKMessage);
6723+
harness.query.emit({
6724+
type: "result",
6725+
subtype: "success",
6726+
is_error: false,
6727+
errors: [],
6728+
session_id: "sdk-session-1",
6729+
uuid: "result-1",
6730+
} as unknown as SDKMessage);
6731+
yield* Fiber.join(completedFiber);
6732+
6733+
const snapshot = yield* adapter.readThread(session.threadId);
6734+
assert.deepEqual(
6735+
snapshot.turns.map((entry) => ({ id: String(entry.id), items: entry.items })),
6736+
[{ id: String(turn.turnId), items: [] }],
6737+
);
6738+
}).pipe(
6739+
Effect.provideService(Random.Random, makeDeterministicRandomService()),
6740+
Effect.provide(harness.layer),
6741+
);
6742+
});
6743+
66946744
it.effect("rewinds Claude history when the fork omits retained system messages", () => {
66956745
const forkCalls: Array<Parameters<NonNullable<ClaudeAdapterLiveOptions["forkSession"]>>> = [];
66966746
let firstTurnId = "";

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.