fix(commentary): give a denied agent a ready Markdown link to the Commentary page

Agents relayed the bare path as inline code, which the person cannot click.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2e3a19c2aa)
This commit is contained in:
Dotta committed 2026-11-07 09:31:00 -06:00
1 parent 5cbbc12f17
commit 096a7c0891
2 files changed
+2 -2

No files matched your search

@@ -136,7 +136,7 @@ describe("internal agent commentary through both transports", () => {
expect(response.status).toBe(403);
const body = await response.json() as { error: string; remediation?: string };
expect(body.error).toBe("Board access required");
expect(body.remediation).toContain(`/${company!.issuePrefix}/activity/commentary`);
expect(body.remediation).toContain(`[Commentary](/${company!.issuePrefix}/activity/commentary)`);
};
// Reading other agents' commentary is never a default agent grant.
expect(NEW_STANDARD_AGENT_DEFAULT_GRANT_KEYS).not.toContain("commentary:view");
+1 -1
View File
@@ -20,7 +20,7 @@ export function agentCommentaryRoutes(db: Db) {
async function denyAgentRead(companyId: string): Promise<never> {
const [company] = await db.select({ issuePrefix: companies.issuePrefix }).from(companies).where(eq(companies.id, companyId)).limit(1);
throw forbidden("Board access required", company ? {
remediation: `Agents read only their own commentary unless granted commentary:view. People with commentary access can read it at /${company.issuePrefix}/activity/commentary.`,
remediation: `Agents read only their own commentary unless granted commentary:view. People with commentary access can read it on the Commentary page; give them this link: [Commentary](/${company.issuePrefix}/activity/commentary).`,
} : undefined);
}