Skip to content

Thread ProviderModelSelector's loading gate to the remaining provider pickers #6087

Description

@atomantic

Problem

ProviderModelSelector now takes a loading prop that disables its selects and renders "Loading providers…" instead of the caller's emptyProviderOption while the provider list is in flight. Without it, an empty providers array renders a picker whose only option is "Default (active provider)" / "Inherit (…)" — indistinguishable from a broken control.

The prop is wired for the CoS Schedule tab only (card quick-pins, plus all three pickers in the task config drawer). Every other picker still shows the bare sentinel during its own fetch window.

Sites still unwired

CoS page — same providers state, same in-flight window, already available at the render site as providersLoaded:

  • client/src/pages/ChiefOfStaff.jsxTasksTab, AgentsTab, WorkflowTab receive providers but not providersLoaded.
  • TasksTabTaskAddForm (~9 providers= call sites via TaskItem/SortableTaskItem) — note TaskAddForm also clears a pinned provider whenever enabledProviders is empty, which mid-fetch it always is; the flag prevents that by construction.
  • AgentsTabRelaunchAgentModal, ResumeAgentModal (emptyProviderOption="Auto (default)").
  • WorkflowTabAppOverridePanelAppProviderPin (already accepts loading, just needs threading).

Pickers that fetch through useProviderModels: the hook already returns a loading flag for free at ~40 call sites; only 5 consume it (LoomEpisodeFeedback, LoomSeriesPlan, LoomEditorialAutomation, FableLoom, LoomEpisodeOutlinePlanner), and all 5 reach only disabled, never the label. Pass loading={loading} instead.

Also worth doing

getApps() and getCosLearningSummary() in ChiefOfStaff.fetchData still sit in the Promise.all whose tail is getCosActionableInsights (which fans out to cos.runHealthCheck() and detectIdleLeftoverBranches() — git work across repos). apps feeds the Schedule/Tasks/Agents app pickers, so it has the same user-visible empty-control symptom. The fix is the same .then(applyX) split; reuse the sameJsonShape identity guard so the earlier commit doesn't add a re-render per poll.

Acceptance

  • No provider picker in the app renders a lone emptyProviderOption while its list is still fetching.
  • apps commits on its own settle, with a sameJsonShape guard.

Follow-up to the Schedule-tab fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

effort:lowEffort: lowin-progressClaimed and being workedmodel:lightModel size: lightplanTracked by /do:replanplanner:opus-5Plan authored by the opus-5 modeluxProposed from a UX/design audit

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions