fix(ui): remove duplicate audit links from agent overview (#17867)

<!-- Write all pull request text in Simplified Technical English
(ASD-STE100): short sentences, one instruction per sentence, simple
approved vocabulary, and the active voice. -->

## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The agent detail page shows an overview of one agent in the board UI
> - The streamlined shell shows the agent contextual sidebar beside this
page
> - The sidebar has an Audit group with Activity, Runs, Costs, and
Budgets links
> - The overview also ends with an Audit card grid that has the same
four links
> - The duplicate links add noise and make the overview longer with no
benefit
> - This pull request removes the Audit card grid from the agent
overview
> - The benefit is a shorter overview with one clear place for audit
navigation

## Linked Issues or Issue Description

**What existing behavior does this improve?**

The agent overview page shows a section of Audit link cards at the end
of the page.

**Current behavior**

The overview shows four cards: Activity, Runs, Costs, and Budgets. Each
card opens the company audit page, filtered to the agent. The agent
contextual sidebar shows the same four links. Both use
`agentScopedAuditHref`. #12746 added the sidebar links. #12747 added the
overview cards in the same PR stack.

**Proposed behavior**

Remove the overview cards. Keep the sidebar Audit group as the single
entry point.

**Reason and benefit**

Operators see each audit link one time. The overview stays focused on
agent status and recent tasks.

## What Changed
- Remove the Audit card grid from the agent overview in
`ui/src/pages/AgentDetail.tsx`.
Before:
<img width="1488" height="377" alt="Screenshot 2026-10-27 at 5 33 29 PM"
src="https://github.com/user-attachments/assets/fd27fee2-63c4-420e-8b39-405e4a633f63"
/>

After:
<img width="1526" height="271" alt="Screenshot 2026-10-27 at 5 33 41 PM"
src="https://github.com/user-attachments/assets/bca0635d-3be6-42cd-b1d6-dc36b89ae1b0"
/>


## Verification

- Run `pnpm --filter ./ui exec tsc --noEmit`. The result is clean.
- Run `pnpm --filter ./ui exec vitest run src/pages/AgentDetail`. All 7
files and 56 tests pass.
- Run `pnpm check:token-gates`. All gates are clean.
- Manual check: opened an agent overview page. Made sure that the Audit
cards are not at the end of the page. Made sure that the sidebar Audit
links still open the agent-filtered audit pages.

## Risks
- Low risk. The change only removes UI markup.
- The agent-scoped audit routes and the legacy URL redirects do not
change.
- Operators who used the overview cards must use the sidebar Audit
links.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.

## Model Used
- Anthropic Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code. The
model used tool use, code search, git history inspection, and local test
execution. Reasoning mode: adaptive thinking.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SudheerandClaude Opus 5.5 authored and GitHub committed 2026-10-28 08:36:38 -07:00
1 parent 4a89456bb3
commit 2e5bbde8cc
2 files changed
+3 -17

No files matched your search

-15
View File
@@ -1882,21 +1882,6 @@ export function AgentOverview({
</div>
)}
</section>
<section className="space-y-3" aria-labelledby="agent-audit-links-heading">
<h3 id="agent-audit-links-heading" className="text-sm font-medium">Audit</h3>
<div className="grid gap-2 sm:grid-cols-2 lg:grid-cols-4">
{(["activity", "runs", "costs", "budgets"] as const).map((section) => (
<Link
key={section}
to={agentScopedAuditHref(agent.id, section)}
className="rounded-lg border border-border px-3 py-2 text-sm font-medium capitalize hover:bg-accent"
>
{section}
</Link>
))}
</div>
</section>
</div>
);
}
+3 -2
View File
@@ -40,7 +40,7 @@ describe("AgentOverview", () => {
expect(markup).not.toContain("old-runtime-model");
});
it("prioritizes identity, capability, runtime, skills, tasks, and scoped Audit entry points", () => {
it("prioritizes identity, capability, runtime, skills, and tasks without duplicating sidebar Audit links", () => {
const agent = {
id: "agent-1",
companyId: "company-1",
@@ -90,7 +90,8 @@ describe("AgentOverview", () => {
expect(markup).toContain("Design Guide");
expect(markup).toContain("Simplify agent information architecture");
expect(markup).toContain("PAP-42");
expect(markup).toContain('href="/activity/costs?agentId=agent-1"');
expect(markup).not.toContain("agent-audit-links-heading");
expect(markup).not.toContain("agentId=agent-1");
expect(markup).not.toContain("Run Activity");
expect(markup).not.toContain("Tasks by Status");
expect(markup).not.toContain("Created by");