From a19d5a35fc6d8b9e5f030c17bb68e8f9d00a0105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korm=C3=A1kur?= Date: Sat, 13 Jun 2026 00:06:39 +0000 Subject: [PATCH] fix(coding-agent): mark rpc skill prompts as agent work --- packages/coding-agent/src/modes/rpc/rpc-mode.ts | 13 +++++++++---- .../coding-agent/test/rpc-skill-command.test.ts | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/coding-agent/src/modes/rpc/rpc-mode.ts b/packages/coding-agent/src/modes/rpc/rpc-mode.ts index a718c0ab1..cab11f7e2 100644 --- a/packages/coding-agent/src/modes/rpc/rpc-mode.ts +++ b/packages/coding-agent/src/modes/rpc/rpc-mode.ts @@ -80,8 +80,12 @@ export type RpcSessionChangeResult = export type RpcSessionChangeSession = Pick; export type RpcSkillCommandSession = Pick; +export type RpcSkillCommandResult = { agentInvoked: true }; -export async function tryRunRpcSkillCommand(session: RpcSkillCommandSession, text: string): Promise { +export async function tryRunRpcSkillCommand( + session: RpcSkillCommandSession, + text: string, +): Promise { if (!text.startsWith("/skill:")) return false; if (!session.skillsSettings?.enableSkillCommands) return false; const spaceIndex = text.indexOf(" "); @@ -98,7 +102,7 @@ export async function tryRunRpcSkillCommand(session: RpcSkillCommandSession, tex details: built.details, attribution: "user", }); - return true; + return { agentInvoked: true }; } export function reportLocalOnlyPromptResult(input: { @@ -635,8 +639,9 @@ export async function runRpcMode( // ================================================================= case "prompt": { - if (await tryRunRpcSkillCommand(session, command.message)) { - return success(id, "prompt", { agentInvoked: false }); + const skillResult = await tryRunRpcSkillCommand(session, command.message); + if (skillResult) { + return success(id, "prompt", skillResult); } const builtinResult = await executeAcpBuiltinSlashCommand(command.message, { session, diff --git a/packages/coding-agent/test/rpc-skill-command.test.ts b/packages/coding-agent/test/rpc-skill-command.test.ts index 2fc4eb8e1..7a9f56866 100644 --- a/packages/coding-agent/test/rpc-skill-command.test.ts +++ b/packages/coding-agent/test/rpc-skill-command.test.ts @@ -30,7 +30,7 @@ describe("tryRunRpcSkillCommand", () => { "/skill:reviewer focus on risks", ); - expect(handled).toBe(true); + expect(handled).toEqual({ agentInvoked: true }); expect(message?.customType).toBe(SKILL_PROMPT_MESSAGE_TYPE); expect(message?.content).toContain("Review the supplied code carefully."); expect(message?.content).toContain("User: focus on risks");