Skip to content

Commit d020cec

Browse files
committed
Preserve slash commands when adding file-link guidance
1 parent 5e87aa6 commit d020cec

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/packages/ai/acp/codex.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,13 +1453,19 @@ export class CodexAcpAgent implements AcpAgent {
14531453
this.handler.setStream(stream);
14541454

14551455
try {
1456+
const isSlashCommand = /^\s*\/\w+/.test(prompt);
1457+
const promptText = isSlashCommand
1458+
? prompt
1459+
: `${FILE_LINK_GUIDANCE}\n\n${prompt}`;
14561460
const request: PromptRequest = {
14571461
sessionId: session.sessionId,
14581462
prompt: [
14591463
{
14601464
type: "text",
1461-
// Prepend guidance so file mentions become clickable links in CoCalc.
1462-
text: `${FILE_LINK_GUIDANCE}\n\n${prompt}`,
1465+
// Prepend guidance so file mentions become clickable links in CoCalc,
1466+
// but leave slash-commands (e.g. /compact) untouched so Codex ACP
1467+
// can intercept them.
1468+
text: promptText,
14631469
},
14641470
],
14651471
};

0 commit comments

Comments
 (0)