Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(cursor): long command output streams without copying its tail per chunk #26934

Mergedhieu-lee(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/26934/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 161 additions and 4 deletions.

x
0 of 2 viewed, 2 left
151 additions and 0 deletionspackages/provider-cursor/src/server/adapter.test.tsModified
View file
@@ -1726,6 +1726,157 @@
+ it.effect("keeps the last 256 KiB of streamed shell output when the result carries none", () =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const workspace = yield* fileSystem.makeTempDirectoryScoped({ prefix: "cursor-v2-shell-" });
+ const instanceId = ProviderInstanceId.make("cursor");
+ const threadId = ThreadId.make("cursor-shell-thread");
+ const modelSelection = { instanceId, model: "composer-2.5" };
+ const runtimePolicy = ProviderAdapter.ProviderAdapterV2RuntimePolicy.make({
+ runtimeMode: "full-access",
+ interactionMode: "default",
+ cwd: workspace,
+ });
+ const chunks = Array.from({ length: 3000 }, (_, index) => `${index}`.padEnd(255, ".") + "\n");
+ const shell = {
+ type: "shell" as const,
+ args: { command: "yes", workingDirectory: workspace },
+ };
+ const adapter = yield* makeCursorAdapterV2({
+ instanceId,
+ environment: { HOME: workspace },
+ }).pipe(
+ Effect.provideService(CursorAgentSdk.CursorAgentSdkRunner, {
+ assertComplete: Effect.void,
+ open: () =>
+ Effect.succeed({
+ agentId: "native-cursor-shell",