

















@@ -11,6 +11,8 @@ import {
1111isLiveProfileKeyModeEnabled,
1212isLiveTestEnabled,
1313logLiveProgress,
14+requiresLiveProfileCredential,
15+resolveLiveCredentialPrecedence,
1416} from "./live-test-helpers.js";
1517import { getApiKeyForModel, requireApiKey } from "./model-auth.js";
1618import { ensureOpenClawModelsJson } from "./models-config.js";
@@ -20,7 +22,6 @@ import { transformTransportMessages } from "./transport-message-transform.js";
20222123const LIVE = isLiveTestEnabled();
2224const REQUIRE_PROFILE_KEYS = isLiveProfileKeyModeEnabled();
23-const LIVE_CREDENTIAL_PRECEDENCE = REQUIRE_PROFILE_KEYS ? "profile-first" : "env-first";
2425const DEFAULT_TARGET_MODEL_REFS = "openai-codex/gpt-5.5,google/gemini-3-flash-preview";
2526const TARGET_MODEL_REFS = parseTargetModelRefs(
2627process.env.OPENCLAW_LIVE_TOOL_REPLAY_REPAIR_MODELS ?? DEFAULT_TARGET_MODEL_REFS,
@@ -214,14 +215,20 @@ describeLive("tool replay repair live", () => {
214215apiKeyInfo = await getApiKeyForModel({
215216 model,
216217 cfg,
217-credentialPrecedence: LIVE_CREDENTIAL_PRECEDENCE,
218+credentialPrecedence: resolveLiveCredentialPrecedence(
219+model.provider,
220+REQUIRE_PROFILE_KEYS,
221+),
218222});
219223} catch (error) {
220224logProgress(`[tool-replay-repair] skip ${target.ref} (${String(error)})`);
221225return;
222226}
223227224-if (REQUIRE_PROFILE_KEYS && !apiKeyInfo.source.startsWith("profile:")) {
228+if (
229+requiresLiveProfileCredential(model.provider, REQUIRE_PROFILE_KEYS) &&
230+!apiKeyInfo.source.startsWith("profile:")
231+) {
225232logProgress(
226233`[tool-replay-repair] skip ${target.ref} (non-profile credential source: ${apiKeyInfo.source})`,
227234);
@@ -319,14 +326,20 @@ describeLive("tool replay repair live", () => {
319326apiKeyInfo = await getApiKeyForModel({
320327 model,
321328 cfg,
322-credentialPrecedence: LIVE_CREDENTIAL_PRECEDENCE,
329+credentialPrecedence: resolveLiveCredentialPrecedence(
330+model.provider,
331+REQUIRE_PROFILE_KEYS,
332+),
323333});
324334} catch (error) {
325335logProgress(`[tool-replay-repair] skip ${target.ref} (${String(error)})`);
326336return;
327337}
328338329-if (REQUIRE_PROFILE_KEYS && !apiKeyInfo.source.startsWith("profile:")) {
339+if (
340+requiresLiveProfileCredential(model.provider, REQUIRE_PROFILE_KEYS) &&
341+!apiKeyInfo.source.startsWith("profile:")
342+) {
330343logProgress(
331344`[tool-replay-repair] skip ${target.ref} (non-profile credential source: ${apiKeyInfo.source})`,
332345);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。