SIGN IN SIGN UP

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

0 0 73 Python

fix(frontend/library): autopilot pill counts copilot follow-ups only, not graph schedules (#13212)

## Why

Spotted in the screenshot below — the autopilot library pill on
`/library` was double-counting:

- The briefing's "**Scheduled 3**" tab already counts agents that have
schedules attached.
- My PR #13202 added an "**Autopilot library — 4 scheduled**" pill at
the bottom that sums copilot follow-ups + graph schedules (1 + 3 = 4).
- Reads as inconsistent ("3 vs 4") and dilutes the autopilot framing —
graph schedules aren't an autopilot/copilot concept, they're an agent
concept covered by the tab above.

Also: with the previous behaviour, a user who's never touched the
copilot but has 1 graph schedule would still see an "Autopilot library 1
scheduled" pill, even though they have no autopilot-specific content.

## What

- Drop graph-schedules query + count from the pill.
- Count copilot follow-ups only.
- Rename link label `X scheduled` → `X follow-up(s)` so the count
clearly belongs to autopilot.
- Pill still hides entirely when skills=0 AND follow-ups=0 (graph
schedules alone no longer surface the autopilot header — they belong to
the "Scheduled" briefing tab).
- Link destination unchanged — still `/library/followups`, which renders
BOTH copilot follow-ups AND graph schedules (the unification from #13202
stays useful at the destination).

## How

```diff
-import {
-  useGetV1ListExecutionSchedulesForAUser,
-  useListCopilotFollowupSchedules,
-} from "@/app/api/__generated__/endpoints/schedules/schedules";
+import { useListCopilotFollowupSchedules } from "@/app/api/__generated__/endpoints/schedules/schedules";
@@
-  const { data: graphsRes } = useGetV1ListExecutionSchedulesForAUser({…});
-  …
-  const scheduledCount = copilotFollowupsCount + graphSchedulesCount;
-  if (skillsCount === 0 && scheduledCount === 0) return null;
+  const followupCount = …;
+  if (skillsCount === 0 && followupCount === 0) return null;
@@
-  {scheduledCount} scheduled
+  {followupCount} follow-up{followupCount === 1 ? "" : "s"}
```

No new feature flag — count-based hide already keeps the pill quiet for
first-time users.

## Test coverage

Updated the BriefingTabContent vitest cases:

- `counts copilot follow-ups only (graph schedules are NOT folded in —
they have their own briefing tab)` — asserts graph schedules don't
inflate the count.
- `hides the pill entirely when skills=0 AND copilot follow-ups=0 (even
if graph schedules exist)` — asserts graph schedules alone don't surface
the autopilot label.
- `shows both links with a separator when skills AND follow-ups are
positive (singular pluralization)` — verifies `1 skill` / `1 follow-up`
singulars.

All 24 BriefingTabContent + 17 CostsBreakdown tests pass. Types clean.

## Out of scope

- No backend changes.
- Not changing the unified `/library/followups` destination page — it
correctly renders both kinds.

## Checklist

- [x] Code follows project style guidelines
- [x] Self-review performed
- [x] Tests added for new behaviour (graph-schedules-don't-count +
hide-on-zero with graph schedules present)
- [x] No new warnings
- [ ] CI green
Z
Zamil Majdy committed
6771f20cf8aab80a529b4a3d39efc599f69fef11
Parent: 4ff22cd
Committed by GitHub <noreply@github.com> on 5/25/2026, 10:43:33 AM