Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(acp): slash commands reach the agent as a single prompt block #19396

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

Showing 3 changed files with 105 additions and 9 deletions.

x
0 of 3 viewed, 3 left
88 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.tsModified
View file
@@ -886,6 +886,94 @@
}).pipe(Effect.provide(layerTest), Effect.scoped),
​
+ it.live("sends a slash command as the only ACP prompt block", () =>
+ Effect.gen(function* () {
+ const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
+ const path = yield* Path.Path;
+ const selfInvocation = yield* resolveSelfInvocation();
+ const mockAgentPath = yield* path.fromFileUrl(
+ new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
+ );
+ const protocolEvents = yield* Queue.unbounded<EffectAcpProtocol.AcpProtocolLogEvent>();
+ const instanceId = ProviderInstanceId.make("acp-test-slash-single-block");
+ const threadId = ThreadId.make("thread-acp-slash-single-block");
+ yield* (yield* McpProviderSessions.McpProviderSessions).set({
+ environmentId: EnvironmentId.make("environment-acp-slash-single-block"),
+ threadId,
+ providerSessionId: "mcp-session-acp-slash-single-block",
+ providerInstanceId: instanceId,
+ endpoint: "http://127.0.0.1:43123/mcp",
+ authorizationHeader: "Bearer slash-single-block-token",
+ browserToolsAvailable: false,
+ });
+ const adapter = yield* makeAcpAdapterV2({
+ instanceId,
+ flavor: {
+ driver: ACP_TEST_DRIVER,
+ capabilities: AcpProviderCapabilitiesV2,
+ makeRuntime: makeMockRuntime({ childProcessSpawner, mockAgentPath, protocolEvents }),