Skip to content

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

fix: keep fal image helpers private, document FAL_IMAGE_TIMEOUT_MS, mock quota-mode guard

[._.]/ Adam Eivy33c1594cf7a9
diff --git a/.env.example b/.env.example
index a7fee17bf3..e531985b2c 100644
--- a/.env.example
+++ b/.env.example
@@ -133,6 +133,14 @@ PGPASSWORD=portos
# jobs before it starts, so this bounds the whole submit→poll→download run.
# FAL_VIDEO_TIMEOUT_MS=1200000
+# Maximum fal.ai image-generation runtime in milliseconds (imageGen/fal.js;
+# default: 900000 / 15 minutes) — bounds the whole submit→poll→download run.
+# FAL_IMAGE_TIMEOUT_MS=900000
+
+# Maximum fal.ai image-generation runtime in milliseconds (imageGen/fal.js;
+# default: 900000 / 15 minutes) — bounds the whole submit→poll→download run.
+# FAL_IMAGE_TIMEOUT_MS=900000
+
# Maximum reactor.inc fast-h3 video-generation runtime in milliseconds
# (videoGen/reactor.js; default: 1200000 / 20 minutes) — same reasoning as
# FAL_VIDEO_TIMEOUT_MS above.
diff --git a/server/lib/falImageModels.js b/server/lib/falImageModels.js
index 4aad2e7535..dadb4fbc30 100644
--- a/server/lib/falImageModels.js
+++ b/server/lib/falImageModels.js
@@ -190,7 +190,7 @@ export const FAL_MEGAPIXEL = 1024 * 1024;
* units (FLUX.2 bills them);
* `outputPixels` is `{ w, h }` when known.
*/
-export function estimateFalImageCostUsd(family, { resolution = null, outputPixels = null, inputMegapixels = 0 } = {}) {
+function estimateFalImageCostUsd(family, { resolution = null, outputPixels = null, inputMegapixels = 0 } = {}) {
const { pricing } = family;
if (pricing.unit === 'megapixel') {
// FLUX.2's defaults when no size was sent: t2i renders landscape_4_3
diff --git a/server/services/imageGen/fal.js b/server/services/imageGen/fal.js
index 219a29bcdb..38adee43b8 100644
--- a/server/services/imageGen/fal.js
+++ b/server/services/imageGen/fal.js
@@ -148,7 +148,7 @@ export async function checkConnection({ model } = {}) {
* spelled out here as prose, with the same fidelity + reference wording the
* CLI prompt builders share (describeFidelity / visualReferenceRole).
*/
-export function buildFalPrompt({ prompt, hasInitImage = false, initImageStrength, referenceCount = 0 }) {
+function buildFalPrompt({ prompt, hasInitImage = false, initImageStrength, referenceCount = 0 }) {
const lines = [prompt.trim()];
if (hasInitImage) {
lines.push(`The first attached image is the source image to edit — ${describeFidelity(initImageStrength)}.`);
diff --git a/server/services/providerUsage.test.js b/server/services/providerUsage.test.js
index 23b8ba1719..0c56cd5830 100644
--- a/server/services/providerUsage.test.js
+++ b/server/services/providerUsage.test.js
@@ -25,6 +25,7 @@ vi.mock('./settings.js', () => ({
}));
vi.mock('./imageGenQuota.js', () => ({
IMAGE_GEN_FAMILY: 'imagegen',
+ isQuotaTrackedImageMode: (mode) => mode !== 'fal',
getImageGenQuota: vi.fn(async ({ enabledModes }) => (enabledModes.length ? {
family: 'imagegen', label: 'Image Gen', supported: true, burnable: false,
limits: [], activity: [], metrics: enabledModes.map((m) => ({ key: m, label: m, value: '0 renders · 24h' })),