Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): cap background-work deferral and report session-teardown losses #5711

Closedgfsaaser24(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/5711/headopened View on GitHub

Showing 7 changed files with 214 additions and 0 deletions (loading 5).

x
0 of 7 viewed, 7 left
147 additions and 0 deletionsapps/server/src/provider/Layers/ClaudeAdapter.test.tsModified
View file
@@ -1828,6 +1828,153 @@
+ it.effect("reports lost background agents when the stream ends cleanly", () => {
+ const harness = makeHarness();
+ return Effect.gen(function* () {
+ const adapter = yield* ClaudeAdapter;
+ const runtimeEvents: Array<ProviderRuntimeEvent> = [];
+ const runtimeEventsFiber = yield* Stream.runForEach(adapter.streamEvents, (event) =>
+ Effect.sync(() => {
+ runtimeEvents.push(event);
+ }),
+ ).pipe(Effect.forkChild);
+​
+ yield* adapter.startSession({
+ threadId: THREAD_ID,
+ provider: ProviderDriverKind.make("claudeAgent"),
+ runtimeMode: "full-access",
+ });
+ yield* adapter.sendTurn({
+ threadId: THREAD_ID,
+ input: "spawn agents",
+ attachments: [],
+ });
+​
+ harness.query.emit({
+ type: "system",
+ subtype: "task_started",
+ task_id: "task-lost-a",