Skip to content

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

TypeScript

test(codex-llm-proxy): drop the unreachable probe continuation check

Alfredo Lopeze75b04a117e5
diff --git a/codex-llm-proxy/test/approvedToolsUpstream.test.ts b/codex-llm-proxy/test/approvedToolsUpstream.test.ts
index 233813bbe..ac9970698 100644
--- a/codex-llm-proxy/test/approvedToolsUpstream.test.ts
+++ b/codex-llm-proxy/test/approvedToolsUpstream.test.ts
@@ -410,7 +410,7 @@ describe('approved-tools tool-call limit probe', () => {
expect(simulator.evidence().requests).toMatchObject([{ stage: 'limit_probe' }])
})
- it('rejects a second completion of the same probe turn as unexpected_retry', async () => {
+ it('rejects a retry and a continuation of an answered probe turn as unexpected_retry', async () => {
const simulator = createApprovedToolsUpstream()
const first = await request(simulator, [probe])
expect(first.response.status).toBe(200)
diff --git a/codex-llm-proxy/test/approvedToolsUpstream.ts b/codex-llm-proxy/test/approvedToolsUpstream.ts
index ff6235e6f..350aa4933 100644
--- a/codex-llm-proxy/test/approvedToolsUpstream.ts
+++ b/codex-llm-proxy/test/approvedToolsUpstream.ts
@@ -340,13 +340,14 @@ export function createApprovedToolsUpstream() {
const turn = createHash('sha256')
.update(JSON.stringify(history.slice(0, lastUser + 1)))
.digest('hex')
+ // The key covers history up to the probe message, so both a retry and
+ // a continuation (an over-limit batch never yields tool results, so a
+ // continuation means the limit was not enforced) of an answered turn
+ // land here.
if (answeredProbeTurns.has(turn)) {
evidence.limitProbe.unexpectedRetries++
throw new Error('unexpected_retry')
}
- // An over-limit batch never yields tool results, so a continuation
- // means the limit was not enforced.
- if (history.length !== lastUser + 1) throw new Error('unexpected_probe_continuation')
answeredProbeTurns.add(turn)
evidence.limitProbe.turns++
evidence.completions++