@devries-cameron20 / t3code Mirror · read-only / commits / 00200bd412
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 07:15 UTC

fix(server): Antigravity native slash commands reach the composer (#35621)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Berk Kuyumcu committed Nov 19, 2026 at 09:48 UTC 00200bd412f63d9ba2e7241b7eb60eb82baa5b10
5 files changed +28 -17
apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts
+15 -1
@@ -317,6 +317,10 @@ describe("AntigravityAdapterV2 compaction", () => {
317 const goalSupport = yield* Ref.make(false);
318 const startupMilestone = yield* Deferred.make<void>();
319 const consumeStartupCommands = yield* Deferred.make<void>();
320 + const workspaceCommands = yield* Ref.make<{
321 + readonly names: ReadonlyArray<string>;
322 + readonly cwd: string;
323 + } | null>(null);
324 const adapter = yield* makeAntigravityAdapterV2({
325 instanceId,
326 selfInvocation: yield* resolveSelfInvocation(),
@@ -344,10 +348,16 @@ describe("AntigravityAdapterV2 compaction", () => {
348 supportsNativeGoals: Ref.get(goalSupport).pipe(
349 Effect.tap(() => Deferred.succeed(startupMilestone, undefined)),
350 ),
347 - onSessionEvent: (event) =>
351 + onSessionEvent: (event, cwd) =>
352 event._tag === "AvailableCommandsUpdated"
353 ? Deferred.await(consumeStartupCommands).pipe(
354 Effect.andThen(Ref.set(goalSupport, nativeGoals)),
355 + Effect.andThen(
356 + Ref.set(workspaceCommands, {
357 + names: event.availableCommands.map((command) => command.name),
358 + cwd,
359 + }),
360 + ),
361 )
362 : Effect.void,
363 });
@@ -366,6 +376,10 @@ describe("AntigravityAdapterV2 compaction", () => {
376 yield* Deferred.await(startupMilestone);
377 yield* Deferred.succeed(consumeStartupCommands, undefined);
378 const session = yield* Fiber.join(opening);
379 + assert.deepEqual(yield* Ref.get(workspaceCommands), {
380 + names: ["plan", "logout"],
381 + cwd: process.cwd(),
382 + });
383 assert.isUndefined(session.compactThread);
384 assert.equal(session.providerSession.capabilities.turns.supportsNativeGoals, nativeGoals);
385 assert.equal((yield* adapter.getCapabilities()).turns.supportsNativeGoals, nativeGoals);
apps/server/src/provider/AntigravityProvider.test.ts
+7 -4
@@ -386,17 +386,20 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => {
386 }),
387 );
388
389 - it.effect("shows a thread session's native commands in that workspace's snapshot", () =>
389 + it.effect("keeps a workspace's native commands when the catalog reports its own", () =>
390 Effect.gen(function* () {
391 const harness = yield* makeHarness();
392 yield* harness.initialize;
393 - yield* harness.provider.snapshotForCwd("/workspace", []);
394 - // The thread adapter reports the cwd on session start; command updates arrive without one.
393 yield* harness.provider.onSessionStarted(started, "/workspace");
396 - yield* harness.provider.onAvailableCommands(commands);
394 + yield* harness.provider.onAvailableCommands(commands, "/workspace");
395 + // The catalog probe runs in a scratch directory and reports no cwd.
396 + yield* harness.provider.onAvailableCommands(commands.slice(1));
397 expect((yield* harness.provider.snapshotForCwd("/workspace")).slashCommands).toEqual(
398 expectedCommands,
399 );
400 + expect((yield* harness.provider.snapshot.getSnapshot).slashCommands).toEqual(
401 + expectedCommands.slice(1),
402 + );
403 }),
404 );
405
apps/server/src/provider/AntigravityProvider.ts
+1 -9
@@ -456,15 +456,7 @@ export const makeAntigravityProvider = Effect.fn("makeAntigravityProvider")(func
456 },
457 ].slice(-MAX_WORKSPACE_SNAPSHOTS),
458 }
459 - : state.draft.workspaceSnapshots
460 - ? // Thread sessions report commands without a cwd; folder entries seeded on start follow.
461 - {
462 - workspaceSnapshots: state.draft.workspaceSnapshots.map((entry) => ({
463 - ...entry,
464 - slashCommands,
465 - })),
466 - }
467 - : {}),
459 + : {}),
460 },
461 };
462 });
apps/server/src/provider/Drivers/AntigravityDriver.ts
+2 -2
@@ -481,12 +481,12 @@ export const AntigravityDriver: ProviderDriver<
481 ),
482 profileDirectory,
483 onSessionStarted: provider.onSessionStarted,
484 - onSessionEvent: (event) => {
484 + onSessionEvent: (event, cwd) => {
485 if (event._tag === "ConfigOptionsUpdated") {
486 return provider.onConfigOptionsUpdated(event.configOptions);
487 }
488 return event._tag === "AvailableCommandsUpdated"
489 - ? provider.onAvailableCommands(event.availableCommands)
489 + ? provider.onAvailableCommands(event.availableCommands, cwd)
490 : Effect.void;
491 },
492 continuationRequests,
packages/provider-acp/src/server/adapter.ts
+3 -1
@@ -500,6 +500,7 @@ export interface AcpAdapterV2Flavor {
500 ) => ReadonlyArray<EffectAcpSchema.PermissionOption>;
501 readonly onSessionEvent?: (
502 event: AcpSessionRuntime.AcpSessionRuntimeEvent,
503 + cwd: string,
504 ) => Effect.Effect<void>;
505 readonly subagentsIdleOnTurnCompletion?: boolean;
506 readonly supportsCompaction?: boolean;
@@ -7022,7 +7023,8 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* (
7023 }
7024 return runRuntimeCallbackAtGeneration(
7025 handlerGeneration,
7025 - flavor.onSessionEvent?.(event) ?? Effect.void,
7026 + flavor.onSessionEvent?.(event, input.runtimePolicy.cwd ?? process.cwd()) ??
7027 + Effect.void,
7028 ).pipe(Effect.asVoid);
7029 }),
7030 Effect.forkIn(handlerOptions.scope ?? runtimeScope ?? sessionScope),