From 899defd4da419f8c1cea4782b2f275595d930f81 Mon Sep 17 00:00:00 2001 From: Dotta Date: Sun, 8 Nov 2026 03:29:13 -0600 Subject: [PATCH] fix(chat): link the agent profile page that holds a control, including API keys The agent API keys page left the profile navigation in the Refine-v2 layout, so a chat reply saying "open Morgan's profile and use the API keys section" sent people to a page with no such section. Chat guidance now tells agents to link the profile subpage that holds the control (/api-keys, /identity, /runtime, /secrets, /permissions). Co-Authored-By: Claude Opus 5.5 --- server/src/__tests__/agent-conversations.test.ts | 7 +++++++ server/src/services/agent-conversations.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/src/__tests__/agent-conversations.test.ts b/server/src/__tests__/agent-conversations.test.ts index f15941fdd71..5d76736fa37 100644 --- a/server/src/__tests__/agent-conversations.test.ts +++ b/server/src/__tests__/agent-conversations.test.ts @@ -994,6 +994,13 @@ describe("chat prompt policy", () => { expect(prompt).toContain("//agents/"); }); + it("tells chat to link the agent profile page that holds a control, including the unlisted API keys page", () => { + expect(AGENT_CHAT_DIRECTIVE).toContain("//agents//api-keys for API keys"); + expect(AGENT_CHAT_DIRECTIVE).toContain("The API keys page is not in the profile's navigation"); + const prompt = buildPaperclipTaskMarkdown({ issue: { id: "chat", identifier: "RUN-1", title: "Chat", workMode: "ask", conversationAgentId: "agent" } }); + expect(prompt).toContain("//agents//api-keys"); + }); + it("says how to read the company link prefix from a task identifier so agent links are not guessed", () => { expect(AGENT_CHAT_DIRECTIVE).toContain("The company prefix is the part of a task identifier before its final hyphen and number: for task RUN-1 the prefix is RUN."); expect(AGENT_CHAT_DIRECTIVE).toContain("Never build a prefix from the company name"); diff --git a/server/src/services/agent-conversations.ts b/server/src/services/agent-conversations.ts index 9df89f9ecbc..66e0f6ee97a 100644 --- a/server/src/services/agent-conversations.ts +++ b/server/src/services/agent-conversations.ts @@ -112,7 +112,7 @@ For review or follow-up tasks, include the existing source materials the assigne For task links, use the company-prefixed relative path //issues/. The company prefix is the part of a task identifier before its final hyphen and number: for task RUN-1 the prefix is RUN. This conversation's own task identifier gives it, and every company link below (tasks, approvals, runs, agent profiles) uses that same prefix. Never build a prefix from the company name, a slug, a hostname or a file path. Write every company link as a Markdown link, such as [Review the approval](//approvals/): a bare path or a path in inline code is not clickable in this conversation. Start each link target with exactly one slash: a target beginning with //, such as ///issues/, points to a different website. For approval links, use //approvals/ with the same company prefix and the returned approval id, so the person can open the approval to decide it. An absolute URL is appropriate only when its actual origin was supplied by the platform. Never invent a hostname for a Paperclip link. For an execution run, link //agents//runs/ using the run's returned agentId. Issue run listings (GET /api/issues/{id}/runs) return the run ID as runId; use id only from responses that return the run itself, such as GET /api/heartbeat-runs/{runId}. Run listings return agent IDs, not names: read the agent and name it rather than showing a raw ID. -When a reply concerns a specific agent, such as one you paused, resumed, configured, or reported on, link its profile at //agents/ using the agent's returned urlKey or id. A profile link is not a mention: use agent:// only when you intend to notify that agent. +When a reply concerns a specific agent, such as one you paused, resumed, configured, or reported on, link its profile at //agents/ using the agent's returned urlKey or id. A profile link is not a mention: use agent:// only when you intend to notify that agent. When you send a person to a control on an agent's profile, link the page that holds it instead of the bare profile: //agents//api-keys for API keys, /identity for identity and instructions, /runtime for harness settings, /secrets for secrets and variables, /permissions for permissions. The API keys page is not in the profile's navigation, so its link is the only way to reach it from chat. When a reply lists many tasks, write each task identifier in full, such as RUN-12, RUN-13, RUN-14. This conversation links each full identifier to its task, but a range such as RUN-12–14 links only its first task and leaves the others without a source link. When a complete list is too long to read in the reply, save it as a document on this conversation's task and link it, such as [Open work by owner](//issues/#document-), keeping a short summary with the counts in the reply.