test: reset cached model strings in claude lifecycle tests (#2384)

The custom-gateway lifecycle case initializes the process-global model string table with OpenAI aliases. Teardown did not clear it, so later getAgentModel haiku and fast-mode Opus tests in the same serial process resolved stale gpt-4o aliases. Reset the table in lifecycle setup and teardown.
This commit is contained in:
JATMN
2026-10-24 04:16:15 -07:00
committed by GitHub
parent d62eb70da1
commit 2976dbc0b0
@@ -7,6 +7,7 @@ import { mkdtempSync, rmSync, writeFileSync } from 'fs'
import { tmpdir } from 'os'
import { join } from 'path'
import {
resetModelStringsForTestingOnly,
setAllowedSettingSources,
setFlagSettingsInline,
setFlagSettingsPath,
@@ -503,6 +504,7 @@ function setIgnoredApiKeyHelper(): void {
beforeEach(async () => {
await acquireSharedMutationLock('claude.lifecycle.test.ts')
resetModelStringsForTestingOnly()
setFlagSettingsPath(undefined)
setFlagSettingsInline(null)
setAllowedSettingSources([...SETTING_SOURCES])
@@ -543,6 +545,7 @@ afterEach(async () => {
setFlagSettingsPath(undefined)
setFlagSettingsInline(null)
setAllowedSettingSources([...SETTING_SOURCES])
resetModelStringsForTestingOnly()
resetSettingsCache()
getClaudeAIOAuthTokens.cache?.clear?.()
resetGrowthBook()