fix(test): restore openai model selection in ACP set_config_option test (#5721)

PR #5676 (an unrelated v5 settings-migration fix) inadvertently reverted
the model-selection assertion in the ACP integration test back to a flaky
form that asserts the session's current model is present in
availableModels. In CI (no real auth) the default current model is not in
availableModels, so the assertion fails with "expected false to be true",
breaking the Release workflow's "Integration Tests (No Sandbox)" job and
gating the Publish Release step.

Restore the robust form that explicitly picks an openai model from
availableModels (matching the version that shipped in every successful
release since March), which avoids the auth-dependent current-model
mismatch.
This commit is contained in:
Shaojin Wen 2026-06-23 06:53:41 +08:00 committed by GitHub
parent 2fd2104fa1
commit 9993c6f413
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -508,17 +508,17 @@ function setupAcpTest(
expect(modelOption).toBeDefined();
expect(modelOption!.currentValue).toBeTruthy();
const modelId = modelOption!.currentValue;
expect(
newSession.models.availableModels.some(
(model) => model.modelId === modelId,
),
).toBe(true);
// Test: Set model using set_config_option
// Use openai model to avoid auth issues
const openaiModel = newSession.models.availableModels.find((model) =>
model.modelId.includes('openai'),
);
expect(openaiModel).toBeDefined();
const setModelResult = (await sendRequest('session/set_config_option', {
sessionId: newSession.sessionId,
configId: 'model',
value: modelId,
value: openaiModel!.modelId,
})) as {
configOptions: Array<{
id: string;
@ -535,7 +535,7 @@ function setupAcpTest(
(opt) => opt.id === 'model',
);
expect(updatedModelOption).toBeDefined();
expect(updatedModelOption!.currentValue).toBe(modelId);
expect(updatedModelOption!.currentValue).toBe(openaiModel!.modelId);
} catch (e) {
if (stderr.length) {
console.error('Agent stderr:', stderr.join(''));