Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/provider-acp/src/server/runtimeModel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,20 @@ describe("extractMcpToolCallIdentity", () => {
}
});

it("recovers T3 identity from Kiro's @-scoped titles", () => {
for (const tool of ["html_render", "t3_thread_read", "delegate_task"]) {
const toolCall = toolCallFromUpdate({
sessionUpdate: "tool_call",
toolCallId: "kiro-1",
kind: "other",
title: `@t3-code/${tool}`,
status: "pending",
rawInput: { tool_id: `t3-code::${tool}`, arguments: { threadId: "thread-1" } },
});
expect(extractMcpToolCallIdentity(toolCall), tool).toEqual({ server: "t3-code", tool });
}
});

it("does not claim an agent's own tool that shares a T3 tool name", () => {
const toolCall = toolCallFromUpdate({
sessionUpdate: "tool_call",
Expand Down
4 changes: 2 additions & 2 deletions packages/provider-acp/src/server/runtimeModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1067,9 +1067,9 @@ function acpMcpFallbackInput(value: string | undefined): Record<string, unknown>
return undefined;
}

// Known T3 inventory gates matches, so server-name separators can stay loose.
// Known T3 inventory gates matches, so server-name separators can stay loose. Kiro titles "@t3-code/<tool>".
const T3_MCP_TITLE_CALL =
/^(?:mcp[-_]{1,2})?t3[-_ ]?code[-_.:/ ]{1,3}(?<tool>[A-Za-z0-9][A-Za-z0-9_.-]*)(?::.*)?$/i;
/^(?:@|mcp[-_]{1,2})?t3[-_ ]?code[-_.:/ ]{1,3}(?<tool>[A-Za-z0-9][A-Za-z0-9_.-]*)(?::.*)?$/i;

const T3_MCP_TITLE_SUFFIX_CALL =
/^(?<tool>[A-Za-z0-9][A-Za-z0-9_.-]*?)(?: \(t3[-_ ]?code MCP Server\)(?::|$)|[-_.]t3[-_ ]?code$)/i;
Expand Down
Loading