Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(acp): send slash commands without an extra context block #19537

ClosedStiensWout(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/19537/headopened View on GitHub

Showing 3 changed files with 34 additions and 14 deletions.

x
0 of 3 viewed, 3 left
11 additions and 4 deletionsapps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.tsModified
View file
@@ -846,15 +846,22 @@
if (method === undefined) continue;
methods.push(method);
if (method === "session/prompt") {
- return { methods, prompt: rawProtocolPromptText(event) };
+ return {
+ methods,
+ prompt: rawProtocolPromptText(event),
+ blocks: rawProtocolRequestParam(event, "prompt"),
+ };
});
​
- const command = yield* runTurn(0, defaultPolicy, "/compact");
- assert.isTrue(command.prompt.startsWith("/compact"));
- assert.notInclude(command.prompt, "<t3_code_instructions>");
+ // Agents such as Copilot only expand a native slash command when it is
+ // the prompt's only text block and starts with `/`, so no T3 context may
+ // ride along and leading whitespace is dropped.
+ const command = yield* runTurn(0, defaultPolicy, " /compact now");
+ assert.deepStrictEqual(command.blocks, [{ type: "text", text: "/compact now" }]);
const firstDefault = yield* runTurn(1, defaultPolicy, "First default request.");
+ assert.include(firstDefault.prompt, "<runtime_info>");
assert.include(firstDefault.prompt, "T3 Code interaction mode: Default");
assert.include(firstDefault.prompt, "T3 Code collaborative browser");
assert.include(firstDefault.prompt, "T3 Code orchestration");
14 additions and 8 deletionspackages/provider-acp/src/server/adapter.tsModified
View file