#2964·manifest

Allow disabling a harness's active-route provider (force bypass), and per-model disable

Author: bubbabrightCreated Sep 23, 2026Updated Sep 23, 2026

Use case

Running a daemon that tracks provider usage/cost (via provider APIs + web scraping) and wants to pull a depleted provider, or a specific depleted model on an otherwise-healthy provider, out of rotation for a harness without touching its route/fallback config, then restore it once the daemon sees it replenished. The harness's configured routes and fallback chains should stay exactly as-is, just skip the depleted target until re-enabled.

What exists today

DELETE /api/v1/agents/:agentName/enabled-providers/:tenantProviderId (AgentEnabledProvidersController.disable) already does the right thing at the data-model level: it removes the agent's row from agent_enabled_providers.

The resolver already handles the resulting state correctly. ProviderKeyService.filterProvidersForAgent excludes a disabled provider from that agent's usable providers, isRouteAvailable/hasRouteCredentials then report it unavailable, and ResolveService.buildResolvedRouteChain walks the tier's fallback chain automatically when the primary override is unavailable. This is real, working, tested logic. No new routing behavior needed for the mechanism itself.

Ask 1: force-bypass the disable guard

disable() calls findAffectedRoutes() first and throws ConflictException ("Can't disable provider while its models are assigned to this harness's routing. Update routing first.") whenever the provider being disabled is the harness's active primary route or appears in its fallback chain. That's exactly the case a usage-tracking daemon needs to hit: disable the provider that's currently serving, so the next request silently falls through to the configured fallback.

The guard makes sense as a UI default (stops an operator from accidentally disabling their only working provider without realizing it), but there's no way to opt out of it programmatically today.

Ask: a bypass for this specific call, e.g. DELETE .../enabled-providers/:tenantProviderId?force=true, that skips findAffectedRoutes() and proceeds straight to the delete + recalculateTiers()/cache-invalidate. Since the fallback-resolution path already works correctly for this state, force just needs to skip the pre-flight check, no other backend logic changes.

Ask 2: model-level disable, not just whole-provider

agent_enabled_providers only supports enable/disable at the whole-connection level. Individual models on the same connection carry their own separate usage/rate limits (model A exhausted, model B on the same key fine), and there's currently no way to pull a single model out of rotation while leaving sibling models on the same provider connection active.

Ask: a model-level analog, e.g. agent_disabled_models, or a disabled_models: string[] column on the existing enabled-provider row, checked in ProviderKeyService/isRouteAvailable the same way the provider-level table is checked now, so a route whose specific model is disabled falls through to fallback even though the rest of that provider's models stay usable.

Minimum viable version is just Ask 1 (the force flag) for the existing provider-level toggle, that unblocks the whole-provider case now. Model-level disable is the more useful long-term shape for real usage-based routing, flagging it here even if it lands as a separate follow-up.

Nice-to-have: a tenant-wide variant of either (disable this provider, or this specific model, for every harness that has it enabled, in one call), since depletion is usually a tenant-wide fact (one API key), not a per-harness one, and the current endpoint is per-agent only.

Environment

Self-hosted (Docker, manifestdotbuild/manifest), updated to latest, 2026-09-23. Confirmed by reading agent-enabled-providers.controller.ts and provider-key.service.ts/resolve.service.ts from source, and reproducing the ConflictException live against a throwaway harness.