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
Keep the generic provider chain for an effort-only orchestration role
Adam Eivy968dfd835773
diff --git a/server/services/agentProviderResolution.js b/server/services/agentProviderResolution.jsindex cecb11d4e7..54c4e54882 100644--- a/server/services/agentProviderResolution.js+++ b/server/services/agentProviderResolution.js@@ -168,7 +168,12 @@ async function resolveOrdinaryProviderAndModel(task) {// `direct`-mode runs keep the pin → active → fallback chain untouched// (`roleAssignment` returns null for every role on one).const laneRole = PRIMARY_ORCHESTRATION_ROLE;- const lane = roleAssignment(task, laneRole);+ const roleAssign = roleAssignment(task, laneRole);+ // Fail-closed applies only to a role that pinned WHERE it runs. A role+ // carrying nothing but an `effort` rung has expressed no vendor or model+ // preference to protect, so refusing to substitute for it would strand a run+ // over a choice the user never made — it keeps the ordinary chain.+ const lane = roleAssign?.provider || roleAssign?.model ? roleAssign : null;const userProviderId = lane?.provider || task.metadata?.provider;let userProviderMissing = false;if (userProviderId) {@@ -426,10 +431,10 @@ async function resolveOrdinaryProviderAndModel(task) {// happened (#5993): the role this run was dispatched as, the provider it// ACTUALLY ran on, and the one substitution — if any — the lane accepted.// Absent on a `direct`-mode run, which has no roles to account for.- ...(lane ? {+ ...(roleAssign ? {orchestrationLane: {role: laneRole,- requestedProvider: lane.provider || directProviderId,+ requestedProvider: roleAssign.provider || directProviderId,providerId: provider.id,model: selectedModel,...(laneSubstitution ? { substitution: laneSubstitution } : {}),diff --git a/server/services/agentProviderResolution.test.js b/server/services/agentProviderResolution.test.jsindex 2e24dc8449..00360da91e 100644--- a/server/services/agentProviderResolution.test.js+++ b/server/services/agentProviderResolution.test.js@@ -657,3 +657,41 @@ describe('resolveAgentProviderAndModel — fail-closed orchestration lanes', ()expect(getFallbackProvider).toHaveBeenCalled();});});++/**+ * An `effort`-only role assignment pins a reasoning rung, not a vendor — there+ * is no cross-vendor split for the fail-closed rule to protect, so it must not+ * strand the run over a choice the user never made.+ */+describe('resolveAgentProviderAndModel — effort-only orchestration roles', () => {+ const effortOnly = {+ id: 'task-effort',+ metadata: {+ orchestrationMode: 'orchestrated',+ orchestrationProfile: { architect: { effort: 'high' } },+ },+ };++ it('keeps the generic fallback chain for a role that pins no provider or model', async () => {+ const primary = { id: 'p1', type: 'cli' };+ const fallback = { id: 'p2', type: 'cli', models: ['m-fb'] };+ getActiveProvider.mockResolvedValue(primary);+ isProviderAvailable.mockReturnValue(false);+ getProviderStatus.mockReturnValue({ message: 'usage-limit', reason: 'limit' });+ getAllProviders.mockResolvedValue({ providers: [primary, fallback] });+ getFallbackProvider.mockResolvedValue({ provider: fallback, source: 'system', model: 'm-fb' });++ const r = await resolveAgentProviderAndModel(effortOnly);++ expect(r.ok).toBe(true);+ expect(r.provider).toBe(fallback);+ expect(getFallbackProvider).toHaveBeenCalled();+ // Still accounted for — the run WAS dispatched as the architect role.+ expect(r.orchestrationLane).toEqual({+ role: 'architect',+ requestedProvider: 'p1',+ providerId: 'p2',+ model: 'm-fb',+ });+ });+});