Skip to content

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

TypeScript

fix(mcp-host): keep oversize PNG fixture off import.meta

Alfredo Lopez04ae96f839c8
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index 23bfbfa52..fb023890b 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.362",
+ "version": "0.1.363",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.362",
+ "version": "0.1.363",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@anthropic-ai/sdk": "^0.32.0",
diff --git a/mcp-host/package.json b/mcp-host/package.json
index f91b6d21e..2fc9ce550 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.362",
+ "version": "0.1.363",
"description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude",
"main": "dist/main.js",
"engines": {
diff --git a/mcp-host/src/llm/__tests__/codexImageFixtures.ts b/mcp-host/src/llm/__tests__/codexImageFixtures.ts
index 09dd7a1e2..658133f8f 100644
--- a/mcp-host/src/llm/__tests__/codexImageFixtures.ts
+++ b/mcp-host/src/llm/__tests__/codexImageFixtures.ts
@@ -1,6 +1,11 @@
import { readFileSync } from 'node:fs'
+import { createRequire } from 'node:module'
import { join } from 'node:path'
+const { declaredHeaderPng } = createRequire(join(__dirname, 'codexImageFixtures.ts'))(
+ '../../../../packages/llm-provider-attempt-contract/testImageFixtures.cjs'
+) as { declaredHeaderPng: (width: number, height: number) => Buffer }
+
// Shared, independently decoded 2x2 fixtures; structural acceptance alone
// does not prove that a header-only substitute actually decodes.
const fixtures = JSON.parse(
@@ -22,3 +27,4 @@ const imageData = (format: 'png' | 'jpeg'): string => {
export const PNG_2X2_BASE64 = imageData('png')
export const JPEG_2X2_BASE64 = imageData('jpeg')
+export const PNG_OVER_DIMENSION_BASE64 = declaredHeaderPng(3000, 3000).toString('base64')
diff --git a/mcp-host/src/llm/__tests__/codexSubscription.test.ts b/mcp-host/src/llm/__tests__/codexSubscription.test.ts
index f96cc29a1..d794221cb 100644
--- a/mcp-host/src/llm/__tests__/codexSubscription.test.ts
+++ b/mcp-host/src/llm/__tests__/codexSubscription.test.ts
@@ -1,5 +1,4 @@
import { describe, expect, it, vi } from 'vitest'
-import { createRequire } from 'node:module'
import {
VISUAL_LIMITS,
hashCodexCompletionRequest,
@@ -22,11 +21,7 @@ import { CodexSubscriptionProvider } from '../codexSubscription'
import { classifyFailoverClass } from '../failover/classify'
import { CodexAuthorizeError } from '../providerAttemptAuthorizer'
import { makeProvider } from '../registry'
-import { JPEG_2X2_BASE64, PNG_2X2_BASE64 } from './codexImageFixtures'
-
-const { declaredHeaderPng } = createRequire(import.meta.url)(
- '../../../../packages/llm-provider-attempt-contract/testImageFixtures.cjs'
-) as { declaredHeaderPng: (width: number, height: number) => Buffer }
+import { JPEG_2X2_BASE64, PNG_2X2_BASE64, PNG_OVER_DIMENSION_BASE64 } from './codexImageFixtures'
const requestHash = 'a'.repeat(64)
@@ -765,7 +760,7 @@ describe('CodexSubscriptionProvider', () => {
const wired = deps()
const provider = new CodexSubscriptionProvider('gpt-5.6-luna', wired as never)
await expect(
- provider.completeSingleTurn(userWithImage(declaredHeaderPng(3000, 3000).toString('base64')))
+ provider.completeSingleTurn(userWithImage(PNG_OVER_DIMENSION_BASE64))
).rejects.toMatchObject({
name: 'CodexAuthorizeError',
code: 'payload_too_large',