Skip to content

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

TypeScript

fix(codex): preserve optional MCP parameters with strict:false (#648)

ALFREDO J LOPEZ H (alfredolopez80.eth)c1b8c6dbb921
diff --git a/codex-llm-proxy/src/codexTransport.ts b/codex-llm-proxy/src/codexTransport.ts
index b3427c370..af7b60c5f 100644
--- a/codex-llm-proxy/src/codexTransport.ts
+++ b/codex-llm-proxy/src/codexTransport.ts
@@ -295,6 +295,9 @@ function toUpstreamPayload(
name: names.toWire(tool.name),
description: tool.description,
parameters: tool.parameters,
+ // Codex can normalize omission to strict mode and require optional MCP
+ // fields. Preserve the source schema's optionality explicitly.
+ strict: false,
}))
payload.parallel_tool_calls = true
}
diff --git a/codex-llm-proxy/test/approvedToolsUpstream.test.ts b/codex-llm-proxy/test/approvedToolsUpstream.test.ts
index 44e6b0612..28a53cef4 100644
--- a/codex-llm-proxy/test/approvedToolsUpstream.test.ts
+++ b/codex-llm-proxy/test/approvedToolsUpstream.test.ts
@@ -72,6 +72,25 @@ async function complete(
}
describe('approved-tools isolated upstream boundary', () => {
+ it('measures explicit non-strict definitions without altering omitted or true values', async () => {
+ const simulator = createApprovedToolsUpstream()
+ const definitions = tools.map((tool, index) => ({
+ ...tool,
+ ...(index === 0 ? { strict: false } : index === 1 ? { strict: true } : {}),
+ }))
+ const before = JSON.stringify(definitions)
+ const result = await request(
+ simulator,
+ [{ role: 'user', content: 'verification receipt' }],
+ definitions
+ )
+ expect(result.response.status).toBe(200)
+ expect(simulator.evidence().requests).toMatchObject([
+ { definitionCount: 3, explicitNonStrictCount: 1 },
+ ])
+ expect(JSON.stringify(definitions)).toBe(before)
+ })
+
it('accepts the BasicSafety envelope with the real bridge execution target', async () => {
await complete(
createApprovedToolsUpstream(),
diff --git a/codex-llm-proxy/test/approvedToolsUpstream.ts b/codex-llm-proxy/test/approvedToolsUpstream.ts
index a82fbba83..26cc7a601 100644
--- a/codex-llm-proxy/test/approvedToolsUpstream.ts
+++ b/codex-llm-proxy/test/approvedToolsUpstream.ts
@@ -290,6 +290,7 @@ export function createApprovedToolsUpstream() {
// Only bounded measurements, never request or result contents.
requests: [] as Array<{
definitionCount: number
+ explicitNonStrictCount: number
definitionBytes: number
inputBytes: number
connectorDefinitionCount: number
@@ -346,6 +347,7 @@ export function createApprovedToolsUpstream() {
).length
evidence.requests.push({
definitionCount: tools.length,
+ explicitNonStrictCount: tools.filter(tool => tool.strict === false).length,
definitionBytes: Buffer.byteLength(JSON.stringify(tools)),
inputBytes: Buffer.byteLength(JSON.stringify(payload.input)),
connectorDefinitionCount,
diff --git a/codex-llm-proxy/test/codexTransport.conformance.test.ts b/codex-llm-proxy/test/codexTransport.conformance.test.ts
index 1f7003b90..2d9f1d9ab 100644
--- a/codex-llm-proxy/test/codexTransport.conformance.test.ts
+++ b/codex-llm-proxy/test/codexTransport.conformance.test.ts
@@ -6,6 +6,8 @@ import {
import { CodexTransportError, streamCodexCompletion } from '../src/codexTransport.js'
import type { RedeemAttemptSuccess } from '../src/controlApiClient.js'
import { CODEX_COMPLETIONS_ORIGIN } from '../src/originPolicy.js'
+import { ToolNameMap } from '../src/toolNameMap.js'
+import { eventaskUpdateTool, optionalMcpTools, webSearchTool } from './fixtures/optionalMcpTools.js'
const REQUEST = {
schemaVersion: 'codex-completion-request.v1' as const,
@@ -57,6 +59,133 @@ function sseResponse(
}
describe('streamCodexCompletion', () => {
+ it('preserves real MCP optional schemas with explicit non-strict upstream tools', async () => {
+ const request = {
+ ...REQUEST,
+ tools: optionalMcpTools.map(tool => ({
+ ...structuredClone(tool),
+ // Exercise existing aliasing with the second real schema.
+ name: tool === webSearchTool ? 'web.search__web_search' : tool.name,
+ })),
+ }
+ const original = structuredClone(request)
+ const requestHash = hashCodexCompletionRequestV1(request)
+ const fetchFn = vi.fn(async () => sseResponse(['data: {"type":"response.completed"}\n\n']))
+ await streamCodexCompletion({
+ executionTicket: 'ticket-optionality',
+ requestHash,
+ request,
+ ticket: {
+ jti: 'jti-optionality',
+ hostRef: 'research-host',
+ model: REQUEST.model,
+ requestHash,
+ providerAttemptId: 'att-optionality',
+ },
+ redeem: async () => redeemSuccess(),
+ finalize: vi.fn(async () => ({
+ providerAttemptId: 'att-optionality',
+ outcome: 'success',
+ duplicate: false,
+ })),
+ fetchFn,
+ lookup: async () => [{ address: '1.2.3.4', family: 4 }],
+ })
+ expect(fetchFn).toHaveBeenCalledOnce()
+ const body = JSON.parse(String(fetchFn.mock.calls[0]?.[1]?.body))
+ const names = new ToolNameMap(request.tools.map(tool => tool.name))
+ expect(body.tools).toHaveLength(2)
+ expect(body.tools).toEqual(
+ request.tools.map(tool => ({
+ type: 'function',
+ name: names.toWire(tool.name),
+ description: tool.description,
+ parameters: tool.parameters,
+ strict: false,
+ }))
+ )
+ expect(body.tools[0].parameters.required).toEqual(['key', 'actor'])
+ expect(body.tools[1].parameters.required).toEqual(['query'])
+ expect(request).toEqual(original)
+ expect(hashCodexCompletionRequestV1(request)).toBe(requestHash)
+ })
+
+ it.each([
+ {
+ label: 'absent optional fields',
+ tool: eventaskUpdateTool,
+ args: { key: 'BUG-1', actor: 'test-agent', description: 'Updated description' },
+ },
+ {
+ label: 'explicit null',
+ tool: eventaskUpdateTool,
+ args: { key: 'BUG-1', actor: 'test-agent', dueDate: null },
+ },
+ {
+ label: 'empty array',
+ tool: eventaskUpdateTool,
+ args: { key: 'BUG-1', actor: 'test-agent', labels: [] },
+ },
+ { label: 'empty arguments', tool: eventaskUpdateTool, args: {} },
+ {
+ label: 'wrong object type',
+ tool: eventaskUpdateTool,
+ args: { key: 'BUG-1', actor: 'test-agent', labels: {} },
+ },
+ {
+ label: 'unknown property',
+ tool: eventaskUpdateTool,
+ args: { key: 'BUG-1', actor: 'test-agent', unexpected: true },
+ },
+ {
+ label: 'contradictory labels',
+ tool: eventaskUpdateTool,
+ args: { key: 'BUG-1', actor: 'test-agent', labels: [], addLabels: [], removeLabels: [] },
+ },
+ {
+ label: 'plugin default not requested',
+ tool: webSearchTool,
+ args: { query: 'MCP optional parameters' },
+ },
+ ])('does not repair or default provider arguments: $label', async ({ tool, args }) => {
+ // Even invalid provider output must reach normal host/plugin validation
+ // unchanged; the transport must never silently make a call look valid.
+ const canonical = `plugin.v2__${tool.name}`
+ const names = new ToolNameMap([canonical])
+ const request = { ...REQUEST, tools: [{ ...tool, name: canonical }] }
+ const requestHash = hashCodexCompletionRequestV1(request)
+ const frames: unknown[] = []
+ await streamCodexCompletion({
+ executionTicket: 'ticket-arguments',
+ requestHash,
+ request,
+ ticket: {
+ jti: 'jti-arguments',
+ hostRef: 'research-host',
+ model: REQUEST.model,
+ requestHash,
+ providerAttemptId: 'att-arguments',
+ },
+ redeem: async () => redeemSuccess(),
+ finalize: vi.fn(async () => ({
+ providerAttemptId: 'att-arguments',
+ outcome: 'success',
+ duplicate: false,
+ })),
+ fetchFn: vi.fn(async () =>
+ sseResponse([
+ `data: ${JSON.stringify({ type: 'response.output_item.done', item: { type: 'function_call', call_id: 'call-optional', name: names.toWire(canonical), arguments: JSON.stringify(args) } })}\n\n`,
+ 'data: {"type":"response.completed"}\n\n',
+ ])
+ ),
+ lookup: async () => [{ address: '1.2.3.4', family: 4 }],
+ onFrame: frame => frames.push(frame),
+ })
+ expect(frames).toEqual([
+ { type: 'tool_call', id: 'call-optional', name: canonical, arguments: args },
+ ])
+ })
+
it.each(['response.failed', 'unterminated'])(
'does not emit partial tool calls after %s',
async terminal => {
@@ -663,7 +792,9 @@ describe('streamCodexCompletion', () => {
const body = JSON.parse(String(fetchFn.mock.calls[0]?.[1]?.body)) as Record<string, unknown>
expect(body.instructions).toBe('be brief')
expect(body.store).toBe(false)
- expect(body.tools).toEqual(request.tools.map(tool => ({ type: 'function', ...tool })))
+ expect(body.tools).toEqual(
+ request.tools.map(tool => ({ type: 'function', ...tool, strict: false }))
+ )
expect(body.parallel_tool_calls).toBe(true)
expect(body.tool_choice).toBe('auto')
expect(body.prompt_cache_key).toBe('sess-1')
diff --git a/codex-llm-proxy/test/fixtures/optionalMcpTools.ts b/codex-llm-proxy/test/fixtures/optionalMcpTools.ts
new file mode 100644
index 000000000..b6fa6ffcb
--- /dev/null
+++ b/codex-llm-proxy/test/fixtures/optionalMcpTools.ts
@@ -0,0 +1,107 @@
+import type { CodexToolDefinitionV1 } from '@clerum/llm-provider-attempt-contract'
+
+// tools/list snapshot from eventasks-mcp:2.6.0-dev, captured 2026-09-16 for #647.
+// Complete schema: only key/actor are required; the label edit mechanisms are
+// mutually exclusive in the owning API. This fixture contains no task data.
+export const eventaskUpdateTool: CodexToolDefinitionV1 = {
+ name: 'eventasks__workitem_update',
+ description:
+ "Update a work item's title/description/status/priority/labels/due date/estimate. Use for any field change except reparenting (workitem_move) and type changes (workitem_restructure). " +
+ "Setting status='done' is gated by the item's required acceptance criteria: if any are " +
+ "still unchecked, this call fails with error 'criteria_unmet' and the result lists the " +
+ 'unmet criteria, so the item is NOT marked done. When that happens, either check off the ' +
+ 'fulfilled criteria with workitem_check_criterion, or retry with force=true after confirming ' +
+ 'with the user that the work is genuinely complete. Never tell the user an item is done ' +
+ 'unless this tool returned success (no error).',
+ parameters: {
+ type: 'object',
+ properties: {
+ key: {
+ type: 'string',
+ description: 'The work item to update, as its key (TASK-45) or its uuid.',
+ },
+ title: { type: 'string', minLength: 1, description: 'New title.' },
+ description: { type: 'string', description: 'New body text (replaces the old one).' },
+ status: {
+ type: 'string',
+ enum: ['backlog', 'todo', 'in_progress', 'in_review', 'blocked', 'done', 'cancelled'],
+ description:
+ 'New status. A meeting suggestion cannot be moved this way — use workitem_confirm_suggestion / workitem_dismiss_suggestion.',
+ },
+ priority: {
+ type: 'string',
+ enum: ['low', 'medium', 'high', 'critical'],
+ description: 'New priority.',
+ },
+ rank: { type: 'number', description: 'Board ordering position; lower sorts first.' },
+ labels: {
+ type: 'array',
+ items: { type: 'string' },
+ description:
+ "REPLACES the item's entire label set with this one — any label not " +
+ 'listed here is removed. To change one tag without touching the ' +
+ 'others, use addLabels/removeLabels instead.',
+ },
+ addLabels: {
+ type: 'array',
+ items: { type: 'string' },
+ description:
+ 'Add these labels, leaving the existing ones in place. Adding a label ' +
+ 'the item already has does nothing. Cannot be combined with `labels`.',
+ },
+ removeLabels: {
+ type: 'array',
+ items: { type: 'string' },
+ description:
+ 'Remove these labels, leaving the rest in place. Matching is exact and ' +
+ 'case-sensitive; naming a label the item lacks does nothing. Cannot be ' +
+ 'combined with `labels`.',
+ },
+ dueDate: { type: ['string', 'null'], description: 'Due date YYYY-MM-DD, or null to clear.' },
+ estimate: {
+ type: ['number', 'null'],
+ description: 'Estimate (points/hours), or null to clear.',
+ },
+ force: {
+ type: 'boolean',
+ description:
+ 'Override the definition-of-done gate when setting status=done with unmet criteria.',
+ },
+ actor: {
+ type: 'string',
+ minLength: 1,
+ description:
+ 'Your own agent name, recorded as the author. Use the SAME value every call: the work queue, your inbox and author-only checks all match it exactly.',
+ },
+ },
+ required: ['key', 'actor'],
+ additionalProperties: false,
+ $schema: 'http://json-schema.org/draft-07/schema#',
+ },
+}
+
+// Real second MCP: mcp-servers/web-search/src/index.ts:136-148 at 329241bc3.
+// Emitted input schema for its Zod registration; keep the plugin's own default
+// as schema metadata, never insert it into model-returned arguments.
+export const webSearchTool: CodexToolDefinitionV1 = {
+ name: 'web-search__web_search',
+ description: 'Search the web using the Brave Search API. Returns titles, URLs, and snippets.',
+ parameters: {
+ type: 'object',
+ properties: {
+ query: { type: 'string', description: 'The search query' },
+ maxResults: {
+ type: 'integer',
+ minimum: 1,
+ maximum: 20,
+ default: 5,
+ description: 'Maximum number of results to return (default 5)',
+ },
+ },
+ required: ['query'],
+ additionalProperties: false,
+ $schema: 'http://json-schema.org/draft-07/schema#',
+ },
+}
+
+export const optionalMcpTools = [eventaskUpdateTool, webSearchTool]
diff --git a/codex-llm-proxy/test/runtimePath.hermetic.e2e.test.ts b/codex-llm-proxy/test/runtimePath.hermetic.e2e.test.ts
index 3fcdc4e64..413ab4d95 100644
--- a/codex-llm-proxy/test/runtimePath.hermetic.e2e.test.ts
+++ b/codex-llm-proxy/test/runtimePath.hermetic.e2e.test.ts
@@ -19,29 +19,38 @@
* unmodified origin policy; the socket is then pointed at the loopback
* fixture instead of the public internet. No live ChatGPT OAuth is used.
*/
-import { execFileSync, spawn, type ChildProcess } from 'node:child_process'
+import { afterAll, beforeAll, describe, expect, it } from 'vitest'
+import jwt from 'jsonwebtoken'
+import { type ChildProcess, execFileSync, spawn } from 'node:child_process'
+import { generateKeyPairSync } from 'node:crypto'
import { mkdtempSync, readFileSync, rmSync } from 'node:fs'
import { request as httpsRequest } from 'node:https'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
-import { generateKeyPairSync } from 'node:crypto'
-import jwt from 'jsonwebtoken'
import request from 'supertest'
-import { afterAll, beforeAll, describe, expect, it } from 'vitest'
import {
hashCodexCompletionRequestV1,
parseCodexCompletionRequestV1,
} from '@clerum/llm-provider-attempt-contract'
import type { CodexLlmProxyConfig } from '../src/config.js'
import {
- ControlApiClientError,
type ControlApiClient,
+ ControlApiClientError,
type FinalizeAttemptSuccess,
type RedeemAttemptSuccess,
} from '../src/controlApiClient.js'
import { CODEX_CATALOG_ORIGIN, CODEX_COMPLETIONS_ORIGIN } from '../src/originPolicy.js'
-import { createProxyApps, type ProxyServers } from '../src/server.js'
+import { type ProxyServers, createProxyApps } from '../src/server.js'
+import { eventaskUpdateTool, optionalMcpTools } from './fixtures/optionalMcpTools.js'
+
+// Model output is simulated only at the external TLS boundary. The production
+// proxy must carry these exact arguments without synthesizing label edits.
+const OPTIONAL_CALL_ARGUMENTS = {
+ key: 'BUG-1',
+ actor: 'test-agent',
+ description: 'Updated description',
+}
const FIXTURE_UPSTREAM = fileURLToPath(
new URL('../../tests/e2e/fixtures/codex-subscription/test-upstream/server.mjs', import.meta.url)
@@ -300,6 +309,10 @@ beforeAll(async () => {
CODEX_TEST_UPSTREAM_PORT: String(UPSTREAM_PORT),
CODEX_TEST_UPSTREAM_CERT_PATH: certPath,
CODEX_TEST_UPSTREAM_KEY_PATH: keyPath,
+ CODEX_TEST_UPSTREAM_TOOL_CALL: JSON.stringify({
+ name: eventaskUpdateTool.name,
+ arguments: OPTIONAL_CALL_ARGUMENTS,
+ }),
},
stdio: ['ignore', 'pipe', 'inherit'],
})
@@ -327,14 +340,23 @@ afterAll(async () => {
describe('hermetic authorize → proxy → fixture upstream → finalize', () => {
it('streams a completion through the fixture upstream and finalizes a success receipt', async () => {
const { client, redeems, finalizes } = makeControlApiMock()
+ const upstreamBodies: Array<Record<string, unknown>> = []
servers = createProxyApps(config(), {
controlApiClient: client,
- fetchFn: rewriteFetch,
+ fetchFn: (url, init) => {
+ // Observe only: adding strict here would hide a broken serializer.
+ upstreamBodies.push(JSON.parse(String(init?.body)))
+ return rewriteFetch(url, init)
+ },
lookup: async () => [{ address: '104.18.32.47', family: 4 }],
})
const before = await upstreamCounters()
- const raw = completionRequest('gpt-5.3-codex')
+ const raw = {
+ ...completionRequest('gpt-5.3-codex'),
+ tools: structuredClone(optionalMcpTools),
+ }
+ const original = structuredClone(raw)
const parsed = parseCodexCompletionRequestV1(raw)
if (!parsed.ok) throw new Error(parsed.message)
const requestHash = hashCodexCompletionRequestV1(parsed.value)
@@ -358,6 +380,24 @@ describe('hermetic authorize → proxy → fixture upstream → finalize', () =>
expect(res.headers['content-type']).toContain('text/event-stream')
const frames = sseFrames(res.text)
expect(frames).toContainEqual({ type: 'text', text: 'hello' })
+ expect(frames.filter(frame => frame.type === 'tool_call')).toEqual([
+ {
+ type: 'tool_call',
+ id: 'call-hermetic-optional',
+ name: eventaskUpdateTool.name,
+ arguments: OPTIONAL_CALL_ARGUMENTS,
+ },
+ ])
+ expect(upstreamBodies).toHaveLength(1)
+ expect(upstreamBodies[0]?.tools).toEqual(
+ optionalMcpTools.map(tool => ({
+ type: 'function',
+ ...tool,
+ strict: false,
+ }))
+ )
+ expect(raw).toEqual(original)
+ expect(hashCodexCompletionRequestV1(parsed.value)).toBe(requestHash)
const done = frames.find(frame => frame.type === 'done')
expect(done).toBeDefined()
expect(done?.outcome).toBe('success')
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index a485c2635..47760cf25 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.331",
+ "version": "0.1.332",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.331",
+ "version": "0.1.332",
"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 75e24cbd9..8946336ac 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.331",
+ "version": "0.1.332",
"description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude",
"main": "dist/main.js",
"engines": {
diff --git a/mcp-host/src/core/tools/__tests__/shellAndHttp.test.ts b/mcp-host/src/core/tools/__tests__/shellAndHttp.test.ts
index 7bfc3fa98..1c053d898 100644
--- a/mcp-host/src/core/tools/__tests__/shellAndHttp.test.ts
+++ b/mcp-host/src/core/tools/__tests__/shellAndHttp.test.ts
@@ -1,10 +1,14 @@
-import { afterEach, beforeEach, describe, expect, it } from 'vitest'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+import * as dns from 'dns/promises'
import { mkdtemp, rm } from 'fs/promises'
import { tmpdir } from 'os'
import { join } from 'path'
import { HttpRequestTool, isPrivateIp } from '../httpRequest'
import { ShellTool } from '../shell'
+// DNS failure is the input under test, not a dependency on the CI resolver.
+vi.mock('dns/promises', () => ({ resolve4: vi.fn(), resolve6: vi.fn() }))
+
let workspacePath: string
beforeEach(async () => {
@@ -76,6 +80,8 @@ describe('HttpRequestTool', () => {
})
it('should block request when DNS fails and allowlist is configured (Risk 3.5.3d)', async () => {
+ vi.mocked(dns.resolve4).mockRejectedValueOnce(new Error('ENOTFOUND'))
+ vi.mocked(dns.resolve6).mockRejectedValueOnce(new Error('ENOTFOUND'))
const tool = new HttpRequestTool(['example.com'])
const result = await tool.execute({
url: 'http://definitely-does-not-exist-12345.example.com/test',
@@ -107,6 +113,8 @@ describe('HttpRequestTool', () => {
})
it('should fail closed when DNS fails and NO allowlist is configured', async () => {
+ vi.mocked(dns.resolve4).mockRejectedValueOnce(new Error('ENOTFOUND'))
+ vi.mocked(dns.resolve6).mockRejectedValueOnce(new Error('ENOTFOUND'))
const tool = new HttpRequestTool([])
const result = await tool.execute({
url: 'http://definitely-does-not-exist-12345.example.com/test',
diff --git a/tests/e2e/fixtures/codex-subscription/test-upstream/server.mjs b/tests/e2e/fixtures/codex-subscription/test-upstream/server.mjs
index f33be5c74..6289c4ca4 100755
--- a/tests/e2e/fixtures/codex-subscription/test-upstream/server.mjs
+++ b/tests/e2e/fixtures/codex-subscription/test-upstream/server.mjs
@@ -11,6 +11,11 @@ import { createServer } from 'node:https'
const PORT = Number(process.env.CODEX_TEST_UPSTREAM_PORT || 8443)
const cert = readFileSync(process.env.CODEX_TEST_UPSTREAM_CERT_PATH, 'utf8')
const key = readFileSync(process.env.CODEX_TEST_UPSTREAM_KEY_PATH, 'utf8')
+// Optional canned model reply for the hermetic transport test. No MCP tool is
+// executed; ordinary fixture runs retain the existing text-only response.
+const fixtureToolCall = process.env.CODEX_TEST_UPSTREAM_TOOL_CALL
+ ? JSON.parse(process.env.CODEX_TEST_UPSTREAM_TOOL_CALL)
+ : undefined
const counters = {
consent: 0,
@@ -107,6 +112,10 @@ const server = createServer({ cert, key }, async (request, response) => {
})
}
if (request.method === 'POST' && url.pathname === '/backend-api/codex/responses') {
+ const body = JSON.parse((await readBody(request)) || '{}')
+ if (fixtureToolCall && !body.tools?.some(tool => tool.name === fixtureToolCall.name)) {
+ return json(response, 400, { error: 'fixture_tool_not_declared' })
+ }
counters.streams += 1
const streamId = `resp-${randomBytes(6).toString('hex')}`
streams.set(streamId, { cancelled: false })
@@ -124,6 +133,19 @@ const server = createServer({ cert, key }, async (request, response) => {
delta: 'hello',
})}\n\n`
)
+ if (fixtureToolCall) {
+ response.write(
+ `data: ${JSON.stringify({
+ type: 'response.output_item.done',
+ item: {
+ type: 'function_call',
+ call_id: 'call-hermetic-optional',
+ name: fixtureToolCall.name,
+ arguments: JSON.stringify(fixtureToolCall.arguments),
+ },
+ })}\n\n`
+ )
+ }
response.write(
`event: response.completed\ndata: ${JSON.stringify({
type: 'response.completed',
diff --git a/tests/e2e/fixtures/package-lock.json b/tests/e2e/fixtures/package-lock.json
index 3c9437eab..7a82748ab 100644
--- a/tests/e2e/fixtures/package-lock.json
+++ b/tests/e2e/fixtures/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@clerum/e2e-test-fixtures",
- "version": "1.0.78",
+ "version": "1.0.79",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@clerum/e2e-test-fixtures",
- "version": "1.0.78",
+ "version": "1.0.79",
"dependencies": {
"@kubernetes/client-node": "^1.0.0"
},
diff --git a/tests/e2e/fixtures/package.json b/tests/e2e/fixtures/package.json
index 9729e9f7e..d27887f99 100644
--- a/tests/e2e/fixtures/package.json
+++ b/tests/e2e/fixtures/package.json
@@ -1,6 +1,6 @@
{
"name": "@clerum/e2e-test-fixtures",
- "version": "1.0.78",
+ "version": "1.0.79",
"description": "E2E test fixtures and utilities for Clerum testing",
"type": "module",
"main": "index.ts",
diff --git a/tests/e2e/playwright/desktop/codex-subscription-approved-tools.spec.ts b/tests/e2e/playwright/desktop/codex-subscription-approved-tools.spec.ts
index 88c225532..2432baed7 100644
--- a/tests/e2e/playwright/desktop/codex-subscription-approved-tools.spec.ts
+++ b/tests/e2e/playwright/desktop/codex-subscription-approved-tools.spec.ts
@@ -287,6 +287,7 @@ for (const scenario of cases) {
for (const request of requests) {
expect(request.connectorDefinitionCount).toBe(0)
expect(request.leakedSchema).toBe(false)
+ expect(request.explicitNonStrictCount).toBe(request.definitionCount)
expect(request.inputBytes).toBeGreaterThan(0)
expect(request.definitionCount).toBeGreaterThanOrEqual(3)
expect(request.definitionBytes).toBeGreaterThan(0)
@@ -356,6 +357,7 @@ for (const scenario of cases) {
for (const request of requests) {
expect(request.connectorDefinitionCount).toBe(0)
expect(request.leakedSchema).toBe(false)
+ expect(request.explicitNonStrictCount).toBe(request.definitionCount)
}
}
await testInfo.attach('repeat-task-metrics', {
@@ -474,6 +476,7 @@ for (const scenario of cases) {
for (const request of requests) {
expect(request.connectorDefinitionCount).toBe(0)
expect(request.leakedSchema).toBe(false)
+ expect(request.explicitNonStrictCount).toBe(request.definitionCount)
}
await testInfo.attach('upstream-revocation-evidence', {
body: JSON.stringify({ upstream: mode, requests }),
diff --git a/tests/e2e/playwright/helpers/approved-tools-scenarios.ts b/tests/e2e/playwright/helpers/approved-tools-scenarios.ts
index ba603b28f..493d07738 100644
--- a/tests/e2e/playwright/helpers/approved-tools-scenarios.ts
+++ b/tests/e2e/playwright/helpers/approved-tools-scenarios.ts
@@ -28,6 +28,7 @@ export type UpstreamEvidence = {
deniedResponses: number
requests: Array<{
definitionCount: number
+ explicitNonStrictCount: number
definitionBytes: number
inputBytes: number
connectorDefinitionCount: number
diff --git a/tests/e2e/playwright/package-lock.json b/tests/e2e/playwright/package-lock.json
index b271048f2..eeb73b776 100644
--- a/tests/e2e/playwright/package-lock.json
+++ b/tests/e2e/playwright/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-playwright-tests",
- "version": "0.1.48",
+ "version": "0.1.49",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-playwright-tests",
- "version": "0.1.48",
+ "version": "0.1.49",
"devDependencies": {
"@playwright/test": "^1.50.0",
"@types/node": "^22.0.0",
diff --git a/tests/e2e/playwright/package.json b/tests/e2e/playwright/package.json
index 026b81dc6..0c6f0421d 100644
--- a/tests/e2e/playwright/package.json
+++ b/tests/e2e/playwright/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-playwright-tests",
- "version": "0.1.48",
+ "version": "0.1.49",
"private": true,
"description": "Playwright E2E tests for Control UI and Desktop App",
"scripts": {