Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
show benched (runtime-unavailable) state on the AI Providers page
[._.]/ Adam Eivy00560e49b4a2
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex af7cb4c553..38b92d3e89 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -2,6 +2,8 @@## Added+- **The AI Providers page now shows runtime availability, not just the enable toggle.** An enabled provider can still be *benched* (runtime-unavailable) after a failure — a usage limit, auth error, or `model-not-found` — and silently skipped in favor of a fallback, which made "but it's enabled!" confusing. Each enabled-but-unavailable provider now shows an **UNAVAILABLE · {reason}** badge plus a detail panel with the underlying error message ("Why: …"), the auto-retry ETA, and a **Recover now** button (clears the bench so the next call retries it — though a persistent cause like an invalid model id will simply re-bench on the next failure). The availability map refreshes every 20s so a badge appears/clears on its own. Reads the existing `GET /api/providers/status` (`available`/`reason`/`message`/`timeUntilRecovery`) — `enabled` is the user toggle, this is the separate runtime-health state the fallback router acts on. (`client/src/pages/AIProviders.jsx`)+- **Ship a "Claude Code TUI: Bedrock" provider option.** Installs that run Claude Code against Amazon Bedrock can now drive the interactive TUI on Bedrock without hand-editing `providers.json` — the seed (`data.reference/providers.json`, plus the toolkit fallback sample) now includes a `claude-code-tui-bedrock` provider alongside the existing `claude-code-tui` (Anthropic-native) and `claude-code-bedrock` (Bedrock CLI), completing the native/Bedrock × CLI/TUI matrix. Like the Bedrock CLI it ships **disabled with an empty `AWS_BEARER_TOKEN_BEDROCK`** (opt-in; no secret in git) and its `secretEnvVars` marks the token so the UI masks it and cross-install sync withholds it. Existing installs pick it up via `setup-data.js`'s `providers` merge on the next run, without touching their customized providers. (`data.reference/providers.json`, `server/lib/aiToolkit/defaults/providers.sample.json`)- **Video LoRAs now fuse on the bf16 LTX-2.3 Unified Beta (mlx_video runtime), not just dgrauet** — Previously a video LoRA like `ltx2.3-audio-reactive-lora` only worked on the dgrauet `ltx2` runtime; selecting the higher-quality **LTX-2.3 Unified Beta** (notapalindrome's `mlx_video` runtime) silently hid the LoRA picker. The stock `mlx_video.generate_av` CLI has no `--lora` flag, but the `mlx-video-with-audio` package ships an LTX-aware LoRA subsystem (`mlx_video.lora`) that's simply never called from the AV generator. A new wrapper (`scripts/generate_av_lora.py`) closes that gap without reimplementing the ~1000-line generation loop: it loads the user LoRAs, monkeypatches generate_av's two transformer-weight load seams to merge the LoRA deltas into the transformer (bf16, `quantization_bits=0`), then runs generate_av's own `main()` — so the SSE progress protocol is byte-for-byte identical to the non-LoRA path. The VideoGen picker now appears for non-quantized LTX-2.x `mlx_video` models too (gated by `isMlxVideoLtxLoraCapable`); if a LoRA's keys don't match the model the render fails loudly rather than silently producing a base video. Scoped to bf16 — the quantized Distilled Q4/Q8 variants stay on the dgrauet path for now and show an inline hint pointing at the supported models. (`scripts/generate_av_lora.py`, `server/lib/runners.js`, `server/services/videoGen/local.js`, `server/routes/videoGen.js`, `client/src/lib/runnerFamilies.js`, `client/src/pages/VideoGen.jsx`)diff --git a/client/src/pages/AIProviders.jsx b/client/src/pages/AIProviders.jsxindex 6125cde161..5fee77c75e 100644--- a/client/src/pages/AIProviders.jsx+++ b/client/src/pages/AIProviders.jsx@@ -17,6 +17,8 @@ import CodeReviewDefaultsPanel from '../components/providers/CodeReviewDefaultsPexport default function AIProviders() {const [providers, setProviders] = useState([]);+ const [statuses, setStatuses] = useState({}); // runtime availability by providerId (separate from the `enabled` toggle)+ const [recovering, setRecovering] = useState({});const [activeProviderId, setActiveProviderId] = useState(null);const [loading, setLoading] = useState(true);const [showForm, setShowForm] = useState(false);@@ -67,18 +69,48 @@ export default function AIProviders() {const loadData = async () => {setLoading(true);- const [providersData, appsData, runsData] = await Promise.all([+ const [providersData, appsData, runsData, statusData] = await Promise.all([api.getProviders().catch(() => ({ providers: [], activeProvider: null })),api.getApps().catch(() => []),- api.getRuns(20).catch(() => ({ runs: [] }))+ api.getRuns(20).catch(() => ({ runs: [] })),+ api.getProviderStatuses().catch(() => ({ providers: {} }))]);setProviders(providersData.providers || []);setActiveProviderId(providersData.activeProvider);setApps(appsData);setRuns(runsData.runs || []);+ setStatuses(statusData.providers || {});setLoading(false);};+ // Refresh just the runtime availability map (cheap) so a bench badge appears+ // when a provider fails elsewhere and clears itself once its recovery window+ // passes (the server expires `estimatedRecovery` on read), without a full reload.+ const refreshStatuses = useCallback(async () => {+ const statusData = await api.getProviderStatuses().catch(() => null);+ if (statusData?.providers) setStatuses(statusData.providers);+ }, []);++ useEffect(() => {+ const id = setInterval(refreshStatuses, 20000);+ return () => clearInterval(id);+ }, [refreshStatuses]);++ // Clear a provider's bench (runtime unavailability) so the next call retries it.+ // Note: if the underlying cause persists (e.g. an invalid model id), the very+ // next failure re-benches it — recovery is "try again now", not "fix the cause".+ const handleRecover = async (id) => {+ setRecovering(prev => ({ ...prev, [id]: true }));+ const result = await api.recoverProvider(id).catch(() => null);+ if (result) {+ setStatuses(prev => ({ ...prev, [id]: { ...prev[id], available: true, reason: 'ok', message: 'Provider available', timeUntilRecovery: null } }));+ toast.success('Provider marked available — it will be retried on the next call');+ } else {+ toast.error('Could not clear the provider status');+ }+ setRecovering(prev => ({ ...prev, [id]: false }));+ };+const handleSetActive = async (id) => {if (!id) return;const result = await api.setActiveProvider(id).catch(() => null);@@ -419,8 +451,40 @@ export default function AIProviders() {DISABLED</span>)}+ {/* Runtime availability is independent of the `enabled` toggle: an+ enabled provider can still be benched after a failure (usage+ limit, model-not-found, auth) and skipped in favor of a fallback. */}+ {provider.enabled && statuses[provider.id]?.available === false && (+ <span+ className="text-xs px-2 py-0.5 rounded bg-port-error/20 text-port-error"+ title={statuses[provider.id]?.message || ''}+ >+ UNAVAILABLE{statuses[provider.id]?.reason ? ` · ${statuses[provider.id].reason}` : ''}+ </span>+ )}</div>+ {provider.enabled && statuses[provider.id]?.available === false && (+ <div className="mt-2 text-xs rounded border border-port-error/40 bg-port-error/10 px-3 py-2 text-port-error space-y-1">+ <p className="break-words">+ <span className="font-semibold">Benched ({statuses[provider.id]?.reason || 'unknown'})</span>+ {statuses[provider.id]?.timeUntilRecovery ? ` — auto-retries in ${statuses[provider.id].timeUntilRecovery}` : ''}+ . Calls route to the fallback until then.+ </p>+ {statuses[provider.id]?.message && (+ <p className="break-words text-port-error/80">Why: {statuses[provider.id].message}</p>+ )}+ <button+ type="button"+ onClick={() => handleRecover(provider.id)}+ disabled={recovering[provider.id]}+ className="mt-1 px-2 py-0.5 rounded bg-port-error/20 hover:bg-port-error/30 disabled:opacity-50 text-port-error"+ >+ {recovering[provider.id] ? 'Clearing…' : 'Recover now'}+ </button>+ </div>+ )}+<div className="mt-2 text-sm text-gray-400 space-y-1">{isProcessProvider(provider) && (<p className="break-words">Command: <code className="text-gray-300 break-all">{provider.command} {provider.args?.join(' ')}</code></p>