Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

Merge remote-tracking branch 'origin/dev' into feat/issue-300-runtime-upload-product-limit

Josuéebcc68b96509
diff --cc control-api/test/network.gateway.intent.test.ts
index 128807fc6,c44f7cd2d..a204b430a
--- a/control-api/test/network.gateway.intent.test.ts
+++ b/control-api/test/network.gateway.intent.test.ts
@@@ -594,85 -344,46 +594,85 @@@ describe('network/gateway intent (manif
})
it('keeps the GFS v2 part cap chain below the gateway request cap', () => {
- // Upload v2 is indexed binary streaming: the 200 MiB product boundary is
- // aggregate session metadata, while every request remains <=16 MiB. The
- // old base64 ×4/3 invariant belongs only to the legacy JSON path and must not
- // constrain the v2 product limit.
- const GFSC_WRITE_CAP = 25165824 // 24 MiB — the funnel + gfsc authoritative cap
-
- // 1. gfsc's write cap is actually plumbed to the pod. Without this env gfsc
- // falls back to its 16 MiB in-code default and a 16 MB file (22.4 MB body)
- // hard-413s while the client-side cap says it should have worked.
+ // Upload v2 is indexed binary streaming: product policy is writer-advertised
+ // session metadata, while protocol and per-request safety remain compiled.
+ // Do not compare the runtime product policy with a single-request body cap.
+ // The legacy JSON/base64 path still requires the HCC-owned gfsc body cap to
+ // agree with the profile funnel. It is not the Upload v2 product authority.
const hccDeployment = read(`${BASE}/control-plane/host-context-controller.yaml`)
const gfscCapMatch = hccDeployment.match(
- /GFS_MAX_WRITE_BODY_BYTES[\s\S]{0,80}?value:\s*"?(\d+)"?/
+ /GFS_MAX_WRITE_BODY_BYTES[\s\S]{0,80}?value:\s*(["']?)(\d+)\1/
)
expect(
gfscCapMatch,
'GFS_MAX_WRITE_BODY_BYTES env must be set on the HCC deployment'
).not.toBeNull()
- const legacyGfscWriteCap = Number(gfscCapMatch![1])
- expect(Number(gfscCapMatch![2])).toBe(GFSC_WRITE_CAP)
-
- // 2. Both clients advertise the same hard binary part cap and product cap.
- const parseClientCaps = (relPath: string): { product: number; part: number } => {
- const src = read(relPath)
- const productMatch = src.match(/GFS_FILE_UPLOAD_MAX_BYTES\s*=\s*([0-9*\s]+)/)
- const partMatch = src.match(/GFS_FILE_UPLOAD_MAX_PART_BYTES\s*=\s*([0-9*\s]+)/)
- expect(productMatch, `GFS_FILE_UPLOAD_MAX_BYTES not found in ${relPath}`).not.toBeNull()
- expect(partMatch, `GFS_FILE_UPLOAD_MAX_PART_BYTES not found in ${relPath}`).not.toBeNull()
- // Only digits/`*`/spaces are matched, so evaluating the arithmetic is safe.
- const evaluate = (value: string): number =>
- Number(value.split('*').reduce((acc, n) => acc * Number(n.trim()), 1))
- return { product: evaluate(productMatch![1]), part: evaluate(partMatch![1]) }
- }
- const webCaps = parseClientCaps('../../control-ui/app/constants/gfsFileUpload.ts')
- const desktopCaps = parseClientCaps('../../desktop-app/ui/src/constants/gfsFileUpload.ts')
- expect(webCaps).toEqual(desktopCaps)
- expect(webCaps.product).toBe(209715200)
- expect(webCaps.part).toBe(16777216)
-
- // 3. A v2 binary request fits below the internal 24 MiB cap with headroom;
- // the aggregate 200 MiB value never becomes a single request body.
- expect(webCaps.part).toBeLessThan(GFSC_WRITE_CAP)
++ const legacyGfscWriteCap = Number(gfscCapMatch![2])
+ const funnelConf = docContaining(
+ yamlDocs(read(`${BASE}/profiles/configmaps.yaml`)),
+ 'name: profile-control-funnel-nginx'
+ )
+ const funnelCapMatch = funnelConf.match(/client_max_body_size\s+(\d+);/)
+ expect(funnelCapMatch, 'profile-control-funnel body cap not found').not.toBeNull()
+ const profileFunnelCap = Number(funnelCapMatch![1])
+ expect(profileFunnelCap).toBe(legacyGfscWriteCap)
+
+ // The writer defines the absolute protocol and part bounds. Both packaged
+ // Desktop layers and Control UI mirror those wire limits, not product policy.
+ const writerProtocol = staticBytes(
+ '../../gfs-controller/src/upload/protocol.ts',
+ 'GFS_UPLOAD_V2_PROTOCOL_MAX_BYTES'
+ )
+ const writerPart = staticBytes(
+ '../../gfs-controller/src/upload/protocol.ts',
+ 'GFS_UPLOAD_V2_MAX_PART_BYTES'
+ )
+ const protocolMirrors = [
+ staticBytes(
+ '../../control-ui/app/constants/gfsFileUpload.ts',
+ 'GFS_FILE_UPLOAD_PROTOCOL_MAX_BYTES'
+ ),
+ staticBytes(
+ '../../desktop-app/ui/src/constants/gfsFileUpload.ts',
+ 'GFS_FILE_UPLOAD_PROTOCOL_MAX_BYTES'
+ ),
+ staticBytes('../../desktop-app/src/gfs/upload.ts', 'GFS_UPLOAD_V2_PROTOCOL_MAX_BYTES'),
+ ]
+ const partMirrors = [
+ staticBytes(
+ '../../control-ui/app/constants/gfsFileUpload.ts',
+ 'GFS_FILE_UPLOAD_MAX_PART_BYTES'
+ ),
+ staticBytes(
+ '../../desktop-app/ui/src/constants/gfsFileUpload.ts',
+ 'GFS_FILE_UPLOAD_MAX_PART_BYTES'
+ ),
+ staticBytes('../../desktop-app/src/gfs/upload.ts', 'GFS_UPLOAD_V2_MAX_PART_BYTES'),
+ staticBytes(
+ '../../control-ui/app/control-api/[...path]/route.ts',
+ 'GFS_UPLOAD_MAX_PART_BYTES'
+ ),
+ ]
+ // Every relay defaults to the writer part maximum and refuses configuration
+ // above it. A part must also fit through the profile gateway with headroom.
+ const controlApiRelay = boundedEnvBytes(
+ '../src/config.ts',
+ 'gfsUploadMaxPartBytes',
+ 'CONTROL_API_GFS_UPLOAD_MAX_PART_BYTES'
+ )
+ const externalRestRelay = boundedEnvBytes(
+ '../../external-rest-api/src/config.ts',
+ 'gfsUploadMaxPartBytes',
+ 'EXTERNAL_REST_API_GFS_UPLOAD_MAX_PART_BYTES'
+ )
+ assertUploadV2TransportBounds({
+ writerProtocol,
+ writerPart,
+ protocolMirrors,
+ partMirrors,
+ relayBounds: [controlApiRelay, externalRestRelay],
+ gatewayBytes: profileFunnelCap,
+ })
})
it('keeps control-api memory at >=768Mi in base AND the minikube overlay (RC3 OOM guard)', () => {
diff --cc control-ui/package-lock.json
index 285ef880b,285ef880b..314c50b2c
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@@ -1,12 -1,12 +1,12 @@@
{
"name": "clerum-control-ui",
-- "version": "0.1.444",
++ "version": "0.1.445",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
-- "version": "0.1.444",
++ "version": "0.1.445",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/llm-providers": "file:../packages/llm-providers",
diff --cc control-ui/package.json
index e63ae6c3c,e63ae6c3c..b26a1c932
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "clerum-control-ui",
-- "version": "0.1.444",
++ "version": "0.1.445",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",
diff --cc host-context-controller/src/k8sClient.ts
index d4ffc430b,c39b5c3d1..e32fb5b70
--- a/host-context-controller/src/k8sClient.ts
+++ b/host-context-controller/src/k8sClient.ts
@@@ -40,7 -40,15 +40,15 @@@ import
import { K8sGfsApi } from './k8s/gfsK8sApi'
import { makeHostK8sApiClient } from './k8s/hostK8sApiClient'
import { pvcName as sfsPvcName } from './k8s/sharedFileSystemFactory'
+import { LlmHookReconciler, computePodKey, referencedHookIds } from './llmHookReconciler'
+ import type {
+ AuthorityContext,
+ AuthorityHost,
+ AuthorityMcpServer,
+ AuthoritySecret,
+ AuthoritySecretMetadata,
+ McpAuthorizationStore,
+ } from './mcpAuthorization'
-import { LlmHookReconciler, computePodKey, referencedHookIds } from './llmHookReconciler'
import {
confirmAuthoritativeMcpServerAbsence,
isMcpServerStatusOnlyUpdate,
diff --cc tests/e2e/package-lock.json
index 8b6c35470,8b6c35470..2b05ec0ef
--- a/tests/e2e/package-lock.json
+++ b/tests/e2e/package-lock.json
@@@ -1,12 -1,12 +1,12 @@@
{
"name": "clerum-e2e-tests",
-- "version": "0.1.68",
++ "version": "0.1.69",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-e2e-tests",
-- "version": "0.1.68",
++ "version": "0.1.69",
"devDependencies": {
"@types/jsonwebtoken": "^9.0.10",
"@types/node": "^22.0.0",
diff --cc tests/e2e/package.json
index b2262ef2a,b2262ef2a..9f389a828
--- a/tests/e2e/package.json
+++ b/tests/e2e/package.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "clerum-e2e-tests",
-- "version": "0.1.68",
++ "version": "0.1.69",
"private": true,
"type": "module",
"scripts": {