Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(rpc-proxy): point HCC base-URL dev default at the real endpoint (split from PR #205)
Alfredo Lopez4889cd7edb1c
diff --git a/rpc-proxy/package-lock.json b/rpc-proxy/package-lock.jsonindex 69bb9f161..fae2c8dd2 100644--- a/rpc-proxy/package-lock.json+++ b/rpc-proxy/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-rpc-proxy",- "version": "0.1.50",+ "version": "0.1.51","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-rpc-proxy",- "version": "0.1.50",+ "version": "0.1.51","dependencies": {"cors": "^2.8.5","express": "^4.21.2",diff --git a/rpc-proxy/package.json b/rpc-proxy/package.jsonindex 8d54ca64b..93641a581 100644--- a/rpc-proxy/package.json+++ b/rpc-proxy/package.json@@ -1,6 +1,6 @@{"name": "clerum-rpc-proxy",- "version": "0.1.50",+ "version": "0.1.51","description": "External-facing RPC proxy for tenant-scoped MCP access","main": "dist/main.js","engines": {diff --git a/rpc-proxy/src/config.hccBaseUrl.test.ts b/rpc-proxy/src/config.hccBaseUrl.test.tsnew file mode 100644index 000000000..b1cedb606--- /dev/null+++ b/rpc-proxy/src/config.hccBaseUrl.test.ts@@ -0,0 +1,42 @@+import { describe, expect, it } from 'vitest'+import { readFileSync } from 'node:fs'+import path from 'node:path'++/**+ * The dev default for RPC_PROXY_HCC_BASE_URL must name the same HCC endpoint the+ * deployed configmap injects. They drifted once: the default pointed at+ * host-context-controller.mcp-server (a Service that exists in no overlay, and+ * one the rpc-proxy egress NetworkPolicy would block anyway — it only permits+ * the api-gateway peer), while the real target is+ * host-context-controller-api-gateway.control-plane. NODE_ENV=production is+ * baked into the image so the default is unreachable in-cluster today, but a+ * developer running rpc-proxy locally would inherit the wrong endpoint. Pin the+ * two together so they cannot silently diverge again.+ */+describe('rpc-proxy HCC base URL default', () => {+ const repoRoot = path.join(__dirname, '../..')++ const configSource = readFileSync(path.join(__dirname, 'config.ts'), 'utf8')+ const defaultMatch = configSource.match(+ /requiredOrDevDefault\(\s*'RPC_PROXY_HCC_BASE_URL',\s*(?:\/\/[^\n]*\n\s*)*'([^']+)'/+ )++ const configmap = readFileSync(+ path.join(repoRoot, 'deploy/overlays/minikube/configmaps/rpc-proxy-config.yaml'),+ 'utf8'+ )+ const configmapMatch = configmap.match(/RPC_PROXY_HCC_BASE_URL:\s*"?([^"\n]+)"?/)++ it('parses both sources', () => {+ expect(defaultMatch?.[1]).toBeTruthy()+ expect(configmapMatch?.[1]).toBeTruthy()+ })++ it('dev default matches the deployed configmap endpoint', () => {+ expect(defaultMatch?.[1]).toBe(configmapMatch?.[1]?.trim())+ })++ it('targets the api-gateway in control-plane, not a nonexistent Service', () => {+ expect(defaultMatch?.[1]).toContain('host-context-controller-api-gateway.control-plane')+ })+})diff --git a/rpc-proxy/src/config.ts b/rpc-proxy/src/config.tsindex 51daa721a..21ac2c62d 100644--- a/rpc-proxy/src/config.ts+++ b/rpc-proxy/src/config.ts@@ -216,7 +216,12 @@ export const config: Config = {),hccBaseUrl: requiredOrDevDefault('RPC_PROXY_HCC_BASE_URL',- 'http://host-context-controller.mcp-server.svc.cluster.local:8081'+ // Must mirror the real topology: rpc-proxy reaches HCC only through the+ // nginx api-gateway in control-plane. The egress NetworkPolicy in+ // deploy/base/rpc-proxy/networkpolicies.yaml only allows that peer, and no+ // host-context-controller Service exists in mcp-server. Kept in sync with+ // the deployed configmap by config.hccBaseUrl.test.ts.+ 'http://host-context-controller-api-gateway.control-plane.svc.cluster.local:8081'),hostNamespace: requiredOrDevDefault('RPC_PROXY_HOST_NAMESPACE', 'mcp-host'),desktopCookieName: process.env.RPC_PROXY_DESKTOP_COOKIE_NAME || 'clerum_desktop_session',