Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(acp): preserve native slash command prompt shape #19393

MergedExotic209093(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/19393/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 39 additions and 25 deletions.

x
0 of 2 viewed, 2 left
29 additions and 18 deletionsapps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.tsModified
View file
@@ -515,19 +515,19 @@
return typeof params === "object" && params !== null ? Reflect.get(params, key) : undefined;
​
-function rawProtocolPromptText(event: EffectAcpProtocol.AcpProtocolLogEvent): string {
+function rawProtocolPromptTextBlocks(
+ event: EffectAcpProtocol.AcpProtocolLogEvent,
+): Array<{ type: "text"; text: string }> {
const prompt = rawProtocolRequestParam(event, "prompt");
- if (!Array.isArray(prompt)) return "";
- return prompt
- .flatMap((block) =>
- typeof block === "object" &&
- block !== null &&
- Reflect.get(block, "type") === "text" &&
- typeof Reflect.get(block, "text") === "string"
- ? [Reflect.get(block, "text") as string]
- : [],
- )
- .join("\n");
+ if (!Array.isArray(prompt)) return [];
+ return prompt.flatMap((block) =>
+ typeof block === "object" &&
+ block !== null &&
+ Reflect.get(block, "type") === "text" &&
+ typeof Reflect.get(block, "text") === "string"
+ ? [{ type: "text" as const, text: Reflect.get(block, "text") as string }]
+ : [],
+ );