Skip to content

fix(agents): keep disabled custom agents visible in settings#3319

Merged
piorpua merged 3 commits into
iOfficeAI:mainfrom
szafranski:fix/disabled-agent-stays-visible-in-settings
Jun 14, 2026
Merged

fix(agents): keep disabled custom agents visible in settings#3319
piorpua merged 3 commits into
iOfficeAI:mainfrom
szafranski:fix/disabled-agent-stays-visible-in-settings

Conversation

@szafranski

Copy link
Copy Markdown
Contributor

What

Keep user-disabled custom agents visible (greyed, with a working re-enable toggle) in
Settings → Agents → Local Agents, instead of having them vanish from the whole UI.

Fixes #3318

Why

Toggling a custom agent off removed it from the entire UI, including the settings list that
hosts the re-enable toggle — so there was no way to turn it back on from the GUI. The
settings screen shared the same /api/agents data path as the pickers, so when the backend
dropped the disabled row it disappeared everywhere.

How

The fix keeps pickers untouched and gives the settings surface its own data path:

  • ipcBridge.ts: new sibling getManagedAgents bridge hitting
    /api/agents?include_disabled=true. getAvailableAgents (the picker path) is unchanged.
  • agentTypes.ts: new MANAGED_AGENTS_SWR_KEY + fetchManagedAgents, kept separate from
    the shared DETECTED_AGENTS_SWR_KEY so disabled agents never leak into the pickers.
  • useAgents.ts: new useManagedAgents() hook. Its revalidate refreshes both the
    management key and the shared detected key, so toggling an agent on/off in settings is
    immediately reflected in every picker.
  • LocalAgents.tsx: switched from useAgents() to useManagedAgents() so disabled custom
    agents stay listed. The existing toggle/create/delete handlers already call this hook's
    revalidate, so both caches stay in sync.
  • AgentCard.tsx: a disabled custom card now greys its identity block (subtle opacity) in
    addition to the already-disabled Start Chat button.

No new user-facing strings (the greyed state + disabled button communicate the state), so no
i18n changes.

Tests

bunx vitest run — added:

  • useManagedAgents: subscribes to the management key, and revalidate /
    refreshCustomAgents refresh both SWR keys (this is what makes a re-enabled agent
    reappear in pickers).
  • fetchManagedAgents: hits the include_disabled bridge (never the picker-safe one) and
    degrades to [] on failure / non-array.

Local checks

  • bun run format — clean
  • bun run lint — 0 errors (pre-existing warnings only)
  • bunx tsc --noEmit — clean
  • node scripts/check-i18n.js — passed
  • bunx vitest run — 1150 passed, 3 skipped

Coupling

This is the renderer half of a cross-repo fix. The backend half adds the include_disabled
query parameter to GET /api/agents and lives in iOfficeAI/AionCore#467. Both PRs are
coupled
— this change only works against an AionUi build whose bundled aioncore binary
includes that backend change, so the AionCore half must be bundled for the fix to function
in a release.

Disabling a custom agent removed it from the entire UI, including the
settings list that hosts the re-enable toggle, leaving no way to turn it
back on from the GUI.

The settings management surface now reads a dedicated management view of
/api/agents (include_disabled=true) via a separate SWR key, so a disabled
custom agent stays listed (greyed, with a working re-enable toggle).
Pickers keep using the shared detected key and the default filtered view,
so disabled agents stay hidden there. Toggling an agent revalidates both
keys, so re-enabling in settings makes it reappear in the pickers.

Requires the matching AionCore change that adds the include_disabled
query parameter to GET /api/agents.
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Adds a focused render test for LocalAgents proving it consumes the
include_disabled management view (useManagedAgents) and derives the
detected/custom sections, covering the previously untested component body.
@piorpua piorpua merged commit 46ecce4 into iOfficeAI:main Jun 14, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Disabling a custom agent removes it from the UI entirely — no way to re-enable it from settings

2 participants