Move CLI profile sync toggles to CLI Code (#5778)

* move CLI profile sync toggles to CLI Code

* test CLI profile auto-sync toggles

* Document CLI profile auto-sync flags

* docs(changelog): note CLI profile auto-sync card moved to CLI Code (#5778)

---------

Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com>
This commit is contained in:
Randi
2026-07-01 03:06:07 -04:00
committed by GitHub
parent 7581b752af
commit b50205fc5f
10 changed files with 185 additions and 52 deletions

View File

@@ -9,6 +9,7 @@ import { EXPECTED_CODE_COUNT } from "@/shared/schemas/cliCatalog";
import { CliToolCard, CliConceptCard, CliComparisonCard } from "@/shared/components/cli";
import { useToolBatchStatuses } from "@/shared/hooks/cli/useToolBatchStatuses";
import type { CliCatalogEntry } from "@/shared/schemas/cliCatalog";
import CliProfileAutoSyncToggles from "./components/CliProfileAutoSyncToggles";
// ── Static catalogue slice ────────────────────────────────────────────────────
@@ -58,7 +59,9 @@ export default function CliCodePageClient({ machineId: _machineId }: CliCodePage
useEffect(() => {
let cancelled = false;
fetch("/api/providers")
.then<ProvidersResponse>((res) => (res.ok ? res.json() : Promise.resolve({ connections: [] })))
.then<ProvidersResponse>((res) =>
res.ok ? res.json() : Promise.resolve({ connections: [] })
)
.then((data) => {
if (cancelled) return;
const active = (data.connections ?? []).filter((c) => c.isActive !== false);
@@ -99,8 +102,7 @@ export default function CliCodePageClient({ machineId: _machineId }: CliCodePage
return CODE_TOOLS.filter(([id, tool]) => {
// Search filter
if (q) {
const haystack =
`${tool.name} ${tool.vendor} ${tool.description}`.toLowerCase();
const haystack = `${tool.name} ${tool.vendor} ${tool.description}`.toLowerCase();
if (!haystack.includes(q)) return false;
}
@@ -131,6 +133,8 @@ export default function CliCodePageClient({ machineId: _machineId }: CliCodePage
{/* Comparison card */}
<CliComparisonCard currentType="code" />
<CliProfileAutoSyncToggles />
{/* Header bar */}
<div className="flex flex-col sm:flex-row sm:items-center gap-3 flex-wrap">
{/* Title + subtitle */}

View File

@@ -13,10 +13,10 @@ function isOn(value: string | undefined): boolean {
}
/**
* Providers-dashboard toggle card for the opt-in "auto-sync CLI profiles after model
* discovery" feature. Reads/writes the OMNIROUTE_AUTO_SYNC_{CODEX,CLAUDE}_PROFILES feature
* flags via /api/settings/feature-flags. Both default off; enabling one makes a provider
* model sync regenerate that tool's profile files from the live catalog.
* Toggle card for the opt-in "auto-sync CLI profiles after model discovery" feature.
* Reads/writes the OMNIROUTE_AUTO_SYNC_{CODEX,CLAUDE}_PROFILES feature flags via
* /api/settings/feature-flags. Both default off; enabling one makes a provider model
* sync regenerate that tool's profile files from the live catalog.
*/
export default function CliProfileAutoSyncToggles() {
const [codexOn, setCodexOn] = useState(false);

View File

@@ -43,7 +43,6 @@ import NoAuthProvidersSection from "./components/NoAuthProvidersSection";
import ProviderCard from "./components/ProviderCard";
import ProviderCountBadge from "./components/ProviderCountBadge";
import ProviderSummaryCard from "./components/ProviderSummaryCard";
import CliProfileAutoSyncToggles from "./components/CliProfileAutoSyncToggles";
import {
buildCompactProviderEntriesForPage,
getCompactProviderAuthType,
@@ -394,7 +393,8 @@ export default function ProvidersPage() {
// Count API keys in "warning" state across all connections
const warning = providerConnections.reduce((warnCount, conn) => {
const health = (conn as any).providerSpecificData?.apiKeyHealth as
Record<string, { status: string }> | undefined;
| Record<string, { status: string }>
| undefined;
if (!health) return warnCount;
return warnCount + Object.values(health).filter((h) => h.status === "warning").length;
}, 0);
@@ -865,8 +865,6 @@ export default function ProvidersPage() {
testingMode={testingMode}
/>
<CliProfileAutoSyncToggles />
{/* Expiration Banner */}
{expirations?.summary &&
(expirations.summary.expired > 0 || expirations.summary.expiringSoon > 0) && (