Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(grok): cancel pending completions without quadratic copies #28540

Closedhieu-lee(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/28540/headopened View on GitHub

Showing 2 changed files with 58 additions and 59 deletions.

x
0 of 2 viewed, 2 left
51 additions and 38 deletionspackages/provider-grok/src/server/xaiAcpExtension.test.tsModified
View file
@@ -1353,44 +1353,57 @@
- it.effect("cancels pending completions without restarting a stalled runtime", () =>
- Effect.gen(function* () {
- const hungStart = yield* Deferred.make<never>();
- const hungPrompt = yield* Deferred.make<never>();
- let startCount = 0;
- let cancelCalled = false;
- const baseRuntime = {
- start: () => {
- startCount += 1;
- return startCount === 1
- ? Effect.succeed({
- sessionId: "root-session",
- initializeResult: {},
- sessionSetupResult: {},
- modelConfigId: undefined,
- })
- : Deferred.await(hungStart);
- },
- prompt: () => Deferred.await(hungPrompt),
- cancel: Effect.sync(() => {
- cancelCalled = true;
- }),
- handleExtNotification: () => Effect.void,
- handleExtRequest: () => Effect.void,
- } as unknown as AcpSessionRuntime.AcpSessionRuntime["Service"];
-​