feat: autoscale Sprite memory via Resources Policy

Sprites have no size presets and CPU/storage are fixed (8 vCPU / 100 GB),
so memory policy (limit + autoscale) is the sizing lever for bursty
unknown workloads. ensureSprite now applies idempotently, non-failing:

- memoryAutoscale (default true) lets the platform grow memory under
  pressure instead of thrashing at a fixed cap
- memoryLimitMB (0 = Fly default ceiling 8192) is the peak ceiling
- Settings UI exposes both controls
This commit is contained in:
nandi committed 2026-11-20 13:41:25 -08:00
1 parent b2c8f4492d
commit 4ae69f54ce
3 files changed
+78

No files matched your search

+23
View File
@@ -440,6 +440,18 @@ export function FlySpritesSettingsScreen({ theme, layout, host }: PluginSurfaceP
setDraft((prev) => ({ ...prev, defaultCpus: Number.isFinite(parsed) && parsed >= 0 ? parsed : 0 }));
}}
/>
<SettingsInput
label="Memory ceiling (MB)"
hint="Peak memory the Sprite may grow to when autoscale is on. 0 uses the Fly default (8192 MB). Raise for bursty workloads — e.g. 16384 or 65536 (no published API max; constrained by host capacity)."
initialValue={String(draft.memoryLimitMB ?? 0)}
placeholder="0"
disabled={settings.saving}
onChangeText={(val) => {
const parsed = Number.parseInt(val.trim() || "0", 10);
setStatusMessage(null);
setDraft((prev) => ({ ...prev, memoryLimitMB: Number.isFinite(parsed) && parsed >= 0 ? parsed : 0 }));
}}
/>
</SettingsCard>
</SettingsSection>
@@ -456,6 +468,17 @@ export function FlySpritesSettingsScreen({ theme, layout, host }: PluginSurfaceP
void saveDraft(next);
}}
/>
<SettingsSwitch
label="Autoscale Sprite memory"
hint="Lets the Fly platform grow Sprite memory under pressure (up to the memory ceiling). Sprites have no size presets and CPU/storage are fixed — this is the sizing lever for unknown/bursty workloads."
value={draft.memoryAutoscale !== false}
disabled={settings.saving}
onValueChange={(memoryAutoscale) => {
const next = { ...draft, memoryAutoscale };
setDraft(next);
void saveDraft(next);
}}
/>
<SettingsSwitch
label="Inject sprite_* tools into Paseo agents"
hint="Allows local agents to spawn parallel Fly Sprite workers and checkpoints."