Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
feat(gfs): raise upload cap to 16MB (client + gfsc write-body via HCC)
Alfredo Lopezba698efbfb3a
diff --git a/control-ui/app/constants/gfsFileUpload.ts b/control-ui/app/constants/gfsFileUpload.tsindex 19453e368..32c19ec76 100644--- a/control-ui/app/constants/gfsFileUpload.ts+++ b/control-ui/app/constants/gfsFileUpload.ts@@ -1,2 +1,5 @@-export const GFS_FILE_UPLOAD_MAX_BYTES = 10 * 1024 * 1024-export const GFS_FILE_UPLOAD_MAX_MEGABYTES = 10+// Raw-file upload cap. base64 inflates this ×1.34 on the wire, so 16MiB → ~22.4MB+// body, which must stay under gfsc's GFS_MAX_WRITE_BODY_BYTES (24MiB, set via the+// host-context-controller gfsc template). Raise all three in step.+export const GFS_FILE_UPLOAD_MAX_BYTES = 16 * 1024 * 1024+export const GFS_FILE_UPLOAD_MAX_MEGABYTES = 16diff --git a/control-ui/components/__tests__/GfsBrowser.test.tsx b/control-ui/components/__tests__/GfsBrowser.test.tsxindex 4d093e78f..f88237cd9 100644--- a/control-ui/components/__tests__/GfsBrowser.test.tsx+++ b/control-ui/components/__tests__/GfsBrowser.test.tsx@@ -360,7 +360,7 @@ describe('GfsBrowser', () => {dataTransfer: { dropEffect: 'none', files: [oversized], types: ['Files'] },})- expect(await screen.findByText('GFS uploads are limited to 10 MB per file.')).toBeTruthy()+ expect(await screen.findByText('GFS uploads are limited to 16 MB per file.')).toBeTruthy()expect(arrayBuffer).not.toHaveBeenCalled()expect(mockApiSend).not.toHaveBeenCalled()})diff --git a/control-ui/lib/__tests__/gfsFileUpload.test.ts b/control-ui/lib/__tests__/gfsFileUpload.test.tsindex fae2bf9ec..8e47455e2 100644--- a/control-ui/lib/__tests__/gfsFileUpload.test.ts+++ b/control-ui/lib/__tests__/gfsFileUpload.test.ts@@ -1,5 +1,5 @@import { describe, expect, it } from 'vitest'-import { GFS_FILE_UPLOAD_MAX_BYTES } from '@constants/gfsFileUpload'+import { GFS_FILE_UPLOAD_MAX_BYTES, GFS_FILE_UPLOAD_MAX_MEGABYTES } from '@constants/gfsFileUpload'import { assertGfsFileUploadSize } from '@lib/gfsFileUpload'describe('assertGfsFileUploadSize', () => {@@ -9,7 +9,7 @@ describe('assertGfsFileUploadSize', () => {it('rejects files above the upload limit', () => {expect(() => assertGfsFileUploadSize(GFS_FILE_UPLOAD_MAX_BYTES + 1)).toThrow(- 'GFS uploads are limited to 10 MB per file.'+ `GFS uploads are limited to ${GFS_FILE_UPLOAD_MAX_MEGABYTES} MB per file.`)})})diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex 4d312c178..940466ab9 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.390",+ "version": "0.1.391","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.390",+ "version": "0.1.391","dependencies": {"@clerum/llm-providers": "file:../packages/llm-providers","@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 7467c2e7c..e73705849 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.390",+ "version": "0.1.391","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",diff --git a/deploy/base/control-plane/host-context-controller.yaml b/deploy/base/control-plane/host-context-controller.yamlindex 396cd5e2f..8f9c5fca9 100644--- a/deploy/base/control-plane/host-context-controller.yaml+++ b/deploy/base/control-plane/host-context-controller.yaml@@ -66,6 +66,17 @@ spec:value: clerum/mcp-host:0.9.5- name: CONTEXT_MAPPER_EGRESS_PROXY_IMAGEvalue: clerum/nginx-egress-proxy:0.1.0+ # GFS upload ceiling: gfsc write-body cap (bytes), passed through to the gfsc+ # pod. Raised from the 16MiB default to 24MiB so a 16MB raw file (base64 body+ # ≈ 22.4MB) is accepted with margin. Keep in step with the client cap+ # (GFS_FILE_UPLOAD_MAX_BYTES in control-ui) and gfsc memory below.+ - name: GFS_MAX_WRITE_BODY_BYTES+ value: "25165824"+ # gfsc memory limit: a 24MiB-cap upload holds ~4.3× the body (~103MiB) over a+ # ~40MiB baseline; 512Mi absorbs concurrent uploads without OOM (256Mi default+ # was tight at the 24MiB cap).+ - name: CONTEXT_MAPPER_GFSC_LIMIT_MEMORY+ value: 512Mi- name: STDIO_BRIDGE_IMAGEvalue: clerum/stdio-bridge:0.9.5- name: CONTEXT_MAPPER_RUNTIME_NAMESPACESdiff --git a/host-context-controller/package-lock.json b/host-context-controller/package-lock.jsonindex 9a3aff834..21274e92f 100644--- a/host-context-controller/package-lock.json+++ b/host-context-controller/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-host-context-controller",- "version": "0.1.160",+ "version": "0.1.161","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-host-context-controller",- "version": "0.1.160",+ "version": "0.1.161","license": "SEE LICENSE IN LICENSE","dependencies": {"@clerum/image-policy": "file:../packages/image-policy",diff --git a/host-context-controller/package.json b/host-context-controller/package.jsonindex 51dc2ded1..cdd4381c3 100644--- a/host-context-controller/package.json+++ b/host-context-controller/package.json@@ -1,6 +1,6 @@{"name": "clerum-host-context-controller",- "version": "0.1.160",+ "version": "0.1.161","description": "Host Context Controller - provides McpServer CRDs to mcp-host via REST API","main": "dist/main.js","engines": {diff --git a/host-context-controller/src/gfsConfig.ts b/host-context-controller/src/gfsConfig.tsindex 331e43599..8dbc9ca7a 100644--- a/host-context-controller/src/gfsConfig.ts+++ b/host-context-controller/src/gfsConfig.ts@@ -67,6 +67,11 @@ export function gfsDefaultFactoryConfig(): GfsFactoryConfig {syncCopyMaxObjects: process.env.GFS_SYNC_COPY_MAX_OBJECTS,syncCopyMaxBytes: process.env.GFS_SYNC_COPY_MAX_BYTES,syncCopyTimeoutMs: process.env.GFS_SYNC_COPY_TIMEOUT_MS,+ // Largest mutation body gfsc accepts (bytes). Passed through to the gfsc pod so+ // ops can raise the upload ceiling above gfsc's 16MiB default (base64 inflates a+ // raw file ×1.34, so a 16MB file needs ~22.4MB here). Raise the client cap and+ // gfsc memory (CONTEXT_MAPPER_GFSC_LIMIT_MEMORY) together.+ maxWriteBodyBytes: process.env.GFS_MAX_WRITE_BODY_BYTES,nodeLocalDnsCidr: parseNodeLocalDnsCidr(env('CONTEXT_MAPPER_NODELOCAL_DNS_CIDR', '')),}}diff --git a/host-context-controller/src/k8s/gfsFactory.ts b/host-context-controller/src/k8s/gfsFactory.tsindex 81430d656..9a556c1ac 100644--- a/host-context-controller/src/k8s/gfsFactory.ts+++ b/host-context-controller/src/k8s/gfsFactory.ts@@ -95,6 +95,8 @@ export interface GfsFactoryConfig {syncCopyMaxObjects?: stringsyncCopyMaxBytes?: stringsyncCopyTimeoutMs?: string+ /** Optional largest mutation body gfsc accepts (bytes), passed through to gfsc. */+ maxWriteBodyBytes?: string/** Optional kube-dns Service ClusterIP /32 for GKE NodeLocal DNS + Calico. */nodeLocalDnsCidr?: string}@@ -258,12 +260,13 @@ export function buildPvc(function gfscEnv(config: GfsFactoryConfig, role: GfscRole): k8s.V1EnvVar[] {const pgSecretName = role === 'writer' ? config.pgSecretName : config.readerPgSecretNameconst pgSecretKey = role === 'writer' ? config.pgSecretKey : config.readerPgSecretKey- const copyEnvEntries: ReadonlyArray<readonly [string, string | undefined]> = [+ const passthroughEnvEntries: ReadonlyArray<readonly [string, string | undefined]> = [['GFS_SYNC_COPY_MAX_OBJECTS', config.syncCopyMaxObjects],['GFS_SYNC_COPY_MAX_BYTES', config.syncCopyMaxBytes],['GFS_SYNC_COPY_TIMEOUT_MS', config.syncCopyTimeoutMs],+ ['GFS_MAX_WRITE_BODY_BYTES', config.maxWriteBodyBytes],]- const copyEnv = copyEnvEntries.flatMap(([name, value]): k8s.V1EnvVar[] =>+ const copyEnv = passthroughEnvEntries.flatMap(([name, value]): k8s.V1EnvVar[] =>value === undefined ? [] : [{ name, value }])