Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

The working line no longer stalls on a long tool name

Sebastien Tardif0cc72e480bfd
diff --git a/src/lib/friendly-activity.test.ts b/src/lib/friendly-activity.test.ts
index 7d3f16da16..ff7b7b8610 100644
--- a/src/lib/friendly-activity.test.ts
+++ b/src/lib/friendly-activity.test.ts
@@ -37,9 +37,12 @@ describe("Simple mode's working line", () => {
it("says which outside service the bot is working in", () => {
expect(toolService("mcp__notion__search")).toBe("Notion");
expect(toolService("mcp__composio__GMAIL_SEND_EMAIL")).toBe("Gmail");
+ expect(toolService("mcp__my-server__do-thing")).toBe("My-server");
expect(toolService("mcp__ogb__ask_user")).toBeNull();
expect(toolService("Bash")).toBeNull();
+ expect(toolService(`mcp__${"a-".repeat(40)}`)).toBeNull();
expect(friendlyNowPhrases(null, running("mcp__notion__search")).phrases).toEqual(["Working in Notion"]);
+ expect(friendlyNowPhrases(null, running(`mcp__${"a-".repeat(40)}`)).phrases).toEqual(["Thinking it through", "Mulling it over", "Working on it", "Chipping away"]);
});
it("says what a page or write-up makes, never the file's name", () => {
diff --git a/src/lib/friendly-activity.ts b/src/lib/friendly-activity.ts
index 755e101b0f..006ea84690 100644
--- a/src/lib/friendly-activity.ts
+++ b/src/lib/friendly-activity.ts
@@ -24,7 +24,7 @@ const OWN_SERVERS = new Set(["ogb", "agents", "omb", "openmausbot", "computer",
/** The outside service a tool call works in, by its MCP server or a connected-app tool's name, as a person names it. */
export function toolService(name: string | undefined): string | null {
- const server = /^mcp__([^_]+(?:-[^_]+)*)__(.+)$/.exec(name ?? "");
+ const server = /^mcp__([^_]+)__(.+)$/.exec(name ?? "");
if (!server) return null;
const [, id, tool] = server;
if (OWN_SERVERS.has(id!.toLowerCase())) return null;