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
fix: keep Code Animation route helpers within the dead-export contract (#9387)
[._.]/ Adam Eivyf51b6d16ffde
diff --git a/server/services/codeAnimation/preflight.js b/server/services/codeAnimation/preflight.jsindex a77e043f56..9916ca4a98 100644--- a/server/services/codeAnimation/preflight.js+++ b/server/services/codeAnimation/preflight.js@@ -12,7 +12,7 @@ import { ServerError } from '../../lib/errorHandler.js';const substitutionOf = requested => requested?.substitution === 'allowed' ? 'allowed' : 'pinned';/** Pure route capability map: what the selected route can honestly do. No tool or provider probe. */-export function routeCapabilities(provider, mode) {+function routeCapabilities(provider, mode) {const accepted = mode === 'api' || isVisionCapableCliProvider(provider) || isVisionCapableCodexTuiProvider(provider);return {packageImportExport: true,@@ -31,7 +31,7 @@ export function routeCapabilities(provider, mode) {* Compare the route that actually ran with the pinned route. Pinned mode throws on* any substitution; an opted-in substitution is returned as a recorded decision.*/-export function recordEffectiveRoute(resolved, requested, runResult) {+export function _recordEffectiveRoute(resolved, requested, runResult) {const ran = runResult?.fallbackProvider || runResult?.provider || null;const effective = { providerId: ran?.id ?? resolved.providerId, model: runResult?.model ?? resolved.model, effort: resolved.effort };const substituted = effective.providerId !== resolved.providerId || effective.model !== resolved.model || Boolean(runResult?.usedFallback);diff --git a/server/services/codeAnimation/preflight.test.js b/server/services/codeAnimation/preflight.test.jsindex dedfe075dc..4b51a14fe4 100644--- a/server/services/codeAnimation/preflight.test.js+++ b/server/services/codeAnimation/preflight.test.js@@ -11,7 +11,7 @@ vi.mock('../promptRunner.js', async importOriginal => ({ ...await importOriginalimport { getProjectRecord } from './projectStore.js';import { getProviderById, getSelectableProviders } from '../providers.js';import { runPromptThroughProvider } from '../promptRunner.js';-import { preflightProductionProject, recordEffectiveRoute } from './preflight.js';+import { preflightProductionProject, _recordEffectiveRoute } from './preflight.js';const app = express();app.use('/api/code-animation', router);@@ -85,11 +85,11 @@ describe('pinned route and substitution provenance', () => {expect(runPromptThroughProvider).not.toHaveBeenCalled();});it('refuses a silent fallback in pinned mode', () => {- expect(() => recordEffectiveRoute(resolved, {}, { provider: { id: 'other' }, usedFallback: true })).toThrow(/substituted/);+ expect(() => _recordEffectiveRoute(resolved, {}, { provider: { id: 'other' }, usedFallback: true })).toThrow(/substituted/);});it('records an opted-in substitution and passes an unchanged route through', () => {- const swapped = recordEffectiveRoute(resolved, { substitution: 'allowed' }, { provider: { id: 'example' }, fallbackProvider: { id: 'other' }, model: 'm2', usedFallback: true });+ const swapped = _recordEffectiveRoute(resolved, { substitution: 'allowed' }, { provider: { id: 'example' }, fallbackProvider: { id: 'other' }, model: 'm2', usedFallback: true });expect(swapped).toMatchObject({ substituted: true, effective: { providerId: 'other', model: 'm2' }, decision: { optedIn: true, from: 'example', to: 'other' } });- expect(recordEffectiveRoute(resolved, {}, { provider: { id: 'example' }, model: 'example-model' })).toMatchObject({ substituted: false, decision: null });+ expect(_recordEffectiveRoute(resolved, {}, { provider: { id: 'example' }, model: 'example-model' })).toMatchObject({ substituted: false, decision: null });});});