Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(effect-acp): honor advertised session delete capability #27771

MergedKamkmgamer(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/27771/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 108 additions and 9 deletions.

x
0 of 2 viewed, 2 left
94 additions and 0 deletionspackages/effect-acp/src/client.test.tsModified
View file
@@ -1042,6 +1042,100 @@
+ it.effect.each([
+ { shape: "v1", deleteCapability: {} },
+ { shape: "v2", deleteCapability: {} },
+ { shape: "v2", deleteCapability: undefined },
+ { shape: "v2", deleteCapability: null },
+ ])(
+ "gates session/delete for $shape with delete=$deleteCapability",
+ ({ shape, deleteCapability }) =>
+ Effect.gen(function* () {
+ const { stdio, input, output } = yield* makeInMemoryStdio();
+ const scope = yield* Scope.make();
+ const acp = yield* AcpClient.make(stdio).pipe(Effect.provideService(Scope.Scope, scope));
+ const deleteSession = acp.agent.deleteSession({ sessionId: "kiro-session-1" });
+​
+ const initializeFiber = yield* acp.agent
+ .initialize({
+ protocolVersion: 1,
+ clientCapabilities: {
+ fs: { readTextFile: false, writeTextFile: false },
+ terminal: false,
+ },
+ clientInfo: { name: "effect-acp-test", version: "0.0.0" },
+ })
+ .pipe(Effect.forkScoped);
+ const initializeRequest = yield* Queue.take(output).pipe(
+ Effect.flatMap(Schema.decodeEffect(Schema.fromJsonString(InitializeRequestV1))),